move the axis ??

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/04/2011 at 04:58, xxxxxxxx wrote:

Hi.

I want to move the axis of the object in a script.
What should be carried out in what way?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/04/2011 at 05:56, xxxxxxxx wrote:

I don't know a comfortable way to solve this. You have to move the points of the Object, instead of the axis itself, and then move the hole object (including the axis of course ;] ) again in that negative direction..

Try this example 😉

import c4d  
from   c4d import gui  
  
def err_message() :  
  gui.MessageDialog("Please enter a vector!")  
  
  
def main() :  
  vec       = gui.InputDialog("X Axis Offset","c4d.Vector(0,100,0)")  
  
  try: vec  = eval(vec)  
  except: pass  
  if not isinstance(vec,c4d.Vector) :   
      err_message()  
      return False  
  
  print     "Axis Offset: %s" % vec  
  points    = op.GetAllPoints()  
  
  for i in range(len(points)) :  
      points[i] = points[i]+(vec*(-1))  
  op.SetAbsPos(op.GetAbsPos()+vec)  
  op.SetAllPoints(points)  
  op.Message(c4d.MSG_UPDATE)  
  c4d.EventAdd()  
  return True  
  
if __name__=='__main__':  
  main()

Greets, nux

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 01/04/2011 at 20:58, xxxxxxxx wrote:

Thanks Nux

'll try this way!