On 22/06/2015 at 03:59, xxxxxxxx wrote:
I would like to set axis to center of an object. And as I will use it in xpresso-python node, it should only fire for once. Position will be 0,0,0. I tried script below, please help.
from c4d import Vector as v
def setAxis(obj) :
size = obj.GetRad()
position = obj.GetMp() + obj.GetAbsPos()
if obj is None or not obj.CheckType(c4d.Opoint) : return False
oldm = obj.GetMg()
points = obj.GetAllPoints()
pcount = obj.GetPointCount()
newm = obj.GetMg()
newm.off = position-size/2
newm.v1 = newm.v1.GetNormalized()
newm.v2 = newm.v2.GetNormalized()
newm.v3 = newm.v3.GetNormalized()
for p in xrange(pcount) :
def main() :
if Source.CheckType(c4d.Opoint) :
On 29/06/2015 at 02:38, xxxxxxxx wrote:
is this thread on the same topic as in your other thread?
If you want to execute a python script only once you can edit and execute a script from the Script Manager. This allows you to run scripts that can edit the scene and it's objects as desired.
A Python Xpresso Node should only be used for logic operations etc. and not to edit the current scene since the node will be executed many times.
On 03/07/2015 at 09:40, xxxxxxxx wrote:
was your question answered?