trouble converting -type double3 to python script

trouble converting -type double3 to python script

rafGCQG8
Contributor Contributor
946 Views
2 Replies
Message 1 of 3

trouble converting -type double3 to python script

rafGCQG8
Contributor
Contributor

Hi there,

 

I'm very new to scripting in Maya but I was trying to change attributes on a Toon outline via a python script. I was able to do this successfully for most areas I needed to, but when it came to Intersection Lines and changing the colour I am a bit stuck. I've tried a few ways of writing line 5 but to no avail:

 

 

thisSelection = cmds.ls(selection = True)
selectedMesh = thisSelection[0]

#other cmds.setAttr...,
cmds.setAttr(selectedMesh + ".intersectionColor", Double3(1, 0, 0.0353)),

 

 

The line I am trying to convert from Mel is: 

 

setAttr "pfxToonShape1.intersectionColor" -type double3 1 0 0.0353 ;

 

 
I tried mel2py but got an error about lineno for this particular line of Mel. Any help would be greatly appreciated, thank you 🙂
 
0 Likes
Accepted solutions (1)
947 Views
2 Replies
Replies (2)
Message 2 of 3

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

python is a lot more flexible with variables and arguments, so it doesn't need to be told what kind of argument you are changing if the argument only contains numbers.

So the line you are trying to translate would be:

cmds.setAttr(selectedMesh + ".intersectionColor", 1, 0, 0.0353)

 

I hope it helps!

Message 3 of 3

rafGCQG8
Contributor
Contributor

thank you so much this really helped!

0 Likes