Skip to content

Instantly share code, notes, and snippets.

@MikeUdin
Created January 10, 2017 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeUdin/d0cc84c7be28aa1d6fb2928852f84dc0 to your computer and use it in GitHub Desktop.
Save MikeUdin/d0cc84c7be28aa1d6fb2928852f84dc0 to your computer and use it in GitHub Desktop.
Script creates new Sweep Nurbs object from selected edge
import c4d
from c4d import utils
# This script creates new Sweep Nurbs object from selected edge
# Author: Mike Udin,
# Tutorial here http://mikeudin.net/2017/01/10/cinema-4d-python-send-modelling-command
# 2016
def main():
settings = c4d.BaseContainer()
res = utils.SendModelingCommand(command = c4d.MCOMMAND_EDGE_TO_SPLINE,
list = [op],
mode = c4d.MODELINGCOMMANDMODE_EDGESELECTION,
bc = settings,
doc = doc)
sweep = c4d.BaseObject(5118)
circle = c4d.BaseObject(5181)
circle[c4d.PRIM_CIRCLE_RADIUS] = 5
circle.InsertUnder(sweep)
op.GetDown().InsertAfter(circle)
doc.InsertObject(sweep)
c4d.EventAdd()
if __name__=='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment