2023年2月13日月曜日

How to resize my blender market assets.

import bpy, mathutils


armature_object = bpy.data.objects["VultureArmature"]

multiplier=3

# Set the scale to multiplier

armature_object.scale *= multiplier


# set mode to object

bpy.ops.object.mode_set(mode='OBJECT')


# select the armature

armature_object.select_set(True)


# set the active object to the armature

bpy.context.view_layer.objects.active = armature_object


# apply the scale transformation

bpy.ops.object.transform_apply(scale=True)


    

Emptyaction1 = bpy.data.actions["VultureIKEmpty_L_Action"]


for fcu in Emptyaction1.fcurves:

    if "location" in fcu.data_path:

        for keyframe in fcu.keyframe_points:        

            keyframe.co = (keyframe.co - mathutils.Vector((keyframe.co.x,0))) * multiplier + mathutils.Vector((keyframe.co.x,0)) 

            keyframe.interpolation='LINEAR'                

Emptyaction2 = bpy.data.actions["VultureIKEmpty_R_Action"]


for fcu in Emptyaction2.fcurves:

    if "location" in fcu.data_path:

        for keyframe in fcu.keyframe_points:        

            keyframe.co = (keyframe.co - mathutils.Vector((keyframe.co.x,0))) * multiplier + mathutils.Vector((keyframe.co.x,0))               

            keyframe.interpolation='LINEAR'             

action = bpy.data.actions["VultureArmatureAction"]


for fcu in action.fcurves:

    if "location" in fcu.data_path:

        for keyframe in fcu.keyframe_points:        

            keyframe.co = (keyframe.co - mathutils.Vector((keyframe.co.x,0))) * multiplier + mathutils.Vector((keyframe.co.x,0))      

            keyframe.interpolation='LINEAR'       

0 件のコメント:

コメントを投稿