Check if object is a polygonal parametric object

On 16/07/2015 at 15:27, xxxxxxxx wrote:

I know that obj.GetInfo() & c4d.OBJECT_ISSPLINE will return True if the obj is a spline, no matter if it is a "manual" spline or a parametric spline.
But how can I check if a object is a parametric "polygonal" object?
I mean, how can I check if an object, even if it is a generator, generates a polygonal object?

On 16/07/2015 at 17:49, xxxxxxxx wrote:

Hi
flash idea - op.GetPointCount() ?!

or i'm finding solutions that someone make dict with oplist of id's and check out ops from dict

On 16/07/2015 at 18:03, xxxxxxxx wrote:

I want to consider parametric objects as candidates that fulfill the check.
So, a Cube or a Sphere would be considered as "polygonal" objects by my code, even if they start as parametric.
But a Light or a Null would not, because they produce no geometry.
So, the op.GetPointCount() would not work as it only works with really polygonal objects.

I guess I will have to create a list with all the IDs and check with something like:

if op.GetType() in ID_list:

Not as elegant and much more complex.

On 16/07/2015 at 18:28, xxxxxxxx wrote:

Hello Rui,

you might need some additional if clauses for PythonGenerators, but basically you can use something like this snippet(in R16- otherwise  if op.GetType() == c4d.Opolygon:

  
  if not op: return  
  
  if op.IsInstanceOf(c4d.Opolygon) :  
      print "polygonalobject"  
  else:  
      base = op.GetCache()  
      if base:  
          if base.IsInstanceOf(c4d.Opolygon) :  
              print "polygonalobject"  
  

Hope this helps?
Best Wishes
Martin

On 17/07/2015 at 01:31, xxxxxxxx wrote:

Hello,

there are no "polygonal parametric" objects. In Cinema there are generators that fill a cache – possibly with polygon objects. So you would have to check if a given object is a generator and then search the cache for polygon objects.

See also

Best wishes,
Sebastian

On 17/07/2015 at 01:45, xxxxxxxx wrote:

I know there are no "polygonal parametric" objects. It was just a way to differentiate parametric objects that generate geometry from the ones that don't

I will check out that cache thing.
Thank you all.

On 22/10/2015 at 03:59, xxxxxxxx wrote:

Hello
Sorry for necromancy of topic 😉

I found additional similar method, ... well known method:

if hasattr(op, 'GetAllPoints') == False: return # or any stuff with procedural

else -   possible to csto procedural and return point op

On 22/10/2015 at 06:57, xxxxxxxx wrote:

@Ilya: That would be the same as using op.CheckType(c4d.Opoint). The OP wanted to know whether the
object generates  a polygonal object, not if it is  a polygonal object. And actually you'd have to test for
c4d.Opolygon  and 'GetAllPolygons' , otherwise you'd only check for point objects.

-N

On 22/10/2015 at 07:09, xxxxxxxx wrote:

Originally posted by xxxxxxxx

@Ilya: That would be the same as using op.CheckType(c4d.Opoint). The OP wanted to know whether the
object generates  a polygonal object, not if it is  a polygonal object. And actually you'd have to test for
c4d.Opolygon  and 'GetAllPolygons' , otherwise you'd only check for point objects.

-N

Hi
Argh, thank you
i made universal link-gui to op(without ACCEPT flag), i got this method when i looked at console and it wrote about no attribute. Then i remember my battles with pySide, SWIG... expesially attributes for objects and etc.