Transfering color via script - Maya - Highend3d Artists Discussion Forums

We're sorry, but something went wrong.

Error: Backend Fetch Failure

We've been notified about this issue and we'll take a look at it shortly.

If you need to reach us, email support@highend3d.com

Jan 2019
1 / 4
Jan 2019
Apr 2019

Hey, I need to transfer many color values from one shader to another.
But I need to transfer the, I will call it the 'Main Color', so the value that makes it color change.
For a lambert shader it would be the 'color' attribute. But for some other it might be the 'diffuse' or something else. Is there any way to determine by script what the name of the 'main color' equivalent is?

  • created

    Jan '19
  • last reply

    Apr '19
  • 3

    replies

  • 945

    views

  • 3

    users

Create an array of all the attribute options. Loop through them and check if attributeExists

But sometimes shader do have multiple of main color equivalent. Like 'color' and 'diffuse' but only one is acting as the 'mainColor'. Is there a way to differentiate between them?

2 months later

closed Apr 17, '19

This topic was automatically closed after 87 days. New replies are no longer allowed.