Last active
February 10, 2020 16:25
-
-
Save MikeUdin/9b29e91e4c4d1af3a5af724f3733f495 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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