overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
132 stars 48 forks source link

allow applying one material to multiple children #794

Open JulianGro opened 5 months ago

JulianGro commented 5 months ago

This will need some more thought, but currently one needs to create one material per entity to change the entities material. When building a house out of simple shapes for example, it becomes pretty annoying doing so. Maybe a simple "Copy material" button would be a good stopgap solution?

We should probably redesign material entities so that each shape just has a material tab in Create, and Create just creates a material entity whenever someone uses said material tab in Create. Then you could have something like an "inherit from parent" property.

gydence commented 5 months ago

there is one way to do this: if you set the materialURL of a material entity to the entity ID of another material entity, it will use the same material but you can apply it to something different. but it doesn’t allow modifying the individual properties if I remember correctly, you’re stuck with the main material. if the two materials are far apart, you can also get in a situation where the main material hasn’t loaded yet

(edit: actually I guess this doesn’t solve your problem any more than just duplicating the material entities entirely and changing the parentIDs. a more elegant “click to copy material and apply to this entity” in Create is a great idea)

we’ve discussed a “material library” before, but it’s not clear to me if this should be in interface or via an external app that just provides better UX for copying materials. materials (and entities in general) should have a relatively low overhead, so I think we should solve this in JS and just make more material entities as you suggest, as opposed to making changes to the engine to actually support one material entity -> multiple meshes