On 06/12/2016 at 07:58, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 17, 18
Platform: Windows ;
Language(s) : PYTHON ;
---------
Hello, small back to c4d
I tried for friend to make small clonner based at interactive xref-ops.
If add Xref by op.SetParameter(c4d.ID_CA_XREF_FILE, 'xref.c4d', c4d.DESCFLAGS_SET_USERINTERACTION), in py-gen op. It crashed c4d.
If normally add by console or script, all are ok.
import c4d
import random
def main() :
null = c4d.BaseObject(c4d.Onull)
bt=doc.GetTime()
fps=doc.GetFps()
Frame=bt.GetFrame(fps)
if Frame == 0:
i = 1
while i < 5:
i = i + 1
testop = c4d.BaseObject(c4d.Oxref)
testop.SetAbsPos(c4d.Vector(i*400, 0, 0))
testop.SetParameter(c4d.ID_CA_XREF_GENERATOR, True, c4d.DESCFLAGS_SET_USERINTERACTION)
testop.SetParameter(c4d.ID_CA_XREF_FILE, 'xref.c4d', c4d.DESCFLAGS_SET_USERINTERACTION)
testop.SetParameter(c4d.ID_CA_XREF_OFFSET, c4d.BaseTime(random.uniform(0.0, 1.0)), c4d.DESCFLAGS_SET_USERINTERACTION)
testop.InsertUnder(null)
return null