Exemplo n.º 1
0
    def execute(self, context):
        
        source = grab_property_source(self, context)
        properties = grab_properties(self, context)
        source_type = self.Source_Type
        current_mode = context.mode        
        object = None
    

        if len(properties) > 0:
                
            if source:
                if not source.animation_data:
                    source.animation_data_create()
                extrapolation = source.animation_data.action_extrapolation
                source.animation_data.action_extrapolation = "NOTHING"

                for i in range(self.frame_start,self.frame_end):
                    context.scene.frame_set(i)
                    if self.All_Properties:
                        for prop in properties:    
                            if not source.animation_data:
                                source.animation_data_create()
                            path = rna_prop_ui.rna_idprop_quote_path(prop)
                            source.keyframe_insert(data_path = path)
                            source.keyframe_insert(data_path = path)
                    else:
                        prop = self.get_property_name(context)
                        if prop in properties:


                            path = rna_prop_ui.rna_idprop_quote_path(self.get_property_name(context))
                            source.keyframe_insert(data_path = path)
                            source.keyframe_insert(data_path = path)
                            
                source.animation_data.action_extrapolation = extrapolation

        return {'FINISHED'}
Exemplo n.º 2
0
 def set_custom_property_value(self,
                               rig,
                               bone_name,
                               prop,
                               value,
                               *,
                               keyflags=None):
     "Assign the value of a custom property, and optionally keyframe it."
     from rna_prop_ui import rna_idprop_ui_prop_update
     bone = rig.pose.bones[bone_name]
     bone[prop] = value
     rna_idprop_ui_prop_update(bone, prop)
     if keyflags is not None:
         bone.keyframe_insert(rna_idprop_quote_path(prop),
                              group=bone.name,
                              options=keyflags)
Exemplo n.º 3
0
 def custom_prop(self, bone_name, prop_name, **params):
     """Add a custom property input field to the panel."""
     param_str = quote_parameters([rna_idprop_quote_path(prop_name)],
                                  params)
     self.add_line("%s.prop(pose_bones[%r], %s)" %
                   (self.layout, bone_name, param_str))