THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/07/2011 at 17:36, xxxxxxxx wrote:
Hey all! had a quick question regarding the CheckType() function. is it possible to check to see if an object that has been dragged into a link field is BaseObject()? it always asks for the specific BaseObject ID when i use CheckType(), but in this case, i need to find out whether the linked object is a spline(c4d.Osplinerectangle,c4d.Osplinenside,c4d.BaseSpline, etc...). anyone know of a good way to check for a spline object? Maybe CheckType() is the wrong function? thanks in advance for the help!
On 10/07/2011 at 02:32, xxxxxxxx wrote:
What's the problem with CheckType ?
On 10/07/2011 at 21:17, xxxxxxxx wrote:
i want to find out if an object is a spline or not. how would one do that using CheckType()?
On 10/07/2011 at 23:19, xxxxxxxx wrote:
What about op.CheckType(c4d.Ospline) ?
Or do you want to check for a generator spline ?
I'm not sure, but if it's a generator - spline, it is a BaseSpline-Object and no more a BaseObject.
You could test like isinstance(op, c4d.BaseSpline).
On 11/07/2011 at 00:02, xxxxxxxx wrote:
ok, so the two types are c4d.Ospline and c4d.BaseSpline? basespline points to a spline generator and Ospline points to a basic point/spline object. i think i understand. i have to look up that isinstance() function... not sure what that does yet...
On 11/07/2011 at 04:55, xxxxxxxx wrote:
it just checks wether an instance is of the specified type or not.
On 13/07/2011 at 20:41, xxxxxxxx wrote:
hey nux, just wanted to clarify a couple things. first of all c4d.BaseSpline is not a class. isinstance seems to require a class, but i searched through the documentation and found c4d.SplineObject. this worked like a charm with isinstance. the code that worked is:
if isinstance(spline, c4d.SplineObject) :
spline = self.stype.GetClone()
thanks again duder!
another good one is:
if SplineObject.GetRealSpline() :
#put code here
this will only work if the spline is a spline generator object(c4d.Osplinerectangle, c4d.osplinenside, c4d.Osplinecircle, etc...)
c4d.Ospline only checks for a editable spline object
thought that might be helpful to someone.