Determine if Spline is used by a NURB?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 21/10/2009 at 07:00, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   11.0 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
Hello,

is it possible to determine if a Spline-input is used by a NURB?
GetBit(BIT_CONTROLOBJECT) works for polygonobjects but splines always return TRUE, so i can't find out if it is really used by the NURB.

THANKS for help

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/10/2009 at 03:18, xxxxxxxx wrote:

Maybe there's no other solution than to iterate through all objects in the scene and check for each object ob the spline is used.

Cheers,
Jack

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/10/2009 at 10:48, xxxxxxxx wrote:

maybe using for example something like this:
if (splineObject->(GetUp()->GetType()==Oextrude)
{
//do something
}

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/10/2009 at 12:37, xxxxxxxx wrote:

I would be careful using double indirection though. If GetUp() returns NULL (perfectly valid), instant crash. Also note that instead of checking for every conceivable generator type object (and you'll miss plugin ones), you can get the more general flag, OBJECT_GENERATOR.

BaseObject* parent = splineObject->GetUp();
if (parent && (parent->GetInfo()&OBJECT;_GENERATOR))
{
// do something
}

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/10/2009 at 13:08, xxxxxxxx wrote:

Howdy,

Since a NURBS object uses the splines as input objects, you can also test for
parent->GetInfo()&OBJECT;_INPUT to help narrow it down. ;o)

Adios,
Cactus Dan

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 22/10/2009 at 15:10, xxxxxxxx wrote:

Right. You can check as:

if (parent && (parent->GetInfo()&(OBJECT_GENERATOR|OBJECT_INPUT)))

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 23/10/2009 at 05:27, xxxxxxxx wrote:

thanks for the fast replies. but this does not solve my problem. i was too imprecise. I need to find out, which of the splines are really used. For example when I have a hypernurbs object with two polyobjects as Input, only the first one has the bit CONTROL_OBJECT set, so I can take the second one out of the NURB because it has no function there. but if I have a sweepnurbs instead with 3 input splines I can't find a difference in the third one to take it out because the CONTROL_OBJECT bit is set in all of them. this should be part of a sorting process. i think it's not possible or maybe do you have more ideas?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 23/10/2009 at 06:18, xxxxxxxx wrote:

That's true of a Sweep NURBS because all three splines are used, the third being the rail. Both the first and second are always used (assuming they're not disabled). However, the rail is ignored if both Use rail direction and Use rail scale are turned off in the NURBS. If you look at these values, and both are off, the rail is not being used. Is that what you meant?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 23/10/2009 at 07:25, xxxxxxxx wrote:

you are right. but that was not really the problem. its the same with 4 or more splines inside the sweep nurbs object. hmm .. :)