THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 30/06/2012 at 15:01, xxxxxxxx wrote:
Hi, I am experimenting with a very basic Python tag.
The resource (rs) file looks like this:
CONTAINER mytestcontrol
{
NAME mytestcontrol;
GROUP MYTESTCONTROLSETTINGS
{
SPLINE FOOSPLINE {}
}
}
When I add the tag to an object in c4d, I get this:
When I right-click the spline control, I can select "Reset":
Then I get this:
Actually, this is what I want.
How can I make my plugin set the spline control up with a default spline like this?
Can I do it in the res file? Or in the Python code? Or both?
And how?
I am sorry to say - I spend countless hours trying to find out how to carry out the simplest tasks in Python. The lack of examples is overwhelming. For eaxmple, I know you can enter code here in the res file to set default values:
{
SPLINE FOOSPLINE {BLA; BLA; MORE BLA BLA}
}
But how? This seems to be a well kept secret, and I have studied the documentation.
I finally managed to access the spline control under the Execute function, like this:
Here I can get the spline Y value for a certain X value, in this case 0.6
tag[FOOSPLINE].GetPoint(0.6).y
I spent the whole day figering out this. And this does not work in the Init() function, only in Execute(). Why? Don't ask me..
I hope someone can help me with this. And also with another question: Where is the documentation for Python in C4D really? Does it exist at all? The SDK I have downloaded is full of class hierarchies, methods, functions, constants etc. But alas, with almost no useful examples. The Spline Data control, which I believe is new in R13, does not come with any examples at all, as far as I can see.
Ingvar