Continue Blender Web parity task handoff
This commit is contained in:
11
tools/web/generated/M16-GAP-00260.py
Normal file
11
tools/web/generated/M16-GAP-00260.py
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
import pathlib,sys,bpy
|
||||
ARMATURE_NAME="WebGapArmatureSplitArmature"; OBJECT_NAME="WebGapArmatureSplitObject"; ROOT_BONE="WebGapArmatureSplitRoot"; CHILD_BONE="WebGapArmatureSplitChild"; OTHER_BONE="WebGapArmatureSplitOther"
|
||||
def main():
|
||||
a=sys.argv[sys.argv.index("--")+1:]
|
||||
if len(a)!=1: raise SystemExit("usage")
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True); arm=bpy.data.armatures.new(ARMATURE_NAME); obj=bpy.data.objects.new(OBJECT_NAME,arm); bpy.context.scene.collection.objects.link(obj); bpy.context.view_layer.objects.active=obj; obj.select_set(True); bpy.ops.object.mode_set(mode="EDIT")
|
||||
root=arm.edit_bones.new(ROOT_BONE); root.head=(0,0,0); root.tail=(0,1,0); child=arm.edit_bones.new(CHILD_BONE); child.head=(0,1,0); child.tail=(0,2,0); child.parent=root; child.use_connect=True; other=arm.edit_bones.new(OTHER_BONE); other.head=(2,0,0); other.tail=(2,1,0); root.select=True; root.select_head=True; root.select_tail=True
|
||||
for b in (child,other): b.select=False; b.select_head=False; b.select_tail=False
|
||||
arm.edit_bones.active=root; bpy.ops.object.mode_set(mode="OBJECT"); bpy.ops.wm.save_as_mainfile(filepath=str(pathlib.Path(a[0]).resolve()),check_existing=False,compress=True)
|
||||
if __name__=="__main__": main()
|
||||
Reference in New Issue
Block a user