我们从Python开源项目中,提取了以下3个代码示例,用于说明如何使用bpy.props.FloatVectorProperty()。
def register(): bpy.utils.register_module(__name__) bpy.types.Scene.uv_bake_alpha_color = FloatVectorProperty( name="Alpha Color", description="Color to be used for transparency", subtype='COLOR', min=0.0, max=1.0)
def execute(self, context): # saving bpy.types.Scene.LocStart = FloatVectorProperty( name = "LocStart", description = "") bpy.types.Scene.LocEnd = FloatVectorProperty( name = "LocEnd", description = "") bpy.types.Scene.LocDifference = FloatVectorProperty( name = "LocDifference", description = "") bpy.types.Scene.RotStart = FloatVectorProperty( name = "RotStart", description = "") bpy.types.Scene.RotEnd = FloatVectorProperty( name = "RotEnd", description = "") bpy.types.Scene.RotDifference = FloatVectorProperty( name = "RotDifference", description = "") bpy.types.Scene.QRotStart = FloatVectorProperty( name = "QRotStart", description = "", size = 4 ) bpy.types.Scene.QRotEnd = FloatVectorProperty( name = "QRotEnd", description = "", size = 4 ) bpy.types.Scene.QRotDifference = FloatVectorProperty( name = "QRotDifference", description = "", size = 4 ) bpy.types.Scene.SclStart = FloatVectorProperty( name = "SclStart", description = "") bpy.types.Scene.SclEnd = FloatVectorProperty( name = "SclEnd", description = "") bpy.types.Scene.SclDifference = FloatVectorProperty( name = "SclDifference", description = "") # you need bone with action if(context.object.animation_data.action == None): self.report({'ERROR'},"No Action for Offset Found") return {'FINISHED'} # if bone is not selected, object is offseted selected = bpy.context.active_pose_bone if( selected == None ): selected = bpy.context.active_object # cycling all selected bones # for selectedBone in bpy.context.selected_pose_bones: currentLocation = selected.location currentRotation = Vector (( selected.rotation_euler[0], selected.rotation_euler[1], selected.rotation_euler[2] )) currentQRotation = Vector (( selected.rotation_quaternion[0], selected.rotation_quaternion[1], selected.rotation_quaternion[2], selected.rotation_quaternion[3] )) currentScale = Vector (( selected.scale[0], selected.scale[1], selected.scale[2] )) SaveRemoveOffset( self, context, currentLocation, currentRotation, currentScale, selected, currentQRotation ) # update motions paths if displayed try: bpy.ops.pose.paths_update() except: pass return {'FINISHED'}