Jump to content

kvb

Limited Member
  • Posts

    554
  • Joined

  • Last visited

Everything posted by kvb

  1. Thanks for the mention @Hrvoje. Wish Gap Effector solved this problem, but its main goal was to create gaps between every Nth clone. @kaluginseems to have figured it out though... well done sir! Regarding my gap effector, someone on twitter posted an effector they made which is my gap effector on crack. I was mighty impressed... just wish I could remember who it was or what they called it
  2. kvb

    completing a code

    Ah, yes. I see now that you want to select through the script. That depends entirely on the specifics for what you're trying to do. Manual selection would be the most straight forward approach and would keep the script usable in any situation as long as one is willing to manually make their own selections. Using polygon selections would also be an option, but again, the selection is manual it's just that you're setting things up ahead of time (and that may lead to other code changes, like wanting to ignore some selections while respecting others, etc.). Selecting by index (as you mentioned above) could be tricky since indices could change as the geometry changes, and depending on the specific criteria, it could get even trickier. For instance, in your example you say you want to select "all top polygons". First you have to define what a top polygon is. If you mean all the polygons that face a certain direction you'd have to loop through all polygons, determine their normal direction and then add their index to a BaseSelect. Here's a good discussion on polygon selections in python that mentions selection by index : http://www.plugincafe.com/forum/forum_posts.asp?TID=5859 It's from 2011 (back before python was fully integrated and it was the py4D plugin), so naturally the sdk has changed a bit since then, so refer to the current documentation if things aren't working;) Pay special attention to Niklas' final post in the thread. That post also shows what it entails to determine the normal direction of all the polygons in an object (the op is trying to write a script that determines the direction walls face to fill polygon selections). To have the script affect multiple objects you'd want to do something like run your code through a for loop by first getting the active selection. See code below. import c4d from c4d import utils settings = c4d.BaseContainer() # Settings settings[c4d.MDATA_EXTRUDE_OFFSET] = 50.0 # Length of the extrusion active_objects = doc.GetActiveObjects(flags=c4d.GETACTIVEOBJECTFLAGS_CHILDREN) # Get OM Selection for obj in active_objects: res = utils.SendModelingCommand(command = c4d.ID_MODELING_EXTRUDE_TOOL, list = [obj], mode = c4d.MODELINGCOMMANDMODE_POLYGONSELECTION, bc = settings, doc = doc) c4d.EventAdd() if res is False: print "Something went wrong." elif res is True: print "Command successfull." elif isinstance(res, list): print "Here you get the newly created object(s)." -kvb
  3. kvb

    completing a code

    Code works as is for what you want. Just make a selection and run the script. It may seem like it just extrudes all polygons because you probably haven't selected any and so the extrude tool just acts on all polygons. Once you make a selection the command will be restricted to that selection. -kvb
  4. Hey Cactus,

    Sorry I missed it, I should be notified of all posts on my forum, but for some reason I wasn't. Glad you got it working. You're the first to attempt an xbox controller on Mac with Control4D:) So it works fine under usb? Have you tried connecting it via bluetooth? I'd be interested to know how that works:)

×
×
  • Create New...