deepshade
02-04-2012, 12:56 PM
Basically, 'gen' is the name of a variable (referencing the cloner or generator object) added to the execution of main() function in a Python effector, just as the same as 'doc' (document where the effector resides) and 'op' (effector) variables:
import c4d
from c4d.modules import mograph as mo
#Welcome to the world of Python
def main():
md = mo.GeGetMoData(op)
if md==None: return 1.0
# Print variables added to the scope of main()
print op
print gen
print doc
index = md.GetCurrentIndex()
mode = md.GetBlendID()
if mode==c4d.ID_MG_BASEEFFECTOR_POSITION:
return c4d.Vector(0.5)
else: return 1.0
Why
When the python effector is set to Full Control
does GEN return the Cloner
and
when the python effector is set to Parameter Control
does GEN return the Cloner Object Link
???
import c4d
from c4d.modules import mograph as mo
#Welcome to the world of Python
def main():
md = mo.GeGetMoData(op)
if md==None: return 1.0
# Print variables added to the scope of main()
print op
print gen
print doc
index = md.GetCurrentIndex()
mode = md.GetBlendID()
if mode==c4d.ID_MG_BASEEFFECTOR_POSITION:
return c4d.Vector(0.5)
else: return 1.0
Why
When the python effector is set to Full Control
does GEN return the Cloner
and
when the python effector is set to Parameter Control
does GEN return the Cloner Object Link
???
