Hello @indexofrefraction,
Thank you for reaching out to us. Here seem to mix up two questions, let me split them up.
How to find out if something has a green check mark?
The green checkmark and its counterpart the red cross are just an alternative way to set ID_BASEOBJECT_GENERATOR_FLAG
, i.e., the enabled state of an object.
The caveat is however that this parameter is part of the BaseObject Description model, i.e., literally every object has that parameter. It is just that some object types hide and restrict write access to it. So, this applies:
# Get/set the generator flag of an object where we know that it has that GUI, can be disabled.
state: bool = op[c4d.ID_BASEOBJECT_GENERATOR_FLAG]
op[c4d.ID_BASEOBJECT_GENERATOR_FLAG] = not state
def CanDisable(obj: c4d.BaseObject) -> bool:
"""Tests if #obj can be disabled, i.e., if it has the "check mark GUI".
"""
# An object which is disabled always has that GUI.
if not obj[c4d.ID_BASEOBJECT_GENERATOR_FLAG]:
return True
# Attempt to disable the object.
obj[c4d.ID_BASEOBJECT_GENERATOR_FLAG] = False
# The object refused being disabled, it hides that GUI.
if obj[c4d.ID_BASEOBJECT_GENERATOR_FLAG]:
return False
# The object let us write the state, reinstate the previous state and return #True
obj[c4d.ID_BASEOBJECT_GENERATOR_FLAG] = True
return True
# Figure out if something lets us write to #ID_BASEOBJECT_GENERATOR_FLAG, i.e., if it can be
# disabled.
print(CanDisable(op))
What is a generator?
But the underlying question is: What qualifies as a generator? We have to remind ourself that modern day Cinema 4D (V5 up 2025.1.0) is a 27 years old software project. There is bound to be some terminological noise and inconsistency how flags are set/interpreted because when there is one thing developers love to do, then it is bending the rules .
The OBJECT flags do exist to enable API features when an ObjectData
plugin is registered. BaseList2D::GetInfo
just exposes that registration data and is not meant as a user facing classification of objects. Because which OBJECT
flags are passed and which kind of object plugin registration function is called, then determines how Cinema 4D operates that object in the scene graph. OBJECT_GENERATOR
in combination with IS_SPLINE
for example makes it so that Cinema 4D calls ObjectData::GetVirtualObjects
or ObjectData::GetContour
, the methods which implement a polygon or spline object generator.
But over the time, our developers got creative, and there are now objects which act both as objects and splines, objects can (sort of) act as tags, and many things more. And then there are of course things like null objects, lights, cameras and more, which escape the pattern "poly generator, spline generator, point deformer, or particle deformer" entirely. When interpreted practically, I would classify everything as a generator that has a cache that is not a null object. You can read more about our object model here.
Last but not least, when you just want to find out if something is a field, you can just test for OBJECT_FIELDOBJECT
. But just as for OBJECT_GENERATOR
, some things might bend on a technical level the rules of what a field is and what not, as these are not classification flags but API features enabling flags.
Cheers,
Ferdinand