Пример #1
0
 def execute(self, context):
     obj = context.object
     obj_bp = utils.get_assembly_bp(obj)
     if obj_bp:
         obj_list = []
         obj_list = utils.get_child_objects(obj_bp,obj_list)
         bpy.ops.object.select_all(action='DESELECT')
         for obj in obj_list:
             obj.hide = False
             obj.select = True
         
         bpy.ops.object.duplicate()
         
         for obj in context.selected_objects:
             if obj.type == 'EMPTY':
                 obj.hide = True
         
         for obj in obj_list:
             if obj.type == 'EMPTY':
                 obj.hide = True
             obj.location = obj.location
         bpy.ops.object.select_all(action='DESELECT')
         
         obj_bp.select = True
         context.scene.objects.active = obj_bp
         
     return {'FINISHED'}
 def assign_boolean(self,obj):
     if obj:
         objs = utils.get_child_objects(self.assembly.obj_bp)
         for obj_bool in objs:
             if obj_bool.mv.use_as_bool_obj:
                 obj_bool.hide = True
                 mod = obj.modifiers.new(obj_bool.name,'BOOLEAN')
                 mod.object = obj_bool
                 mod.operation = 'DIFFERENCE'
Пример #3
0
 def execute(self, context):
     obj = bpy.data.objects[self.object_name]
     obj_list = []
     obj_list = utils.get_child_objects(obj,obj_list)
     bpy.ops.object.select_all(action='DESELECT')
     for obj in obj_list:
         obj.hide = False
         obj.select = True
     return {'FINISHED'}
Пример #4
0
 def assign_boolean(self, obj):
     if obj:
         objs = utils.get_child_objects(self.assembly.obj_bp)
         for obj_bool in objs:
             if obj_bool.mv.use_as_bool_obj:
                 obj_bool.hide = True
                 mod = obj.modifiers.new(obj_bool.name, 'BOOLEAN')
                 mod.object = obj_bool
                 mod.operation = 'DIFFERENCE'
Пример #5
0
 def execute(self, context):
     obj_bp = utils.get_bp(context.object,'PRODUCT')
     bool_list = []
     self.get_boolean_objects(obj_bp, bool_list)
     for bool_obj in bool_list:
         self.remove_referenced_modifiers(context, bool_obj)
     obj_list = []
     obj_list = utils.get_child_objects(obj_bp,obj_list)
     utils.delete_obj_list(obj_list)
     self.object_name = ""
     return {'FINISHED'}
Пример #6
0
 def execute(self, context):
     obj_bp = utils.get_parent_assembly_bp(context.object)
     if obj_bp:
         list_obj = utils.get_child_objects(obj_bp)
         for obj in list_obj:
             obj.hide = False
             obj.hide_select = False
             obj.select = True
         bpy.ops.group.create(name=self.assembly_name)
         
         obj_bp.location = obj_bp.location
     return {'FINISHED'}
Пример #7
0
 def execute(self, context):
     wall_bps = []
     for obj in bpy.data.objects:
         if obj.mv.type == 'BPWALL':
             wall_bps.append(obj)
             
     for wall in wall_bps:
         children = utils.get_child_objects(wall)
         
         for child in children:
             if child.type == 'MESH' and not child.mv.type == 'CAGE':
                 child.hide = False
         wall.location = wall.location
     return {'FINISHED'}
Пример #8
0
 def execute(self, context):
     if self.wall_bp_name in context.scene.objects:
         obj = context.scene.objects[self.wall_bp_name]
     else:
         obj = context.active_object
         
     wall_bp = utils.get_wall_bp(obj)
     
     children = utils.get_child_objects(wall_bp)
     
     for child in children:
         child.hide = True
     
     wall_bp.hide = True
     
     return {'FINISHED'}
Пример #9
0
 def execute(self, context):
     obj = bpy.data.objects[self.object_name]
     obj_bp = utils.get_assembly_bp(obj)
     if obj_bp:
         
         obj_list = []
         obj_list = utils.get_child_objects(obj_bp,obj_list)
         bpy.ops.object.select_all(action='DESELECT')
         
         for obj in obj_list:
             obj.hide = False
             obj.select = True
         
         bpy.ops.object.duplicate()
         
         for obj in context.selected_objects:
             if obj.type == 'EMPTY':
                 obj.hide = True
         
         for obj in obj_list:
             if obj.type == 'EMPTY':
                 obj.hide = True
             if obj.mv.type == 'BPASSEMBLY':
                 obj.hide = True
             obj.location = obj.location
         bpy.ops.object.select_all(action='DESELECT')
         
         obj_bp.select = True
         context.scene.objects.active = obj_bp
         
         assembly = fd_types.Assembly(obj_bp)
         if assembly.obj_bp.mv.drop_id != "":
             self.clear_drivers(assembly)
             eval('bpy.ops.' + assembly.obj_bp.mv.drop_id + '("INVOKE_DEFAULT",object_name=assembly.obj_bp.name)')
             return {'FINISHED'}
         if assembly.obj_bp.mv.type_group == 'PRODUCT':
             self.clear_drivers(assembly)
             eval('bpy.ops.fd_general.drop_product("INVOKE_DEFAULT",object_name=assembly.obj_bp.name)')
             return {'FINISHED'}
         if assembly.obj_bp.mv.type_group == 'INSERT':
             self.clear_drivers(assembly)
             eval('bpy.ops.fd_general.drop_insert("INVOKE_DEFAULT",object_name=assembly.obj_bp.name)')
             return {'FINISHED'}
         
     return {'FINISHED'}
Пример #10
0
 def execute(self, context):
     if self.wall_bp_name in context.scene.objects:
         obj = context.scene.objects[self.wall_bp_name]
     else:
         obj = context.active_object
         
     wall_bp = utils.get_wall_bp(obj)
     
     children = utils.get_child_objects(wall_bp)
     
     for child in children:
         if child.type != 'EMPTY':
             child.hide = False
             
     wall_bp.location = wall_bp.location
     
     wall_bp.hide = False
     
     return {'FINISHED'}
Пример #11
0
 def execute(self, context):
     obj_bools = []
     obj = context.object
     obj_bp = utils.get_parent_assembly_bp(obj)
     if obj_bp:
         obj_list = []
         obj_list = utils.get_child_objects(obj_bp,obj_list)
         bpy.ops.object.select_all(action='DESELECT')
         for obj in obj_list:
             obj.hide = False
             obj.select = True
         
         bpy.ops.object.duplicate()
         
         for obj in context.selected_objects:
             if obj.type == 'EMPTY':
                 obj.hide = True
             #COLLECT BOOLEAN OBJECTS FROM GROUP
             if obj.mv.use_as_bool_obj:
                 obj_bools.append(obj)
             obj.location = obj.location
         
         for obj in obj_list:
             if obj.type == 'EMPTY':
                 obj.hide = True
             obj.location = obj.location
         bpy.ops.object.select_all(action='DESELECT')
         
         #ASSIGN BOOLEAN MODIFIERS TO WALL
         if obj_bp.parent:
             if obj_bp.parent.mv.type == 'BPWALL':
                 wall = fd_types.Wall(obj_bp.parent)
                 mesh = wall.get_wall_mesh()
                 for obj_bool in obj_bools:
                     mod = mesh.modifiers.new(obj_bool.name,'BOOLEAN')
                     mod.object = obj_bool
                     mod.operation = 'DIFFERENCE'
         
         obj_bp.select = True
         context.scene.objects.active = obj_bp
         
     return {'FINISHED'}
Пример #12
0
 def execute(self, context):
     obj = context.active_object
     wall_bp = utils.get_wall_bp(obj)
     wall_bps = []
     for obj in context.visible_objects:
         if obj.mv.type == 'BPWALL':
             wall_bps.append(obj)
             
     for wall in wall_bps:
         if wall != wall_bp:
             children = []
             children = utils.get_child_objects(wall)
             
             for child in children:
                 child.hide = True
         else:
             wall_assembly = fd_types.Assembly(wall)
             wall_assembly.obj_x.select = True
             wall_assembly.obj_y.select = True
             wall_assembly.obj_z.select = True
     
     bpy.ops.view3d.view_selected()
     
     return {'FINISHED'}