Complete M16 asset operator parity chain
This commit is contained in:
11
tools/web/generated/M16-GAP-00273.py
Normal file
11
tools/web/generated/M16-GAP-00273.py
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
import pathlib, sys, bpy
|
||||
LIBRARY_NAME="WebGapCatalogUndoPush.blend"; OBJECT_NAME="WebGapCatalogUndoPushObject"
|
||||
def main():
|
||||
args=sys.argv[sys.argv.index("--")+1:]
|
||||
if len(args)!=1: raise SystemExit("usage")
|
||||
output=pathlib.Path(args[0]).resolve(); source=output.with_name(LIBRARY_NAME); bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
mesh=bpy.data.meshes.new("WebGapCatalogUndoPushMesh"); mesh.from_pydata([(-1,0,0),(1,0,0),(0,1,0)],[],[(0,1,2)]); obj=bpy.data.objects.new(OBJECT_NAME,mesh); bpy.context.scene.collection.objects.link(obj); bpy.ops.wm.save_as_mainfile(filepath=str(source),check_existing=False,compress=True); bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
with bpy.data.libraries.load(str(source),link=True) as (data_from,data_to): data_to.objects=[OBJECT_NAME]
|
||||
bpy.context.scene.collection.objects.link(data_to.objects[0]); bpy.ops.wm.save_as_mainfile(filepath=str(output),check_existing=False,compress=True)
|
||||
if __name__=="__main__": main()
|
||||
Reference in New Issue
Block a user