Compare commits
4 commits
7f4460b88a
...
081063647d
Author | SHA1 | Date | |
---|---|---|---|
|
081063647d | ||
|
3afcc0af56 | ||
|
f6eeae77c5 | ||
|
abd9491c47 |
BIN
objects/examples/Collada-DAE/Body_tex_003.jpg
Normal file
BIN
objects/examples/Collada-DAE/Body_tex_003.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 218 KiB |
BIN
objects/examples/Collada-DAE/Face_tex_002_toObj.jpg
Normal file
BIN
objects/examples/Collada-DAE/Face_tex_002_toObj.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 119 KiB |
BIN
objects/examples/Collada-DAE/Hair_tex_001.jpg
Normal file
BIN
objects/examples/Collada-DAE/Hair_tex_001.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 162 KiB |
BIN
objects/examples/Collada-DAE/ce.jpg
Normal file
BIN
objects/examples/Collada-DAE/ce.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 125 KiB |
306
objects/examples/Collada-DAE/elf.dae
Normal file
306
objects/examples/Collada-DAE/elf.dae
Normal file
File diff suppressed because one or more lines are too long
388
objects/examples/JSON/scene.json
Normal file
388
objects/examples/JSON/scene.json
Normal file
File diff suppressed because one or more lines are too long
4311
objects/examples/OBJ/tree.obj
Normal file
4311
objects/examples/OBJ/tree.obj
Normal file
File diff suppressed because it is too large
Load diff
BIN
objects/examples/PLY/Lucy100k.ply
Normal file
BIN
objects/examples/PLY/Lucy100k.ply
Normal file
Binary file not shown.
|
@ -26,7 +26,7 @@ BASE_DIR = os.path.abspath(
|
||||||
'../')
|
'../')
|
||||||
)
|
)
|
||||||
OBJECT_DIR = os.path.join(BASE_DIR, 'objects')
|
OBJECT_DIR = os.path.join(BASE_DIR, 'objects')
|
||||||
OBJECT_TYPES = ['gltf', 'glb', 'obj', 'fbx', 'stl', 'dae']
|
OBJECT_TYPES = ['gltf', 'glb', 'obj', 'fbx', 'stl', 'dae', 'json', 'ply']
|
||||||
|
|
||||||
def get_directory_content(dir_path):
|
def get_directory_content(dir_path):
|
||||||
content = []
|
content = []
|
||||||
|
@ -107,6 +107,16 @@ def get_object(file_path, result={}):
|
||||||
object_path = str(file_path).replace(OBJECT_DIR, "")
|
object_path = str(file_path).replace(OBJECT_DIR, "")
|
||||||
result['urls'].append(f"/objects{object_path}")
|
result['urls'].append(f"/objects{object_path}")
|
||||||
return result
|
return result
|
||||||
|
if extension == 'json':
|
||||||
|
result['type'] = "json"
|
||||||
|
object_path = str(file_path).replace(OBJECT_DIR, "")
|
||||||
|
result['urls'].append(f"/objects{object_path}")
|
||||||
|
return result
|
||||||
|
if extension == 'ply':
|
||||||
|
result['type'] = "ply"
|
||||||
|
object_path = str(file_path).replace(OBJECT_DIR, "")
|
||||||
|
result['urls'].append(f"/objects{object_path}")
|
||||||
|
return result
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,24 @@
|
||||||
>
|
>
|
||||||
</model-collada>
|
</model-collada>
|
||||||
%end
|
%end
|
||||||
|
%if object['type'] == "json":
|
||||||
|
<model-three
|
||||||
|
:backgroundAlpha="0"
|
||||||
|
@on-load="onLoad"
|
||||||
|
:rotation="rotation"
|
||||||
|
src="{{ object['urls'][0] }}"
|
||||||
|
>
|
||||||
|
</model-three>
|
||||||
|
%end
|
||||||
|
%if object['type'] == "ply":
|
||||||
|
<model-ply
|
||||||
|
:backgroundAlpha="0"
|
||||||
|
@on-load="onLoad"
|
||||||
|
:rotation="rotation"
|
||||||
|
src="{{ object['urls'][0] }}"
|
||||||
|
>
|
||||||
|
</model-ply>
|
||||||
|
%end
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue