<s> from bpy . types import PropertyGroup <EOL> from bpy . props import StringProperty , IntProperty , BoolProperty , FloatProperty , FloatVectorProperty <EOL> from mmd_tools . core . bone import FnBone <EOL> def _updateMMDBoneAdditionalTransform ( prop , context ) : <EOL> prop [ '<STR_LIT>' ] = True <EOL> def _getAdditionalTransformBone ( prop ) : <EOL> arm = prop . id_data <EOL> bone_id = prop . get ( '<STR_LIT>' , - <NUM_LIT:1> ) <EOL> if bone_id < <NUM_LIT:0> : <EOL> return '<STR_LIT>' <EOL> fnBone = FnBone . from_bone_id ( arm , bone_id ) <EOL> if not fnBone : <EOL> return '<STR_LIT>' <EOL> return fnBone . pose_bone . name <EOL> def _setAdditionalTransformBone ( prop , value ) : <EOL> arm = prop . id_data <EOL> prop [ '<STR_LIT>' ] = True <EOL> if value not in arm . pose . bones . keys ( ) : <EOL> prop [ '<STR_LIT>' ] = - <NUM_LIT:1> <EOL> return <EOL> pose_bone = arm . pose . bones [ value ] <EOL> bone = FnBone ( pose_bone ) <EOL> prop [ '<STR_LIT>' ] = bone . bone_id <EOL> class MMDBone ( PropertyGroup ) : <EOL> name_j = StringProperty ( <EOL> name = '<STR_LIT:Name>' , <EOL> description = '<STR_LIT>' , <EOL> default = '<STR_LIT>' , <EOL> ) <EOL> name_e = StringProperty ( <EOL> name = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> default = '<STR_LIT>' , <EOL> ) <EOL> bone_id = IntProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = - <NUM_LIT:1> , <EOL> ) <EOL> transform_order = IntProperty ( <EOL> name = '<STR_LIT>' , <EOL> min = <NUM_LIT:0> , <EOL> max = <NUM_LIT:100> , <EOL> ) <EOL> is_visible = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = True , <EOL> ) <EOL> is_controllable = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = True , <EOL> ) <EOL> transform_after_dynamics = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = False , <EOL> ) <EOL> use_tail_location = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = False , <EOL> ) <EOL> enabled_fixed_axis = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = False , <EOL> ) <EOL> fixed_axis = FloatVectorProperty ( <EOL> name = '<STR_LIT>' , <EOL> size = <NUM_LIT:3> , <EOL> default = [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> ) <EOL> enabled_local_axes = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = False , <EOL> ) <EOL> local_axis_x = FloatVectorProperty ( <EOL> name = '<STR_LIT>' , <EOL> size = <NUM_LIT:3> , <EOL> default = [ <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> ) <EOL> local_axis_z = FloatVectorProperty ( <EOL> name = '<STR_LIT>' , <EOL> size = <NUM_LIT:3> , <EOL> default = [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> ] , <EOL> ) <EOL> is_tip = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = False , <EOL> ) <EOL> has_additional_rotation = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = False , <EOL> update = _updateMMDBoneAdditionalTransform , <EOL> ) <EOL> has_additional_location = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = False , <EOL> update = _updateMMDBoneAdditionalTransform , <EOL> ) <EOL> additional_transform_bone = StringProperty ( <EOL> name = '<STR_LIT>' , <EOL> set = _setAdditionalTransformBone , <EOL> get = _getAdditionalTransformBone <EOL> ) <EOL> additional_transform_bone_id = IntProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = - <NUM_LIT:1> , <EOL> update = _updateMMDBoneAdditionalTransform , <EOL> ) <EOL> additional_transform_influence = FloatProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = <NUM_LIT:1> , <EOL> update = _updateMMDBoneAdditionalTransform , <EOL> ) <EOL> is_additional_transform_dirty = BoolProperty ( <EOL> name = '<STR_LIT>' , <EOL> default = True <EOL> ) </s>
