www.tombraiderforums.com

www.tombraiderforums.com (https://www.tombraiderforums.com/index.php)
-   Software Development (https://www.tombraiderforums.com/forumdisplay.php?f=55)
-   -   New Blender addon to import wad objects and animation (https://www.tombraiderforums.com/showthread.php?t=225479)

Bergus 09-01-21 14:28

Thanks not Again!
It seems to me that the shine is stored using different materials. Since the same texture can be applied with multiple shine values to different faces of the same mesh, it is like having 32 different materials that differ only by some glossy parameter.

I'll see how to manage that. I think that applying different materials to different faces is quite painful to the object designer, I would rather have some friendly way to edit this property.

EDIT: I think it is the only way: when you open the wad, blender creates 32 materials with the the same uvs but different shine values. If some face needs shine, the proper material is applied.

Zebra 09-01-21 15:27

Quote:

Originally Posted by Bergus (Post 8267674)
Thanks not Again!
It seems to me that the shine is stored using different materials. Since the same texture can be applied with multiple shine values to different faces of the same mesh, it is like having 32 different materials that differ only by some glossy parameter.

I'll see how to manage that. I think that applying different materials to different faces is quite painful to the object designer, I would rather have some friendly way to edit this property.

EDIT: I think it is the only way: when you open the wad, blender creates 32 materials with the the same uvs but different shine values. If some face needs shine, the proper material is applied.

Could you maybe use something like weights, vertex groups or vertex colours to store shine value variations? That would make them easy to edit and I believe vertex colours should also straightforward to integrate into materials so you could preview it properly in Blender without needing a bunch of materials.

not again! 09-01-21 16:05

Ah, apologies, I think I worded my initial comment about OBJ being best for shininess confusingly. What I meant was that the Blender export script for OBJ is so far the only one that exports the new Principled BSDF shader in way that will give a model imported into WadTool glossiness.
Models exported as FBX or COLLADA appear matte in game no matter what shader settings are used. So basically if you want to have a model exported from Blender to have glossiness ingame you need to export as OBJ.
Personally I don't find it a problem if the shine attribute is not imported from the Wad, since it can be re-applied in Blender.

Bergus 09-01-21 18:24

Quote:

Originally Posted by Zebra (Post 8267685)
Could you maybe use something like weights, vertex groups or vertex colours to store shine value variations? That would make them easy to edit and I believe vertex colours should also straightforward to integrate into materials so you could preview it properly in Blender without needing a bunch of materials.

I used vertex color to define the light map of statics objects since it is based on vertices. However, movables shine is applied to each polygon, and if you set the shine as vertex weights, the face would take the average of the vertex weights around it.

I'm thinking of adding a simple entry in the panel that you get pressing N, where you can select the shine when faces are selected. In this way there's no need for the user to mess with materials.

Quote:

Originally Posted by not again! (Post 8267692)
Ah, apologies, I think I worded my initial comment about OBJ being best for shininess confusingly. What I meant was that the Blender export script for OBJ is so far the only one that exports the new Principled BSDF shader in way that will give a model imported into WadTool glossiness.
Models exported as FBX or COLLADA appear matte in game no matter what shader settings are used. So basically if you want to have a model exported from Blender to have glossiness ingame you need to export as OBJ.
Personally I don't find it a problem if the shine attribute is not imported from the Wad, since it can be re-applied in Blender.

Don't worry :) I just forgot about shine and wanted to figure out how to import it. Unfortunately TRLE is old, otherwise the correct way would be to make another image that maps the glossiness and assign it to the shader.

not again! 10-01-21 08:59

^^ Oh, good - I'm relieved to hear I did not accidentally waste your time.

Some more feedback and a potential bug report: the option to batch export models is truly a wild luxury after being used to the old time consuming workflows! :p
Batch exporting Statics seems buggy on my end though: a FBX file for each static object is created, but the files all have 4kb and are seemingly empty when trying to import them into Blender. Everything else (Lara and Moveables) exports fine, I tested with several of the original Core wads.

Bergus 10-01-21 17:53

Quote:

Originally Posted by not again! (Post 8267857)
^^ Oh, good - I'm relieved to hear I did not accidentally waste your time.

Some more feedback and a potential bug report: the option to batch export models is truly a wild luxury after being used to the old time consuming workflows! :p
Batch exporting Statics seems buggy on my end though: a FBX file for each static object is created, but the files all have 4kb and are seemingly empty when trying to import them into Blender. Everything else (Lara and Moveables) exports fine, I tested with several of the original Core wads.

Thanks, I'll look into it!
I almost finished with the shine. I wanted to ask, if you know, whether tomb editor is also able to import opacity/transparency. I think that the way to do in blender is to use the bsdf shader alpha parameter. For the shine I'm using the roughness (shine = 0 => roughness = max).

not again! 10-01-21 21:49

Yes, it's possible to import models into Tomb Editor / WadTool with transparency. Vertex colors also import fine into WadTool & Tomb Editor when the model is in either .fbx or .dae* file format.
Both transparency and shine work exactly as you described: by adjusting the Alpha and the Roughness slider of the BSDF shader.

Though as mentioned the Roughness value of the BSDF shader only carries over into the game as shininess when exporting as .obj
When exporting as .fbx (or .dae) the export scripts for those file formats apparently interpret the Roughness setting in a way that doesn't translate into in-game glossiness. None of the BSDF shader sliders that control specularity, sheen and reflectiveness have any effect in game when exporting as anything other than .obj
Transparency on the other hand does work with all three file formats.


* from the file formats that Blender can export without additional plugins OBJ, FBX and COLLADA are the three best supported for import into WadTool / Tomb Editor.

And thank you again for your amazing work! :)

Bergus 11-01-21 19:28

There is a new release (0.2) on Github :jmp:

You can now import shine and opacity information. To edit their values, you need to go into edit mode and it will appear a Wad Blender tab into the panel that you get by pressing N. By selecting a face of the active mesh, it will appear a form where you can edit shine (0-31) and opacity (ON OFF).

There is also the possibility to batch export in obj format plus probably many bugs. When I'm sure that everything works, I'll make some tutorials, maybe :D

not again! 12-01-21 05:26

This keeps getting better and better, and it was already amazing to begin with! :D
Export of statics works now perfectly on my end and I'm a big fan of the way applying shine and transparency has been integrated into the addon. Many thanks for adding the option to batch export to OBJ as well!
Having the option to adjust rotation on import is also greatly appreciated. One thing I noticed is that Moveables without rig (like inventory items and puzzle pieces) are not affected by the rotation-transform though when ticking "rotate objects upright".
Again, not really a problem since objects can easily be rotated manually - just mentioning in case that's the sort of thing you'd like people to report.
I think having the option "rotate upright" ticked by default is probably going to be more convenient - I suspect that it's going to be used way more often than it's not going to be used.
Thank you for this great update!

Bergus 12-01-21 08:04

Thanks for the feedback, please report everything! The code is fresh and I can correct it very easily. Later will be hard because coding for Blender is quite nasty :hea:


All times are GMT. The time now is 04:08.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.