https://github.com/ousttrue/io_scene_yup
Y-UP Scene importer and exporter for Blender
https://github.com/ousttrue/io_scene_yup
Last synced: about 1 year ago
JSON representation
Y-UP Scene importer and exporter for Blender
- Host: GitHub
- URL: https://github.com/ousttrue/io_scene_yup
- Owner: ousttrue
- License: mit
- Created: 2018-07-27T16:28:20.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-25T11:24:22.000Z (about 2 years ago)
- Last Synced: 2025-02-10T12:16:46.815Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 66.4 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# YUP
Scene importer and exporter for Blender

# ToDo
|Exporter features| |
|----------------|--|
|Z-up to Y-up |✔️|
|Unpack image | |
|Apply object TRS| |
|Apply modifiers | |
|ShapeKeys | |
|Animations | |
|Merge meshes | |
|Remove empty nodes| |
# Test by blender python module
* https://en.blender.org/index.php/User:Ideasman42/BlenderAsPyModule
```py
import sys
import bpy
print('setup scene')
if len(sys.argv)>1:
bpy.ops.wm.open_mainfile(filepath=sys.argv[1])
else:
objs = [o for o in bpy.data.scenes[0].objects]
for o in objs:
bpy.data.objects.remove(o, True)
def create_mesh(mesh):
# Construct the bmesh cube and assign it to the blender mesh.
import bmesh
bm = bmesh.new()
#bmesh.ops.create_cube(bm, size=1.0)
bmesh.ops.create_monkey(bm)
bm.to_mesh(mesh)
bm.free()
mesh = bpy.data.meshes.new('Basic_Cube')
new_obj = bpy.data.objects.new("Basic_Cube", mesh)
print(new_obj, new_obj.data)
#bpy.data.scenes[0].objects.link(new_obj)
bpy.context.scene.objects.link(new_obj)
create_mesh(mesh)
print('call plugin')
import addon_io_scene_yup
addon_io_scene_yup.register()
bpy.ops.export_scene.yup('EXEC_DEFAULT', filepath='tmp.gltf', selectedonly=False)
```