Open tobblx opened 2 months ago
This would be a nice feature. It looks like your script is essentially applying a planar UV projection to the cylinder for each stud. One approach is to generate these UV coordinates using shading nodes or geometry nodes. I already have an attribute for detecting if a face is part of a stud for slope materials.
For modifying the mesh directly, it makes sense to do this with numpy arrays or in Rust for performance. I'll need to play around with this some to see if there are better ways of doing this. Let me me know if you have any more ideas for how to improve imports.
First of all I want to say: What a great ldraw importer plugin. Thank you very much for your work! The cycles renderings look amazing. I still have one small wish, which I have missed with most of the ldraw importers used so far: It would be good if you could use a central normal map / bump map for the Lego studs. So there is no extra geometry required, which are lots of additional vertices per part. The imported models could then also better be used in game-engines. This would require the UV coordinates for the vertices of the Lego studs to be set. Perhaps this could be done directly when creating the meshes. I have created a script for this for testing. It sets the UV-Coordinates of the identified stud-vertices in all selected objects. (They are identified by having 8, 16 or 48 connecting edges - the edge-length must be 6) UV coordinates in the range of x /y = 10.0 - 11.0 are set for the studs. This means that there can be no conflicts with other parts whose UV coordinates are between 0 and 1, for example. If required, the Lego stud bump map can then be added to the existing BUMP map in the shader. I hope I could give you some inspiration for an extension to the already great importer. :-) (See examples in the attachments) Lego_logo_Bump_Map_Examples.zip
![Example_Shader_Nodes_Modification](https://github.com/ScanMountGoat/ssbh_editor/assets/121121299/d2e34a98-0c19-43f4-8c62-02b5d656e694)