Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't export Damaged Helmet correctly for Ogre-next. #184

Open
knn217 opened this issue Nov 3, 2023 · 5 comments
Open

Can't export Damaged Helmet correctly for Ogre-next. #184

knn217 opened this issue Nov 3, 2023 · 5 comments

Comments

@knn217
Copy link
Contributor

knn217 commented Nov 3, 2023

Hello, I was following the "Blender2ogre" documentation to learn how to create and export my assets from Blender.
I tried to export the DamagedHelmet sample model to learn which material setup was correct, but there was no success.

At first, I tried to export from the DamagedHelmet's original setup:
image
but the mesh has no color when loaded in the app:
image
So I tried a new setup, based on the documentation's description for the metallic workflow:
image
but this time, the exporter ran into an error:
Python: Traceback (most recent call last): File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_ogre\ui\export.py", line 210, in execute scene.dot_scene(target_path, target_file_name_no_ext) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_ogre\ogre\scene.py", line 199, in dot_scene dot_materialsv2json(materials, path, separate_files=config.get('SEPARATE_MATERIALS'), prefix=prefix) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_ogre\ogre\materialv2json.py", line 36, in dot_materialsv2json generator.process_materials() File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_ogre\ogre\materialv2json.py", line 80, in process_materials self.copy_textures() File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_ogre\ogre\materialv2json.py", line 298, in copy_textures util.image_magick(image, src_filename, dst_filename, separate_channel=channel) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\scripts\addons\io_ogre\util.py", line 411, in image_magick subprocess.call(cmd) File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\subprocess.py", line 345, in call with Popen(*popenargs, **kwargs) as p: File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\subprocess.py", line 971, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Program Files\Blender Foundation\Blender 3.6\3.6\python\lib\subprocess.py", line 1456, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified

Are there any other steps I missed for the metallic workflow? This is the most I could get out of the docs.

Forgive me if this is not how materials are supposed to be set up for exporting, but info for this is quite limited. I couldn't find any example workflow to follow on the Ogre-next forum so I chose the damaged helmet sample mentioned in the docs to test out the setups.

@knn217
Copy link
Contributor Author

knn217 commented Nov 4, 2023

After some attempts, I finally managed to export something that has texture in Ogre-next. The setup is simply just remove everything but the "BaseColor" image texture like so:
image

I don't know if this is a feature but this makes the "BaseColor" image texture combine with the "Base Color" Setting underneath (I thought the "BaseColor" image texture would replace the "Base Color" Setting when plugged in, not combine with it).
Here are 2 examples:
_When the "Base Color" Setting underneath is set to white:
image
_When the "Base Color" Setting underneath is set to red:
image

Also, it made no difference when I switched between "sRGB" and "Non-Color" Color Space for the "BaseColor" image texture, which I thought was odd.

@paroj
Copy link
Member

paroj commented Nov 4, 2023

json material export is a very recent contribution #178. None of the current maintainers is using ogre-next right now. So I guess you are on your own with this one.

The exporter error looks like imagemagick is being called, despite not being installed.

@knn217
Copy link
Contributor Author

knn217 commented Nov 4, 2023

So this was actually a bug? I was hoping that there was something wrong with my setup since the latest attempts actually had some improvements. I'll look into the code and imagemagick then, maybe this is just some minor bug that only appears on Windows (I've run into some of these with Ogre). Thanks for the reply tho!

@knn217
Copy link
Contributor Author

knn217 commented Nov 5, 2023

I finally managed to deal with this error. The error was from subprocess.call(cmd) in "util.py".
The subprocess 's command expects to run "C:\Program Files\ImageMagick\convert.exe" so I had to:
_Remove the version from ImageMagick's directory name
_Select "Install legacy utilities" when in ImageMagick's installation config (this solution was found here: https://manuelmeyer.net/2016/06/where-is-imagemagicks-convert-exe/)

The exporter runs without error now, here's the setups and results:
image
image

Here's one more with an Image texture plugged into base color:
image
image

I can kinda see some reflected light on the helmet now so this is an improvement. The model loaded still doesn't look anything like in Blender tho, maybe since the lighting in my scene is bad?

Another thing is that in the 2nd setup, the image texture color is still being combined with the base color underneath (I set it to red). Is this intentional or a bug (since it does look kinda cool)?

Edit: In case anyone else wants to debug Blender addons on Windows, I followed the guide here: https://www.youtube.com/watch?v=YUytEtaVrrc

@knn217
Copy link
Contributor Author

knn217 commented Nov 7, 2023

Hello again, I've created a pull request for some new features that are more fitting for Blender.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants