Esempio n. 1
0
 def update_additional_transform_influence(self):
     p_bone = self.__bone
     influence = p_bone.mmd_bone.additional_transform_influence
     constraints = p_bone.constraints
     c = constraints.get('mmd_additional_rotation', None)
     TransformConstraintOp.update_min_max(c, pi, influence)
     c = constraints.get('mmd_additional_location', None)
     TransformConstraintOp.update_min_max(c, 100, influence)
Esempio n. 2
0
 def __config(name, mute, map_type, value):
     if mute:
         remove_constraint(constraints, name)
         return
     c = TransformConstraintOp.create(constraints, name, map_type)
     c.target = p_bone.id_data
     shadow_bone.add_constraint(c)
     TransformConstraintOp.update_min_max(c, value, influence)
Esempio n. 3
0
 def __config_bone_morph(constraints, map_type, attributes, val, val_str):
     c_name = 'mmd_bind%s.%s'%(hash(data), map_type[:3])
     c = TransformConstraintOp.create(constraints, c_name, map_type)
     TransformConstraintOp.update_min_max(c, val, None)
     c.show_expanded = False
     c.target = arm
     c.subtarget = bname
     for attr in attributes:
         driver, variables = self.__driver_variables(armObj, c.path_from_id(attr))
         var = self.__add_single_prop(variables, obj, morph_data_path, 'b')
         expression = __config_groups(variables, var.name, groups)
         sign = '-' if attr.startswith('to_min') else ''
         driver.expression = '%s%s*(%s)'%(sign, val_str, expression)