SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

SM Forums / Maya Questions / Programming / Optimal way to assign shaders to faces

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
Thread Tools
08-01-2020, 10:33 AM   #1
Registered User
Join Date: Jan 2020
Posts: 1
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.
  Reply with quote

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rotating a group of Faces uniformly Yesuar Maya Modeling 3 07-10-2019 02:07 PM
assign hair to faces mickhah Maya Basics & Newbie Lounge 1 16-01-2013 05:34 PM
Cut faces tool issue... LadySekhmet Maya Basics & Newbie Lounge 3 14-03-2009 04:24 AM
how come i dont have a keep faces planar option? Chirone Maya Basics & Newbie Lounge 0 14-01-2008 08:42 AM
Don't know how to scale multiple faces. Darkware Maya Modeling 6 30-12-2002 08:00 PM