THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 19/04/2011 at 02:17, xxxxxxxx wrote:
I'm new to Python for C4D. I like to bumble around and use Google when learning something new like this, but I'm running into roadblocks that tell me I'm misunderstanding something and/or looking in the wrong place for answers.
What I want to do is have a null with custom user data, like a y position slider. I want to have a C4D Python tag that I can drop on a separate object that will find the value of that y position slider. Two separate objects… in other words, a Python tag reading a value from another node.
In Maya it would be a simple expression like this:
nurbsSphere1.translateY = control.customYControl
I'm having trouble having a Python tag look outside of its bubble to read a variable from another node or py-tag.
Is the problem just that I don't know how to properly identify the null and its user data for Python to find? Or do I need to put another Python tag on the control null as well and have it create a global variable that can be read by other Python tags? I think the global variable stuff I've tried is only "global" within the tag, not the whole document.
In the end there are going to be hundreds of objects with many different Python tags all getting variables the single null control node. What is the efficient way to handle this?
If you can help with a pointer in the right direction I would really appreciate it, especially if you can give a sample of the syntax. I'm not having any luck with generic Python tuts on the web, all my trouble seems to be coming from how C4D and Python relate to each other, not Python specifically.
I've already got the SDK docs and have seen the Cineversity videos, and I know the trick where you drag a parameter into the py console to get its py-name. It don't work.
Thanks --