Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
On 11/10/2014 at 08:36, xxxxxxxx wrote:
I have been searching for some time but cannot find a simple answer to this that actually works for the Python Generator:
How can the Python Generator create a sphere and then make it editable, so it is no longer a primitive?
Thanks, S
On 11/10/2014 at 16:38, xxxxxxxx wrote:
Hi. as far as I know, the Python generator don´t let you insert a converted polygonal version, offhandedly. You can write your own Sphere object or use this workaround; The generator has some userdata to manipulate the sphere and a child object which stays every time updated. Like this example:
import c4d from c4d import utils def main() : obj=c4d.BaseObject(c4d.Osphere) # check if there is allready userdata for the python generator # just to begin with something; insert userdata for the radius of the sphere if op.GetUserDataContainer() == []: radius=c4d.GetCustomDataTypeDefault(c4d.DTYPE_REAL) radius[c4d.DESC_NAME] = "radius" op.AddUserData(radius) radiusvalue = op[c4d.ID_USERDATA,1] else: radiusvalue = op[c4d.ID_USERDATA,1] #set the sphere to the user given radius obj[c4d.PRIM_SPHERE_RAD] = radiusvalue #convert to a polygonal object newobjList = utils.SendModelingCommand( command = c4d.MCOMMAND_CURRENTSTATETOOBJECT, list= [obj.GetClone()], mode=c4d.MODELINGCOMMANDMODE_ALL, doc = doc) #instead of letting the generator creating an object directly #do this set and replace code for your polygonal object if op.GetDown()==None: doc.InsertObject(newobjList[0],op) else: obj_2=op.GetDown() obj_2.Remove() doc.InsertObject(newobjList[0],op) return
But I´m not sure if this is the best solution. I´m really interested, if there is a better way to solve it. There was another post with a circle object lately.
https://plugincafe.maxon.net/topic/8124/10584_python-generator--spline-outline
cheers Martin
Edit: the geometrical manipaltion of the sphere will be gone after the generator refreshes the sphere. It´s just a replacement. if you want real procedural geometrie watch out for the Houdini integration. or Fabric engine at the beginning of 2015.
On 12/10/2014 at 06:44, xxxxxxxx wrote:
Great! This is exactly what I was looking for. Thank you so much for taking the time to explain that for me.
On 13/10/2014 at 04:35, xxxxxxxx wrote:
you´re welcome ! Cheers, Martin