Setting Sphere Parameters from Python

   1692   2   1
User Avatar
Member
1 posts
Joined: 10月 2018
Offline
this code will create a box and set its scale factor

solid = geo.createNode('box')
solid.parmTuple('size').set((0.01, 0.01, 0.01))


what's the comparable code for a ‘sphere’?
tried and failed:


solid = geo.createNode('sphere')
solid.parmTuple('size').set((0.01, 0.01, 0.01))



solid = geo.createNode('sphere')
solid.parmTuple('size').set(0.01)



solid = geo.createNode('sphere')
solid.parmTuple('s').set((0.01, 0.01, 0.01))



and many more guesses.
i give up.
you can tell me now.
thanks.
User Avatar
Member
555 posts
Joined: 2月 2017
Offline
I'm not a python expert but why don't you simply rclick on the sphere>edit tool>script

work it out from there.
User Avatar
Member
201 posts
Joined: 7月 2015
Offline
A good trick is to Drag/Drop the parm you want to modify into your Python Shell (also works for all other kinds of stuff btw) and go from there.

D/D the scale parm(tuple) -> .set(valx,valy,valz) -> Enter
Manuel Köster - Senior Technical Artist @Remedy Entertainment

https://www.remedygames.com/ [www.remedygames.com]
http://shadesoforange.de/ [shadesoforange.de]
https://twitter.com/ShadesOfOrange_ [twitter.com]
  • Quick Links