Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MySettings(PropertyGroup):
- bpy.types.Scene.my_prop = bpy.props.BoolProperty(update=lambda self, context:
- common_update(self, context, 'my_bool_one'))
- def common_update(self, context, origin):
- obj = context.object
- scene = context.scene
- for ob in scene.objects:
- if (scene.my_prop == True):
- if ob.name.startswith("Glide"):
- ob.hide = True
- else:
- ob.hide = False #This will not unhide it. Unhide does not work either!
- else:
- ob.hide = False
- class PathSETTINGS(Panel):
- bl_idname = "OBJECT_PT_my_panel"
- bl_label = "My Panel"
- bl_space_type = "VIEW_3D"
- bl_region_type = "TOOLS"
- bl_category = "NewTest"
- def draw(self, context):
- obj = context.object
- layout = self.layout
- scene = context.scene
- layout.label("First row")
- row = layout.row(align=True)
- row.alignment = 'EXPAND'
- row = layout.row()
- row = layout.row()
- # row.operator("object.lamp_add(type='HEMI'), text="Add Hemisphere")
- row = layout.row()
- row.prop(scene, "my_prop", text="Hide Object")
- row = layout.row()
- row = layout.row()
- row.prop(scene, "my_enum")
- def register():
- bpy.types.Scene.my_prop
- bpy.utils.register_class(PathSETTINGS)
- bpy.utils.register_class(MySettings)
- def unregister():
- del bpy.types.Scene.my_prop
- bpy.utils.unregister_class(PathSETTINGS)
- bpy.utils.uregister_class(PathSETTINGS)
Add Comment
Please, Sign In to add comment