15 lines
670 B
Python
15 lines
670 B
Python
import bpy, os, json
|
|
source = r'C:\roblox\hunter\blender\sniper_modular.py'
|
|
ns = {'__name__': 'sniper_mcp'}
|
|
with open(source, encoding='utf-8') as f:
|
|
exec(compile(f.read(), source, 'exec'), ns)
|
|
ns['main']()
|
|
scene = ns['SCENE']
|
|
assert len(ns['WEAPON'].objects) > 30
|
|
folder = r'C:\roblox\hunter\3D models'
|
|
target = os.path.join(folder, 'sniper_modular.blend')
|
|
if os.path.exists(target):
|
|
target = os.path.join(folder, 'sniper_modular_' + str(int(__import__('time').time())) + '.blend')
|
|
bpy.ops.wm.save_as_mainfile(filepath=target)
|
|
print(json.dumps({'saved': target, 'scene': scene.name, 'weapon_objects': len(ns['WEAPON'].objects), 'engine': scene.render.engine}))
|