.thisMaterial .thisObject (from XSI ICE)


#1

Hi. let me take a moment explaining something first before I ask my question

For example I have a null, the null have a material associated to it, and it also contains a box and a text.

In softimage I can script ICE like this (“this” container is the null, and then only add “this.material”, “this.cube”. "this.text), then if I have several nulls with materials and a box

nulll …box
…texta text, I only have to copy my script to all the nulls and voilaaa.

this.null… this.box
this.text (first script in ICE- copy)

this.null… this.box
this.text (paste ICE)

this.null… this.box
this.text (paste ICE)

this.null… this.box
this.text (paste ICE)

Now in C4D, with my little knowledge, if I have several nulls with materials and a box and a text inside of them, I have to manually drag and drop the corresponding names into their corresponding boxes, like this:

nulll1 …box (first xpresso tag with names associated)
…text

nulll2 …box (ctrl drag to paste, replace names associated)
…text

nulll3 …box (ctrl drag to paste, replace names associated)
…text

nulll4 …box (ctrl drag to paste, replace names associated)
…text

Now, I have a lot of things to change, and I would like to know If there is a faster way so I can optimize the scene.

Im including a dropbox link of my example scene in C4D.

https://www.dropbox.com/s/f0xwxnkecdkpvyf/mapa_final.c4d


#2

the c4d api very different from the xsi api. a pointer to the executing instance does not
exist. however there is op, which can fulfill a somewhat similar role. op is variable which
is predefined for scripts, script tags and script nodes. it originates from the api where op
is often passed as a method argument holding some sort of node.

op in a script is the currently selected object. If there is no selection or a multiselection, op is None
op in py tag is the tag instance
op in py gvnode is the gvnode instance

so for your scenario as a script:

this = op
box = this.GetNext() # assuming there is fixed hierarchy structure
txt = box.GetNext()

as a tag:
this = op.GetObject() # get the object the tag is sitting on


#3

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.