moguri / blend2bam Goto Github PK
View Code? Open in Web Editor NEWA CLI tool to convert Blender blend files to Panda3D BAM files
License: MIT License
A CLI tool to convert Blender blend files to Panda3D BAM files
License: MIT License
So I tried converting a .blend file to .bam with blend2bam as suggested by the official Panda3D page but I am getting a FileNotFoundError. I am using Windows with Python3.7 (from the Panda3D install). I tried a lot of possibilities of how one could address the src and dst but it still did not work.
One example:
C:\Panda3D-1.10.6-x64\mystuff\pandatest>blend2bam C:\Panda3D-1.10.6-x64\mystuff\pandatest\car_model.blend C:\Panda3D-1.10.6-x64\mystuff\pandatest\
Traceback (most recent call last):
File "c:\panda3d-1.10.6-x64\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\panda3d-1.10.6-x64\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Panda3D-1.10.6-x64\python\Scripts\blend2bam.exe\__main__.py", line 9, in <module>
File "c:\panda3d-1.10.6-x64\python\lib\site-packages\blend2bam\cli.py", line 195, in main
use_gltf28 = blenderutils.is_blender_28(args.blender_dir)
File "c:\panda3d-1.10.6-x64\python\lib\site-packages\blend2bam\blenderutils.py", line 22, in is_blender_28
output = subprocess.check_output([binpath, '--version'])
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "c:\panda3d-1.10.6-x64\python\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] Das System kann die angegebene Datei nicht finden
Yes I also tried first exporting as .glb and then trying to convert.
This request is for two connected features:
First, that blend2bam be given a Blender-integrated UI, invoked from Blender's "export" menu.
And second, that when exporting via this UI, the option be present to export only those objects that are selected in Blender.
The first, I feel, would go a long way to making the exporter user-friendly--and especially to new users.
If I'm not much mistaken, recognition tends to be easier than recollection, and thus I would expect that visual UI controls would tend to be easer to use than command-line arguments.
UI controls may also be more convenient, by virtue of clicks requiring less subjective effort than typing.
The second, I feel, would greatly enhance the utility and power of the exporter.
Right now, any workflow that includes elements that are not intended for export (e.g. template objects), or even just multiple individual objects in a single Blender-file, isn't feasible with blend2bam--all will be exported regardless, if I'm not much mistaken. Allowing the user to specify which objects are to be exported would enable these workflows, I daresay--and, well, Blender provides a means to that via its selection functionality.
Sorta.
Taking a blend file and loading it via loader.loadModel("reference/to/the/file.blend")
, the second time the program is run the light is ...missing. Or something. It's no longer having the same effect on the render result, but the listed position from printing the tree hasn't changed.
This only seems to have an effect on "live" .blend
files - manually packing the .bam
file for distribution works fine. Saving the file resets the issue. So whatever is going is almost certainly related to the conversion cache, but it's not clear why.
ModelRoot Scene S:(LightAttrib)
PandaNode Cube
GeomNode Cube (1 geoms: S:(CullFaceAttrib MaterialAttrib TextureAttrib))
PandaNode Light T:m(pos 4.07625 1.00545 5.90386 hpr 104.532 37.1946 3.97274)
PointLight Light ( PerspectiveLens PerspectiveLens PerspectiveLens PerspectiveLens PerspectiveLens PerspectiveLens ):
color 1000 1000 1000 1000
attenuation 1 0 1
PandaNode Camera T:m(pos 7.35889 -6.92579 4.95831 hpr 46.6919 63.5593 3.05786e-06)
Camera Camera ( PerspectiveLens )
PerspectiveLens fov = 40.7026 22.8952
ModelRoot Scene S:(LightAttrib)
PandaNode Cube
GeomNode Cube (1 geoms: S:(CullFaceAttrib MaterialAttrib TextureAttrib))
PandaNode Light T:m(pos 4.07625 1.00545 5.90386 hpr 104.532 37.1946 3.97274)
PointLight Light ( PerspectiveLens PerspectiveLens PerspectiveLens PerspectiveLens PerspectiveLens PerspectiveLens ):
color 1000 1000 1000 1000
attenuation 1 0 1
PandaNode Camera T:m(pos 7.35889 -6.92579 4.95831 hpr 46.6919 63.5593 3.05786e-06)
Camera Camera ( PerspectiveLens )
PerspectiveLens fov = 40.7026 22.8952
Changing the light type from point to directional (Sun) makes it imply that the light is rotated around somewhere:
ModelRoot Scene S:(LightAttrib)
PandaNode Cube
GeomNode Cube (1 geoms: S:(CullFaceAttrib MaterialAttrib TextureAttrib))
PandaNode Light T:m(pos 4.07625 1.00545 5.90386 hpr 104.532 37.1946 3.97274)
DirectionalLight Light ( OrthographicLens ):
color 1000 1000 1000 1000
direction 0 1 0
PandaNode Camera T:m(pos 7.35889 -6.92579 4.95831 hpr 46.6919 63.5593 3.05786e-06)
Camera Camera ( PerspectiveLens )
PerspectiveLens fov = 40.7026 22.8952
ModelRoot Scene S:(LightAttrib)
PandaNode Cube
GeomNode Cube (1 geoms: S:(CullFaceAttrib MaterialAttrib TextureAttrib))
PandaNode Light T:m(pos 4.07625 1.00545 5.90386 hpr 104.532 37.1946 3.97274)
DirectionalLight Light ( OrthographicLens ):
color 1000 1000 1000 1000
direction 0 1 0
PandaNode Camera T:m(pos 7.35889 -6.92579 4.95831 hpr 46.6919 63.5593 3.05786e-06)
Camera Camera ( PerspectiveLens )
PerspectiveLens fov = 40.7026 22.8952
Trivial program file:
"""
Quick test module
"""
from panda3d.core import loadPrcFileData
from direct.showbase.ShowBase import ShowBase
class MyApp(ShowBase):
"""
Quick test class
"""
def __init__(self):
ShowBase.__init__(self)
# Load the environment model.
self.scene = self.loader.loadModel("untitled.blend")
# Reparent the model to render.
self.scene.reparentTo(self.render)
self.scene.setPos(0, 0, 0)
# Modify the default camera
self.disableMouse()
#self.useDrive()
self.camera.setPos(7.3589, -6.9258, 4.9583)
self.camera.lookAt(0, 0, 0)
self.scene.ls()
def generate_synth():
"""
Quick test method
"""
loadPrcFileData("",
"""
textures-power-2 none
audio-library-name null # Prevent ALSA errors
show-frame-rate-meter 0
sync-video 0
""" )
base = MyApp()
base.run()
generate_synth()
There appears to be a file path issue with the temp file used by the loading process.
:express(warning): Filename uses Windows-style path: C:\Users\nxtla\AppData\Local\Temp\tmpb74tu0dg.bam
:express(warning): expected Unix-style path: /c/Users/nxtla/AppData/Local/Temp/tmpb74tu0dg.bam
:express(warning): Filename uses Windows-style path: C:\Users\nxtla\AppData\Local\Temp\tmpb74tu0dg.bam
:express(warning): expected Unix-style path: /c/Users/nxtla/AppData/Local/Temp/tmpb74tu0dg.bam
:loader(error): Couldn't load file C:\Users\nxtla\AppData\Local\Temp\tmpb74tu0dg.bam: does not exist.
:loader(error): load_file must return valid PandaNode or raise exception
:loader(error): Couldn't load file test.blend: all matching files on model path invalid (the model path is currently: "/c/Users/nxtla/AppData/Local/Temp;/c/Users/nxtla/AppData/Local/Temp;/d/dev/Nxt Games/CaptureThePacket;/c/Users/nxtla/AppData/Local/Programs/Python/Python38-32/Lib/site-packages/panda3d/etc/..;/c/Users/nxtla/AppData/Local/Programs/Python/Python38-32/Lib/site-packages/panda3d/etc/../models")
Traceback (most recent call last):
File "test.py", line 5, in <module>
test = loader.load_model('test.blend')
File "C:\Users\nxtla\AppData\Local\Programs\Python\Python38-32\lib\site-packages\direct\showbase\Loader.py", line 298, in loadModel
raise IOError(message)
OSError: Could not load model file(s): ['test.blend']
A way to set a lot of random objects in a scene is by using a hair particle emitter. An option to have them automatically applied by blend2bam would be great.
When using blend2bam in conjunction with pman (which by default copies the .blend file to built_assets and relies on the loader hook instead), it results in locate_blenderdir()
never being called, because that code never goes through cli.py::main.
blend2bam will still say 'no blender found' with Blender installed as a flatpak package.
Not sure if this is because of the sandboxing of flatpaks or permissions (i really don't know much at all)
Support a set of options for converting textures to panda's native .txo
(and the compressed .txo.pz
) file format, including mipmap generation.
Especially for Blender 2.80+, where the gltf exporter converts textures to .jpg
/.png
(including, annoyingly, .dds
), this results in extremely slow-loading textures (my current project is loading a bunch of randomly selected objects for rendering for machine learning data generation - it's taking longer to load the objects than it will for the scene to be rendered, and possibly post-processed).
Blender is throwing an error while still successfully exporting a model:
Known pipe types:
glxGraphicsPipe
(all display modules loaded.)
Blender 2.91.0 (hash 0f45cab862b8 built 2020-11-25 08:51:08)
Warning: Falling back to the standard locale ("C")
Read prefs: /home/someuser/.config/blender/2.91/config/userpref.blend
found bundled python: /blender/2.91/python
srcroot: /panda/models/
Exporting: ['/panda/models/untitled.blend']
Export to: /tmp/
Read blend: /panda/models/untitled.blend
Converting .blend file (/panda/models/untitled.blend) to .gltf (/tmp/untitled.gltf)
Traceback (most recent call last):
File "/blender/2.91/scripts/addons/io_scene_gltf2/__init__.py", line 76, in on_export_format_changed
operator = sfile.active_operator
AttributeError: 'NoneType' object has no attribute 'active_operator'
File "/blender/2.91/scripts/addons/io_scene_gltf2/__init__.py", line 73, in on_export_format_changed
'/blender/2.91/python/lib/python3.7/site-packages/libextern_draco.so' exists, draco mesh compression is available
00:42:58 | INFO: Starting glTF 2.0 export
00:42:58 | INFO: Extracting primitive: Cube
00:42:58 | INFO: Primitives created: 1
00:42:58 | INFO: Finished glTF 2.0 export in 0.010235786437988281 s
... I'm not entirely sure that this is a blend2bam issue, but it may be due to how the export is being called. The error is not generated when the export is done manually from inside blender.
This is happening when just loading a default file.
Blender 2.91
panda3d-blend2bam 0.17
panda3d-gltf 0.11
repro.zip
I have a blend file and am getting this error. I haven't tested in detail but I think it happens because an object is still in edit mode.
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/blend2bam/blend2gltf/blender28_script.py", line 104, in main
export_gltf(settings, src, dst)
File "/usr/lib/python3.7/site-packages/blend2bam/blend2gltf/blender28_script.py", line 64, in export_gltf
make_particles_real()
File "/usr/lib/python3.7/site-packages/blend2bam/blend2gltf/blender28_script.py", line 12, in make_particles_real
bpy.ops.object.duplicates_make_real()
File "/usr/share/blender/2.80/scripts/modules/bpy/ops.py", line 201, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.duplicates_make_real.poll() failed, context is incorrect
Adding a line to force it into object mode before that line seems to fix it.
The --no-srgb flag should probably convert vertex colors to rgb as it does textures. This might need to be handled upstream in blendergltf.
Should be T:\Temp\gray_cube.gltf
T:\>blend2bam gray_cube.blend gray_cube.egg --pipeline gltf28
Blender 2.82 (sub 7) (hash 375c7dc4caf4 built 2020-03-12 15:41:08)
Read prefs: C:\Users\Cezary Wagner\AppData\Roaming\Blender Foundation\Blender\2.82\config\userpref.blend
found bundled python: C:\Program Files\Blender Foundation\Blender 2.82\2.82\python
srcroot: T:\
Exporting: ['T:\\gray_cube.blend']
Export to: T:\Temp
Read blend: T:\gray_cube.blend
Converting .blend file (T:\gray_cube.blend) to .gltf (T:\Tempgray_cube.gltf)
Making particles on Camera real
Making particles on Cube real
Making particles on Light real
'C:\Program Files\Blender Foundation\Blender 2.82\2.82\python\lib\site-packages\extern_draco.dll' exists, draco mesh compression is available
09:44:35 | INFO: Starting glTF 2.0 export
09:44:35 | INFO: Extracting primitive: Cube
09:44:35 | INFO: Primitives created: 1
09:44:35 | INFO: Finished glTF 2.0 export in 0.013746261596679688 s
Blender quit
Traceback (most recent call last):
File "c:\root\python\python38\lib\shutil.py", line 788, in move
os.rename(src, real_dst)
FileNotFoundError: [WinError 2] Nie można odnaleźć określonego pliku: 'T:\\Temp\\gray_cube.gltf' -> 'T:\\Temp\\tmpmbe27itu'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\root\python\python38\lib\site-packages\blend2bam\cli.py", line 96, in convert
src2tmp.convert_single(srcfile, tmpfile.name)
File "c:\root\python\python38\lib\site-packages\blend2bam\blend2gltf\__init__.py", line 49, in convert_single
shutil.move(dstout, dst)
File "c:\root\python\python38\lib\shutil.py", line 802, in move
copy_function(src, real_dst)
File "c:\root\python\python38\lib\shutil.py", line 432, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "c:\root\python\python38\lib\shutil.py", line 261, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'T:\\Temp\\gray_cube.gltf'
Failed to convert all file
When trying to convert a fbx model from the Unity AssetStore to blend then to bam via blend2bam I discovered blend2bam tries to read the image texture based on its name not its actual file name. This fbx file uses a name different then the set filename for the image.
:gobj(error): Texture::read() - couldn't read: %E8%B4%B4%E5%9B%BE%20740.png
:gobj(error): Unable to find texture "%E8%B4%B4%E5%9B%BE%20740.png" on model-path /d/dev/Nxt Games/lowpoly/assets/models/cliffs;/c/Users/nxtla/AppData/Local/Temp;/c/Panda3D-1.11.0-x64/python/Scripts/blend2bam.exe;/c/Panda3D-1.11.0-x64/etc/..;/c/Panda3D-1.11.0-x64/etc/../models
Could not find texture for key: 0
Got: %E8%B4%B4%E5%9B%BE%20740.png (https://gyazo.com/02deffbf6c7d4d79465b7f88846e012e)
Expected: ZLPP_Plant.tif
Textures are not exported to the default MModulate blending, material color is not taken into account. setTexture() doesn't seem to work on bam models.
i tried to export animations using blend2bam and when i load the model i do not get the same lighting that i get from .egg file i get a dark one
it load like that :
but when i expot the egg file i get real textures
i used this command : blend2bam --pipeline gltf --animations separate RiggingShapekeys.blend rig.bam
The check for Blender 2.80+ checks that the version string starts with "Blender 2.8", which no longer works with the recent release of 2.90. Instead, this check should actually break down the version number and make sure the second part is >= 80
.
Need to find a way to support extracting dmg files to complete macOS support.
When exporting a blend file that has one or more linked collections with an armature it produces the following error:
Exporting: ['/home/momojohobo/mahshizz/Development/armature_instance_example/fixme.blend']
Export to: /tmp/
Read blend: /home/momojohobo/mahshizz/Development/armature_instance_example/fixme.blend
Info: Read library: '/home/momojohobo/mahshizz/Development/armature_instance_example/swaybox.blend', '//swaybox.blend', parent '<direct>'
Info: Read library: '/home/momojohobo/mahshizz/Development/armature_instance_example/swaybox.blend', '//swaybox.blend', parent '<direct>'
Converting .blend file (/home/momojohobo/mahshizz/Development/armature_instance_example/fixme.blend) to .gltf (/tmp/fixme.gltf)
Error: ViewLayer 'View Layer' does not contain object 'legs'
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/blend2bam/blend2gltf/../blender_script_common.py", line 32, in convert_files
convertfn(settings, src, dst)
File "/usr/lib/python3.9/site-packages/blend2bam/blend2gltf/blender28_script.py", line 160, in export_gltf
prepare_meshes()
File "/usr/lib/python3.9/site-packages/blend2bam/blend2gltf/blender28_script.py", line 144, in prepare_meshes
bpy.context.view_layer.objects.active = obj
RuntimeError: Error: ViewLayer 'View Layer' does not contain object 'legs'
Failed to convert /home/momojohobo/mahshizz/Development/armature_instance_example/fixme.blend to gltf
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/blend2bam/cli.py", line 88, in convert
src2tmp.convert_single(srcfile, tmpfile.name)
File "/usr/lib/python3.9/site-packages/blend2bam/blend2gltf/__init__.py", line 46, in convert_single
self.convert_batch(srcroot, dstdir, files)
File "/usr/lib/python3.9/site-packages/blend2bam/blend2gltf/__init__.py", line 61, in convert_batch
blenderutils.run_blender_script(self.script_file, args, blenderdir=blenderdir)
File "/usr/lib/python3.9/site-packages/blend2bam/blenderutils.py", line 18, in run_blender_script
run_blender(
File "/usr/lib/python3.9/site-packages/blend2bam/blenderutils.py", line 14, in run_blender
subprocess.check_call([binpath, '--background'] + args, stdout=None)#subprocess.DEVNULL)
File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['blender', '--background', '-P', '/usr/lib/python3.9/site-packages/blend2bam/blend2gltf/blender28_script.py', '--', '/tmp/tmp24fn1xv7', '/home/momojohobo/mahshizz/Development/armature_instance_example', '/tmp', '/home/momojohobo/mahshizz/Development/armature_instance_example/fixme.blend']' returned non-zero exit status 1.
Failed to convert all files
Steps to reproduce:
Or simply convert fixme.blend in the conveniently attached zip.
armature_instance_example.zip
In some cases, relative transform between parent and child is not exported correctly.
Tags added in the Scene properties tab don't show up in searches.
Take into account texture scale and offset as set in blender.
Assume the following structure
models
- model.blend
maps
- model_base.png
In this case, the blend file will point to ../maps/model_base.png
. On export, the Blender 2.80+ glTF exporter will copy this to the same directory as the glTF output file and change the path to model_base.png
.
blend2bam should take the output glTF and attempt to fix paths in a post-processing step (similar to how physics is handled).
If an armature animation has no children in blender, it won't be exported as an actor.
Testcase:
ArmatureTest.tar.gz
Currently, only 64-bit Linux is supported. Support should be added for all platforms Blender supports.
I've gotten the following IndexError a few times now.
It looks like it has to do with a bunch of objects which are part of the RigidBodyWorld collection. When I delete that collection, it works.
However, I'm not quite sure - sometimes it even works with the RigidBodyWorld collection still in place.
I can try to provide a minimal example if needed, just don't have the time right now and wanted to leave this here.
Blender 2.93.4 (hash b7205031cec4 built 2021-08-31 23:43:17)
Read prefs: /home/micha/.config/blender/2.93/config/userpref.blend
srcroot: /home/micha/Projects/ProceduralCave/
Exporting: ['/home/micha/Projects/ProceduralCave/ProceduralCave.blend']
Export to: /tmp/
Read blend: /home/micha/Projects/ProceduralCave/ProceduralCave.blend
Converting .blend file (/home/micha/Projects/ProceduralCave/ProceduralCave.blend) to .gltf (/tmp/ProceduralCave.gltf)
'/home/micha/Software/blender-2.93.4-linux-x64/2.93/python/lib/python3.9/site-packages/libextern_draco.so' exists, draco mesh compression is available
22:11:12 | INFO: Starting glTF 2.0 export
22:11:12 | INFO: Extracting primitive: Ground
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.001
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.002
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.003
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.004
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.005
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.006
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.007
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.008
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.009
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.010
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.011
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.012
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.013
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.014
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.015
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.016
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.017
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.018
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.019
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.020
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.021
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.022
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.023
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.024
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.025
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.026
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.027
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.028
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.029
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.030
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.031
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.032
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.033
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.034
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.035
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.036
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.037
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.038
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.039
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.040
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.041
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.042
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.043
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.044
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.045
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.046
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.047
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.048
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.049
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.050
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.051
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.052
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.053
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.054
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.055
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.056
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.057
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.058
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.059
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.060
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_collision.061
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: Ground_collision.001
22:11:12 | INFO: Primitives created: 1
22:11:12 | INFO: Extracting primitive: CaveSystem_rocks
Error: Tangent space can only be computed for tris/quads, aborting
22:11:12 | WARNING: Could not calculate tangents. Please try to triangulate the mesh first.
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: Kinfe
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.002
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.003
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.004
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.005
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.006
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.007
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.008
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.009
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.010
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.011
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.012
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.013
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.014
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.015
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.016
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.017
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.018
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.019
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.020
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.021
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.022
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.023
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.024
Error: Tangent space can only be computed for tris/quads, aborting
22:11:13 | WARNING: Could not calculate tangents. Please try to triangulate the mesh first.
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.025
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.026
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.027
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.028
22:11:13 | INFO: Primitives created: 2
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.029
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.030
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.031
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.032
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.033
22:11:13 | INFO: Primitives created: 1
22:11:13 | INFO: Extracting primitive: CaveSystem_rocks_section.034
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.035
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.036
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.037
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.038
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.039
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.040
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.041
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.042
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.043
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.044
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.045
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.046
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.047
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.048
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.049
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.050
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.051
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.052
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.053
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.054
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.055
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.056
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.057
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.058
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.059
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.060
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.061
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section.001
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Extracting primitive: CaveSystem_rocks_section
22:11:14 | INFO: Primitives created: 1
22:11:14 | INFO: Extracting primitive: Corridors
22:11:14 | INFO: Primitives created: 0
22:11:14 | WARNING: Mesh 'Corridors' has no primitives and will be omitted.
22:11:14 | INFO: Extracting primitive: CaveSystem
22:11:14 | INFO: Primitives created: 2
22:11:14 | INFO: Finished glTF 2.0 export in 1.9887375831604004 s
Traceback (most recent call last):
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/blend2gltf/../blender_script_common.py", line 32, in convert_files
convertfn(settings, src, dst)
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/blend2gltf/blender28_script.py", line 178, in export_gltf
export_physics(gltf_data)
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/blend2gltf/blender28_script.py", line 35, in export_physics
meshref = [
IndexError: list index out of range
Failed to convert /home/micha/Projects/ProceduralCave/ProceduralCave.blend to gltf
Traceback (most recent call last):
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/cli.py", line 88, in convert
src2tmp.convert_single(srcfile, tmpfile.name)
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/blend2gltf/__init__.py", line 46, in convert_single
self.convert_batch(srcroot, dstdir, files)
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/blend2gltf/__init__.py", line 61, in convert_batch
blenderutils.run_blender_script(self.script_file, args, blenderdir=blenderdir)
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/blenderutils.py", line 33, in run_blender_script
blenderbin=blenderbin
File "/home/micha/.local/lib/python3.6/site-packages/blend2bam/blenderutils.py", line 23, in run_blender
subprocess.check_call([binpath, '--background'] + args, stdout=None)#subprocess.DEVNULL)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/micha/Software/blender-2.93.4-linux-x64/blender', '--background', '-P', '/home/micha/.local/lib/python3.6/site-packages/blend2bam/blend2gltf/blender28_script.py', '--', '/tmp/tmp3xgy6c4y', '/home/micha/Projects/ProceduralCave', '/tmp', '/home/micha/Projects/ProceduralCave/ProceduralCave.blend']' returned non-zero exit status 1.
Failed to convert all files
'/home/micha/Projects/ProceduralCave/cluster_centers.pickle' -> './cluster_centers.pickle'
'/home/micha/Projects/ProceduralCave/navmesh.pickle' -> './navmesh.pickle'
'/home/micha/Projects/ProceduralCave/verts_to_clusters_per_object.pickle' -> './verts_to_clusters_per_object.pickle'
'/home/micha/Projects/ProceduralCave/verts_to_clusters.pickle' -> './verts_to_clusters.pickle'
I don't if you got my message and I can't find any issues with Cub3D in closed or open. I was simply trying to say that if your able to make a plugin that allows people to export to panda3D as Folder [Not .BAM] then people can place that folder where Cub3D.apk can find it and play it then package their Games into APKs.
The problem is finding the devs for Cub3D -u2600inventions- and collabrating with them.
https://m.apkpure.com/cub3d-python-3-6-3d-programming-ide/com.u2600inventions.cub3d
I was trying to say that if you get Blend2Bam work'g as I don't use the Engine-side [.BAM] of you Plugin, but the Export Project [Folder]
How can I include external png textures into my model? I have tried including them as source files, errors out. Right now the BAM model works but it is all black (no texture) in pview.
... but passive physics objects in blender aren't intangible, so this behavior is surprising. Worse, this behavior is not documented or otherwise called out, making it hard to discover this as the cause.
Perhaps a better option is to set tangibility based on whether the physics object is part of any collision group
Converts support batch conversions which are used in tests, but this feature is not currently exposed for the CLI.
Hi,
Is it at all possible to run blend2bam
with a portable version of Blender (i.e. extracted from a .zip file into a arbitrary directory)?
With Blender residing in D:\Portable\blender-2.91.0-windows64\
, I call blend2bam
like so:
blend2bam my_scene.blend my_scene.bam --blender-dir "D:\Portable\blender-2.91.0-windows64\" --blender-bin blender.exe
This leads to the following error:
Traceback (most recent call last):
File "d:\panda3d-1.10.10-x64\python\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "d:\panda3d-1.10.10-x64\python\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\Panda3D-1.10.10-x64\python\Scripts\blend2bam.exe\__main__.py", line 7, in <module>
File "d:\panda3d-1.10.10-x64\python\lib\site-packages\blend2bam\cli.py", line 218, in main
if not blenderutils.blender_exists(args.blender_dir, args.blender_bin):
File "d:\panda3d-1.10.10-x64\python\lib\site-packages\blend2bam\blenderutils.py", line 39, in blender_exists
is_blender_28(blenderdir=blenderdir, blenderbin=blenderbin)
File "d:\panda3d-1.10.10-x64\python\lib\site-packages\blend2bam\blenderutils.py", line 60, in is_blender_28
version = get_blender_version(blenderdir=blenderdir, blenderbin=blenderbin)
File "d:\panda3d-1.10.10-x64\python\lib\site-packages\blend2bam\blenderutils.py", line 52, in get_blender_version
output = subprocess.check_output([binpath, '--version'])
File "d:\panda3d-1.10.10-x64\python\lib\subprocess.py", line 411, in check_output
**kwargs).stdout
File "d:\panda3d-1.10.10-x64\python\lib\subprocess.py", line 488, in run
with Popen(*popenargs, **kwargs) as process:
File "d:\panda3d-1.10.10-x64\python\lib\subprocess.py", line 800, in __init__
restore_signals, start_new_session)
File "d:\panda3d-1.10.10-x64\python\lib\subprocess.py", line 1207, in _execute_child
startupinfo)
PermissionError: [WinError 5] Access is denied
Running the command console as administrator makes no difference.
If Blender really does need to be installed, no problem, feel free to close this issue then. My reason for using portable versions of Blender is to have the possibility to compare older and newer versions by having them side-by-side.
Attempting to load models and turn on auto shading isn't working. The result is a black object, even with lights added manually to the scene (or things like a normal map added to the model manually later). The model does load and has a visible color texture without enabling auto shading:
... but simply calling render.setShaderAuto()
results in a black object:
The system does support pixel shaders - the sample bump mapping program works. However I can't get exported models to work. Manually exporting to a .bam file doesn't affect things.
... I've been assuming that I could do a simple setup inside of blender for this:
... and indeed the resulting gltf does include a reference to the normals file, but nothing shows on screen...
Blender's environment lighting in the world properties tab could be translated as an AmbientLight. Horizon color could service as the light's color when sky color is selected. Sky texture is probably too blender-specific.
Blender 2.91+ supports compound physics bodies:
... but the converter doesn't recognize the type:
Unknown collision shape (COMPOUND) for object (Cube)
Could not create collision shape for object (Cube)
Panda node tree:
ModelRoot Scene T:(pos 0 -2 1) S:(LightAttrib)
PandaNode Cube
GeomNode Cube (1 geoms: S:(CullFaceAttrib MaterialAttrib TextureAttrib))
PandaNode Cube.001 T:m(pos 0.225866 0 0)
BulletRigidBodyNode Cube.001 (1 shapes) active mass=1
GeomNode Cube.001 (1 geoms: S:(MaterialAttrib TextureAttrib))
PandaNode Torus T:m(pos 0 0.207598 0)
BulletRigidBodyNode Torus (1 shapes) active mass=1
GeomNode Torus (1 geoms: S:(MaterialAttrib TextureAttrib))
I decided to use this tool for the first time.
D:\>D:\Panda3D-1.10.6-x64\python\Scripts\blend2bam.exe box.blend box.bam --blender-dir "D:\Program Files\Blender Foundation\Blender 2.82"
Blender version is 2.8+, forcing gltf28 pipeline
Blender 2.82 (sub 7) (hash 375c7dc4caf4 built 2020-03-12 15:41:08)
Read prefs: C:\Users\Serega\AppData\Roaming\Blender Foundation\Blender\2.82\config\userpref.blend
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
found bundled python: D:\Program Files\Blender Foundation\Blender 2.82\2.82\python
srcroot: D:\
Exporting: ['D:\\box.blend']
Export to: C:\Users\Serega\AppData\Local\Temp
Read blend: D:\box.blend
Converting .blend file (D:\box.blend) to .gltf (C:\Users\Serega\AppData\Local\Tempbox.gltf)
Making particles on Camera real
Making particles on Cube real
Making particles on Light real
'D:\Program Files\Blender Foundation\Blender 2.82\2.82\python\lib\site-packages\extern_draco.dll' exists, draco mesh compression is available
15:17:03 | INFO: Starting glTF 2.0 export
15:17:03 | INFO: Extracting primitive: Cube
15:17:03 | INFO: Primitives created: 1
15:17:03 | INFO: Finished glTF 2.0 export in 0.006448030471801758 s
Blender quit
Traceback (most recent call last):
File "d:\panda3d-1.10.6-x64\python\lib\shutil.py", line 566, in move
os.rename(src, real_dst)
FileNotFoundError: [WinError 2] Не удается найти указанный файл: 'C:\\Users\\Serega\\AppData\\Local\\Temp\\box.gltf' -> 'C:\\Users\\Serega\\AppData\\Local\\Temp\\tmph_kset5x'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:\panda3d-1.10.6-x64\python\lib\site-packages\blend2bam\cli.py", line 96, in convert
src2tmp.convert_single(srcfile, tmpfile.name)
File "d:\panda3d-1.10.6-x64\python\lib\site-packages\blend2bam\blend2gltf\__init__.py", line 49, in convert_single
shutil.move(dstout, dst)
File "d:\panda3d-1.10.6-x64\python\lib\shutil.py", line 580, in move
copy_function(src, real_dst)
File "d:\panda3d-1.10.6-x64\python\lib\shutil.py", line 266, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "d:\panda3d-1.10.6-x64\python\lib\shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Serega\\AppData\\Local\\Temp\\box.gltf'
Failed to convert all file
It would be useful to support materials that use the Diffuse BSDF shader, which is simpler than Principled BSDF, and should certainly be supported for non-PBR workflows.
This may require either a workaround in blend2bam or an upstream feature request/PR to the glTF exporter.
If we decide against this, then there needs to be a note in the manual saying that only Principled BSDF is supported.
This fork of YABEE can be used to add experimental EGG support for Blender 2.8+.
Models in blender are ok, textured and all, but when I import them and open the .bam using panda3d viewer, the models look as if a UV lightbulb would be above them.
Hello!
I am quite new to the "world of graphics" and I am trying to convert a very simple blender file (just a floor and a wall mesh without any textures or anything) to bam. I get an error from subporcess.py
:
FileNotFoundError: [Errno 2] No such file or directory: 'blender': 'blender'
I used: blender2bam Maze.blender Maze.bam
I am on Mac. From the files of the blender2bam it seems that bpy is being imported. Do I need to build Blender from source? I have just the app (v2.82a) in my Applications folder (I even included it in the command above but it didn't work). Could anyone help me identify what I am doing wrong?
Thanks in advance!
Binary wheels can be created for all supported platforms from one host since the only binaries are pre-built Blender binaries. A command should be added to make it easy to build wheels for all platforms, which would consist of running the following for each supported platform:
python setup.py build_blender --platform=<platform>
python setup.py bdist_wheel --plat-name=<platform>
This is useful for character models, which are often modeled facing down the -y in Blender instead of +y (typical forward vector).
Using latest blend2bam 0.10, i hit a crash:
$ blend2bam untitled.blend ./untilted.bam
Blender version is 2.8+, forcing gltf28 pipeline
Blender 2.81 (sub 16) (hash f1aa4d18d49d built 2020-01-28 02:41:53)
Read prefs: /home/tito/.config/blender/2.81/config/userpref.blend
srcroot: /home/tito/Downloads
Exporting: ['/home/tito/Downloads/untitled.blend']
Export to: /tmp
Read blend: /home/tito/Downloads/untitled.blend
Converting .blend file (/home/tito/Downloads/untitled.blend) to .gltf (/tmp/untitled.gltf)
Traceback (most recent call last):
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blend2gltf/blender28_script.py", line 106, in main
export_gltf(settings, src, dst)
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blend2gltf/blender28_script.py", line 66, in export_gltf
make_particles_real()
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blend2gltf/blender28_script.py", line 8, in make_particles_real
bpy.ops.object.mode_set(mode='OBJECT')
File "/usr/share/blender/2.81/scripts/modules/bpy/ops.py", line 201, in __call__
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.object.mode_set.poll() failed, context is incorrect
Filed to convert /home/tito/Downloads/untitled.blend to gltf
Traceback (most recent call last):
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/cli.py", line 96, in convert
src2tmp.convert_single(srcfile, tmpfile.name)
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blend2gltf/__init__.py", line 46, in convert_single
self.convert_batch(srcroot, dstdir, files)
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blend2gltf/__init__.py", line 61, in convert_batch
blenderutils.run_blender_script(self.script_file, args, blenderdir=blenderdir)
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blenderutils.py", line 16, in run_blender_script
blenderdir=blenderdir
File "/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blenderutils.py", line 7, in run_blender
subprocess.check_call([binpath, '--background'] + args, stdout=None)#subprocess.DEVNULL)
File "/home/tito/.conda/envs/oman/lib/python3.7/subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['blender', '--background', '-P', '/home/tito/.conda/envs/oman/lib/python3.7/site-packages/blend2bam/blend2gltf/blender28_script.py', '--', '/tmp/tmpmkbnuibn', '/home/tito/Downloads', '/tmp', '/home/tito/Downloads/untitled.blend']' returned non-zero exit status 1.
Failed to convert all file
Here is the file that you can try to convert:
untitled.zip
Add and enhance support for invisible and intangible collision geometry in the blend2bam exporter.
As there already is support for intangible objects, the workflow for invisible but solid geometry should be usable in addition to the existing way to keep a consistent and easy to understand usage.
The resulting workflow should be scalable and easily adaptable for existing models to work from only a few to hundreds or more objects in a scene.
Easily add invisible solid collision objects like walls for level borders and enhanced usability for adding lots of intangible objects for things like trigger fields.
Add collision geometry to dedicated collections in the tree.
Each object if applicable in those collections should be converted to a invisible or intangible collision object.
Make collection names containing the objects configurable either by passing the dedicated names for invisible and intangible collections (e.g. collisions, triggers), a list of collections (e.g. collisions_a, collisions_b and triggers_a, triggers_b) or just a prefix (e.g. col_ and trig_) to find the correct objects.
When blender is set to game mode materials get a backface culling option. It would be nice to see this reflected in exported bams, like YABEE.
Previously I've been using YABEE, in which I've been marking animations with names and start/end frame numbers. Now I'm using blend2bam, and I'd like to do armature animations, but I didn't find any tutorials of how to name it, mark start and end, and then export it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.