On 21/08/2013 at 12:32, xxxxxxxx wrote:
Hi guys-- C4D-Python newbie here. I'm trying to understand the relationship between variable name and base objects, if any exists at all.
Can someone shed some light on what's happening here? In a Python Generator Object: I create a null, and place Cube ("box") under it. I place a second Cube diagonal to "box" ("box2"). If I define box2 again, this time opposite from the first definition of box2, another Cube is created.
What's going on here? Is my original box2 essentially a left over artifact, deposited into the scene in a static manner and unable to be referenced again? Can I still access it somehow or is it essential "floating in space" as a by product of how the Generator Object relates to the timeline? I guess I expected the original box2 to be overwritten and thus removed from the scene.
My background is in Processing, so I'm sure this is pretty straightforward.. just trying to understand.
Thank you!
import c4d
#Welcome to the world of Pythondef main() :
null = c4d.BaseObject(c4d.Onull)
box = c4d.BaseObject(c4d.Ocube)
box.InsertUnder(null)
box2 = c4d.BaseObject(c4d.Ocube)
box2.InsertUnder(null)
box2.SetAbsPos(c4d.Vector(box[c4d.PRIM_CUBE_LEN]))
box2 = c4d.BaseObject(c4d.Ocube)
box2.InsertUnder(null)
box2.SetAbsPos(c4d.Vector(box[c4d.PRIM_CUBE_LEN]*-1))
return null