I apologies for the delay, I did not forgot you, but it still not have more information about this.
I've got some feedback,
You can't rely on the fact that all resource name contain Redshift. (most but not all).
As Some parts are generated dynamically this could break your tools.
May I ask you what are you trying to implement ?
it's coming from C4DAtom
I've sent an email to Redshift to ask them if we can be sure that every Symbol have "redshift" in the name.
I'll come back if i have more information.
Remember to mark this thread as solved once you are sure it's solved :)
Hello and thanks for the question,
First, for your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here.
I've added the tags and marked this thread as a question so when you considered it as solved, please change the state :)
Let's answer the second question first because that maybe answer the first.
Once you have your
GvNode you can retrieve the description of that node using
desc = node.GetDescription(c4d.DESCFLAGS_DESC_NONE) for bc, paramid, groupid in desc: print bc[c4d.DESC_DEFAULT], bc[c4d.DESC_NAME], bc[c4d.DESC_IDENT], paramid, groupid
In the BaseContainer you can have information using DESC_xxxx ids
Sometimes it can be strange to retrieve the min/max value (it's often the min max value of the data type, so you have to use DESC_MINSLIDER)
DESC_IDENT, DESC_IDENT_ORIGIN can be interesting to answer your question 1 because it stores the resource identifier.
Another trick can be to retrieve all Symbol that have REDSHIFT in his name with something like this
rsSym = filter(lambda x: "REDSHIFT" in x , dir(c4d)) print rsSym
this is because the modata are store in a tag that is not created yet.
a "workaround" is to create it in a "temporary document" and
ExecutePasses() on it.
So the cloner will create the hidden tag and you will be able to retrieve the
import c4d #Welcome to the world of Python def CreateClonerAndFun(base, rad): """ Creates the cloner, clone the base. Creates the effector return the parent and the cloner. """ parent = c4d.BaseObject(c4d.Onull) base = base.GetClone() base.InsertUnderLast(parent) cloner = c4d.BaseObject(1018544) cloner.InsertUnder(parent) p = c4d.BaseObject(c4d.Onull) p[c4d.NULLOBJECT_DISPLAY] = 2 p[c4d.NULLOBJECT_RADIUS] = rad p.InsertUnder(cloner) pushEffector = c4d.BaseObject(440000219) pushEffector[c4d.MGPUSHAPARTEFFECTOR_MODE] = 0 pushEffector[c4d.MGPUSHAPARTEFFECTOR_RADIUS] = rad pushEffector.InsertUnderLast(parent) ie = c4d.InExcludeData() ie.InsertObject(pushEffector,15) cloner[c4d.ID_MG_MOTIONGENERATOR_MODE] = 0 cloner[c4d.ID_MG_MOTIONGENERATOR_EFFECTORLIST] = ie cloner[c4d.MG_OBJECT_LINK] = base cloner[c4d.MG_POLY_MODE_] = 0 return parent, cloner def main(): # Checks if we got a child child = op.GetDown() if child is None: raise ValueError("no child on this generator") # using a function to avoid double code parent, cloner = CreateClonerAndFun(child, 10) # Creates a new Document newDoc = c4d.documents.BaseDocument() # Inserts the object in the new document newDoc.InsertObject(parent) # ExecutePasses on the document if not newDoc.ExecutePasses(None,True,True,True, c4d.BUILDFLAGS_NONE): raise ValueError("erro while updating the document") # Retrieves the modata from the object md = c4d.modules.mograph.GeGetMoData(cloner) print md # Re-create the cloner but this time to return the parent. return CreateClonerAndFun(child, 10)