Skip to content

Instantly share code, notes, and snippets.

@MikeUdin
Last active February 10, 2020 16:25
Show Gist options
  • Save MikeUdin/9b29e91e4c4d1af3a5af724f3733f495 to your computer and use it in GitHub Desktop.
Save MikeUdin/9b29e91e4c4d1af3a5af724f3733f495 to your computer and use it in GitHub Desktop.
import c4d
def apply_axis(op,new_m):
loc_m = ~new_m * op.GetMg() #Get local matrix
op.SetAllPoints([loc_m.Mul(p) for p in op.GetAllPoints()])
op.SetMg(new_m)
op.Message(c4d.MSG_UPDATE)
c4d.EventAdd()
def main():
if not op or not isinstance(op,c4d.PointObject):
c4d.gui.MessageDialog('Please select spline or polygon object')
return
apply_axis(op, op.GetModelingAxis(doc))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment