MiguelCastillo / scenic

Scene graph
MIT License
4 stars 0 forks source link

Removing default material data in scene-factory #14

Closed MiguelCastillo closed 2 years ago

MiguelCastillo commented 2 years ago

Context around the use of "mesh" here. In a scene configuration you can speficy a skinned-mesh or static-mesh so that the scene factory knows that is needs to create such node. Those nodes can be configured with a file resource such as an FBX file and in those cases the skinned-mesh or static-mesh becomes more of document node for the FBX file. FBX files can multiple mesh nodes in them and they all can specify material information.

Often skinned-mesh and static-mesh are just geometry data with no material information, so I had added logic to initialize every skinned-mesh and static-mesh defined in a scene configuration with material information. That was to make things convenient when models didn't provide color information and it enabled users to change the material color in the editor. However, having a default material value in those nodes causes friction with FBX files where a single model can have multiple meshes with separate materials, all of which ended up getting overriden by default material color values we were adding.

So Im removing that logic for setting those default values and instead leaving it to the author of the scene configuration to specify a material color whenever that is needed. And in those cases where a mesh is configured in the scene configuration to have a color, I will show the material tab with the color selector so that you users can still have access to that. And in a follow up change I am adding a material details panel so that you can select material nodes for meshes in FBX files to adjust the color of material nodes for any mesh that has them.

A TODO here would be to have the ability to override colors via the editor in skinned-mesh and static-mesh that no longer are getting a default value. But this isn't quite urgent, so we can circle back separately.