Giter VIP home page Giter VIP logo

blend2bam's People

Contributors

clockwork-muse avatar fireclawthefox avatar kant avatar moguri avatar rdb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blend2bam's Issues

Fix Blender 2.80+ detection for Blender 2.90

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.

Add a command to build wheels for all platforms

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>

Apply hair particle modifier

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.

PNG Textures

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.

Backface culling

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.

Error when blend is saved in edit mode

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.

Error loading with the Panda Loader on Windows

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']

Blender's Environment Lighting to Panda3d's AmbientLight

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.

blend2bam cannot find Blender packaged as Flatpak

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)

Texture blending and replacing

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.

Blender Binary not found

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!

FileNotFoundError

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.

Compound physics bodies not supported

Blender 2.91+ supports compound physics bodies:
image

During blender sim:
image

... 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))

... and because of that, the object falls apart:
image

Sample blender file

How can I mark and export animations?

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.

Missed Converting .blend file (T:\gray_cube.blend) to .gltf (T:\Tempgray_cube.gltf)

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

Passive physics objects are exported as intangible

... 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

Blend2bam doesn't load objects with pure textures

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 :

darkblend2bam

but when i expot the egg file i get real textures

shamablinkcolorpanda3d

i used this command : blend2bam --pipeline gltf --animations separate RiggingShapekeys.blend rig.bam

Imported models are blue-ish

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.

gltf28 does not support texture paths outside the blend directory

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).

Exporting file results in blender error

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

Error when linking collection containing armature.

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:

  • In blender create a model with armature and save.
  • Create a new blend file and link the collection with said model.
  • Convert this new blend file with blend2bam.

Or simply convert fixme.blend in the conveniently attached zip.
armature_instance_example.zip

RuntimeError: Operator bpy.ops.object.mode_set.poll() failed

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

Support .txo creation

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).

Can't get pixel shaders to work with exported models

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:

image

... but simply calling render.setShaderAuto() results in a black object:

image

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:
image

... and indeed the resulting gltf does include a reference to the normals file, but nothing shows on screen...

repro.zip

FileNotFoundError

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

Invisible and intangible collision geometry handling

Description

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.

Use Case

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.

Possible implementation solution

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.

Optional

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.

Checklist

  • Support invisible geometry
  • Add support for intangible objects in addition to existing solution
  • Easy scalability
  • Don't break base features (linking, instancing, etc)
  • Ensure this feature works for linked/instanced objects too
  • Provide a test model containing both types of collision objects and possibly linked and instanced objects
  • Update documentation

IndexError: list index out of range

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'

Incorrect Texture Path

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

[I want to directly support/donate] Cub3D.apk == Can Play Panda3D Samples on Android Phone

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 Tested out the problems with Export'g your Plugin -or someone elses- and some problems are Export2Bam doesn't run in Cub3D, but the project folder does and pman or pygame has to be removed from the main.py script
  • Not all Panda3D samples can run, but most do, but I believe in order to truly make BGE2BAM the Logic Bricks Codes would need to be re-interpreted into Panda3D Scripts or Assigned Panda3D Bricks [Like Motion.act == Motion.actpan]...and that means someone would have to build Panda3D Bricks out of Python Code [which is unfair and a lot of work]

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]

  • I hoped I could use Blender2.79's Game Engine due to the Logic Editor Easiness, but I see that Blender 2.79 isn't support as much [I have my own idea for Better/Simpler/Efficient Logic Editor...based on my understand'g of it 'ITON']
  • If its even possible for the NeuroBGE [Pro-Py], UPBGE [Pro-C] & MakeHuman [Pro-Py] to work together...people can put games out on the biggest platform while give'g a cut to you devs [I know 30% for Platform + 10-30% for Code Devs = 60-40% left for Game Devs...but technically you deserve a lot cause your getting the games out their and maybe a deal w/fee-breaks [pre/post gross/net/filetax profit] & large payouts when when games make it big like 30% at 5-100K, 20% at 200-750K, 10% at 1-3mil, 10% at 5-10Mil, 20% of 15-20Mil, 30% at 30-50Mil]

PermissionError: [WinError 5] Access is denied

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.

Loading blend files with lights in second runs moves them in-game.

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.

First run:
image

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

Second run:
image

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:
image

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

image

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()

Consider supporting Diffuse BSDF

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.

Feature Request: Integration into Blender's UI, and with it observance of Blender's object-selection

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.