示例#1
0
	def abort(self):
		if len(self.knots) < 2:
			delete_objects([self.owner])
		else:
			self.lastknot = []
			self.knots.pop()
			self.update(self.ctx) # abort does not have ctx argument
			bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_VOLUME', center='MEDIAN')
示例#2
0
 def execute(self, ctx):
     cam = ctx.active_object
     transfoem = cam.matrix_world.copy()
     targ = cam.constraints["Track To"].target
     delete_objects([targ])
     TrackToConts = [c for c in cam.constraints if c.type == 'TRACK_TO']
     for c in TrackToConts:
         cam.constraints.remove(c)
     cam.matrix_world = transfoem
     self.report({'OPERATOR'}, 'bpy.ops.camera.clear_targte()')
     return {'FINISHED'}
示例#3
0
 def execute(self, ctx):
     obj = ctx.active_object
     transfoem = obj.matrix_world.copy()
     targ = obj.constraints["Track To"].target
     delete_objects([targ])
     TrackToConts = [c for c in obj.constraints if c.type == 'TRACK_TO']
     for c in TrackToConts:
         obj.constraints.remove(c)
     obj.matrix_world = transfoem
     self.report({'INFO'}, 'bpy.ops.light.clear_target()')
     return {'FINISHED'}
示例#4
0
文件: bone.py 项目: zpv5/BsMax_2_80
    def abort(self):
        bpy.ops.object.mode_set(mode='EDIT', toggle=False)
        edit_bones = self.data.edit_bones
        if len(edit_bones) > 0:
            edit_bones.remove(edit_bones[-1])
        for i in range(len(edit_bones) - 1):
            # TODO find a better way to replace with this ugly code
            bpy.ops.armature.select_all(action='DESELECT')
            edit_bones.active = edit_bones[i]
            edit_bones[i + 1].select = True
            bpy.ops.armature.parent_set(type='CONNECTED')

        bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
        if len(self.data.bones) == 0:
            delete_objects([self.owner])
        self.reset()
示例#5
0
	def abort(self):
		delete_objects([self.owner])
示例#6
0
文件: light.py 项目: zpv5/BsMax_2_80
 def abort(self):
     delete_objects([self.owner, self.target])