Files
Hunter/blender/save_user_hands.py
T
2026-11-29 15:49:17 +03:00

18 lines
977 B
Python

import bpy,math
from mathutils import Vector
s=bpy.context.scene;c=next(c for c in s.collection.children if c.name.startswith('User Gloved Hands'))
rig=next(o for o in c.objects if o.type=='ARMATURE')
for o in c.objects:
if o not in [rig] and o.name not in ('sleeve','hardknuckle'):
o.hide_render=True;o.hide_set(True)
# Preserve the source rig, constraints and pose, normalize its large source units.
root=bpy.data.objects.new('Hands placement',None);c.objects.link(root)
rig.parent=root
root.scale=(.16,.16,.16);root.rotation_euler.z=math.pi/2
root.location=(-3,0,-3.5)
bpy.context.view_layer.update()
bpy.ops.object.select_all(action='DESELECT');rig.hide_set(False);rig.select_set(True);bpy.context.view_layer.objects.active=rig
path=r'C:\roblox\hunter\3D models\sniper_reference_v9_user_hands.blend'
bpy.ops.wm.save_as_mainfile(filepath=path)
print('SAVED',path,'meshes',[(o.name,len(o.data.vertices)) for o in c.objects if o.name in ('sleeve','hardknuckle')])