def draw(self, context): ''' tunig ''' import properties_data_camera as blenderCam blenderCam.unregister() #from properties_data_camera import DATA_PT_context_camera #bpy.types.register(DATA_PT_context_camera) layout = self.layout split = layout.split() col = split.column() col.label(text="camera_type") col.prop(context.scene,"camera_type", text= "") if context.scene.camera_type == 'Angular': context.camera.type = 'PERSP' #this line is manually added col.prop(context.camera,"lens", text= "Angle") col.prop(context.scene,"max_angle", text= "Max Angle") col.prop(context.scene,"mirrored", text= "Mirrored") col.prop(context.scene,"circular", text= "Circular") if context.scene.camera_type == 'Orthographic': context.camera.type = 'ORTHO' col.prop(context.camera,"ortho_scale", text= "Scale") if context.scene.camera_type == 'Perspective': context.camera.type = 'PERSP' col.label(text="bokeh_type") col.prop(context.scene,"bokeh_type", text= "") col.prop(context.scene,"aperture", text= "Aperture") col.prop(context.camera,"dof_distance", text= "DOF distance") col.prop(context.scene,"bokeh_rotation", text= "Bokeh Rotation") col = split.column() col.label(text="bokeh_bias") col.prop(context.scene,"bokeh_bias", text= "") col.prop(context.camera,"lens", text= "Focal Length") if context.scene.camera_type == 'Architect': col.label(text="bokeh_type") col.prop(context.scene,"bokeh_type", text= "") col.prop(context.scene,"aperture", text= "Aperture") col.prop(context.camera,"dof_distance", text= "DOF distance") col.prop(context.scene,"bokeh_rotation", text= "Bokeh Rotation") col = split.column() col.label(text="bokeh_bias") col.prop(context.scene,"bokeh_bias", text= "") col.prop(context.camera,"lens", text= "Focal Length")
def poll(self, context): engine = context.scene.render.engine import properties_data_camera if (context.camera and (engine in self.COMPAT_ENGINES) ) : try : properties_data_camera.unregister() except: pass else: try: properties_data_camera.register() except: pass return (context.camera and (engine in self.COMPAT_ENGINES) )
def poll(self, context): engine = context.scene.render.engine import properties_data_camera if (context.camera and (engine in self.COMPAT_ENGINES)): try: properties_data_camera.unregister() except: pass else: try: properties_data_camera.register() except: pass return (context.camera and (engine in self.COMPAT_ENGINES))