PDA

View Full Version : Basic Python question


neonghost
09-17-2010, 04:37 PM
Hi,

Hopefully this is a simple one - I need to access some component data in the c4d.Vector class, but it doesn't seem to work like a normal list...

I only want to pull the Y data, so I though I could use something like:
y = myVector[1]or even
y = myVector[y]
based on the doc explaining the class as 'The values for a Vector are stored in the members x, y and z' - however this is yielding no joy. Any tips on pulling a component from this data type would be helpful, thanks!

neonghost
09-17-2010, 04:52 PM
and 2 minutes later I answer my own question - for anyone interested it is straightforward, I know this isn't the correct terminology, but c4d.Vector components are stores as discrete objects. eg.
x = myVector.x
y = myVector.y
z = myVector.z
Basic error for someone familiar with programming, but the docs were a little unclear about accessing the components.

CGTalk Moderation
09-17-2010, 04:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.