Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Optimal way to assign shaders to faces (https://simplymaya.com/forum/showthread.php?t=61994)

agelosc 08-01-2020 10:33 AM

Optimal way to assign shaders to faces
 
This is for a transfer shader between different software tool I’m working on. The geometry shape nodes have a multi attribute with a long list of face indices for each shading group. The only way I’ve fount to assign those faces to a shadingGroup node is to run a loop through each face and with the sets command assign each face to a shadingGroup node. While this works fine for light geometries, when the geometry is large and the number of faces long, the script takes too long to finish if at all.

Is there another, faster way to assign faces to a shadingGroup node?

PS. I’ve tried converting the long list of faces to the unflatten format Maya uses (ie .f[1:300] ) but that doesn’t seem to make anything better.


All times are GMT. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018