16 lines
844 B
Python
16 lines
844 B
Python
import bpy
|
|
from mathutils import Vector
|
|
s=bpy.context.scene
|
|
c=next(c for c in s.collection.children if c.name.startswith('User Gloved Hands'))
|
|
for o in c.objects:
|
|
if o.name in ('sleeve','hardknuckle') or o.type=='ARMATURE':o.hide_render=False;o.hide_set(False);o.hide_viewport=False
|
|
r=next(o for o in c.objects if o.type=='ARMATURE')
|
|
# Move shoulder base forward to put the support target within the arm's reach.
|
|
r.parent.location.x+=.65
|
|
bpy.context.view_layer.update()
|
|
for name,target in [('hand_IK_L.L',(1.05,-.12,-.38)),('hand_IK_L.R',(-2.95,.15,-1.05))]:
|
|
p=r.pose.bones[name];m=p.matrix.copy();m.translation=r.matrix_world.inverted()@Vector(target);p.matrix=m
|
|
bpy.context.view_layer.update()
|
|
bpy.ops.wm.save_as_mainfile(filepath=r'C:\roblox\hunter\3D models\sniper_reference_v10_grip.blend')
|
|
print('Hands visible; grip pose saved')
|