On 03/02/2015 at 21:15, xxxxxxxx wrote:
Say I have a cube with a number of segments. Is there maybe a pythonic way to taper it without using the the deformers ????
On 03/02/2015 at 21:15, xxxxxxxx wrote:
Say I have a cube with a number of segments. Is there maybe a pythonic way to taper it without using the the deformers ????
On 04/02/2015 at 06:23, xxxxxxxx wrote:
Hello,
I guess you speak of a parametric cube object? The only way to deform parametric objects is to use deformers. These deformers can work on the object's cache.
In contrast, polygon objects can be edited any way you like.
best wishes,
Sebastian
On 04/02/2015 at 06:41, xxxxxxxx wrote:
S_Bach, Sorry I should have said the cube is made editable :blush:
So how would I go around tapering a point object without a deformer ??
I want the cube to deform to a cone shape with a slider?? (Python)
On 04/02/2015 at 08:34, xxxxxxxx wrote:
Hello,
to edit the shape (geometry) of a polygon object you just need to change the position of it's points. To get all points of a polygon object just call GetAllPoints(). To set the position of a certain point use SetPoint(). You find some example on this in the SpherifyModifier example.
You can control such deformation with a slider, but this depends on what kind of GUI you use and what kind of plugin you are creating.
Best wishes,
Sebastian
On 04/02/2015 at 21:09, xxxxxxxx wrote:
I know about "GetAllPoints" and "SetPoint" :wink:
I have got this far with a "plane object"
obj = doc.SearchObject("Plane")
cntrl = doc.SearchObject("Null")
Scale = cntrl[c4d.ID_USERDATA,1]/100
pntA = [c4d.Vector(-200, 0, -200),c4d.Vector(200, 0, -200),
c4d.Vector(-200, 0, -160),c4d.Vector(200, 0, -160),
c4d.Vector(-200, 0, -120),c4d.Vector(200, 0, -120),
c4d.Vector(-200, 0, -80),c4d.Vector(200, 0, -80),
c4d.Vector(-200, 0, -40),c4d.Vector(200, 0, -40),
c4d.Vector(-200, 0, 0),c4d.Vector(200, 0, 0),c4d.Vector(-200, 0, 40),
c4d.Vector(200, 0, 40),c4d.Vector(-200, 0, 80),c4d.Vector(200, 0, 80),
c4d.Vector(-200, 0, 120),c4d.Vector(200, 0, 120),c4d.Vector(-200, 0, 160),
c4d.Vector(200, 0, 160),c4d.Vector(-200, 0, 200),c4d.Vector(200, 0, 200)]
pntsC = len(pntA)
obj.ResizeObject(pntsC)
for i in xrange(len(pntA)) :
new_x = (i * pntA[i].x) / (pntsC-1) * Scale
obj.SetPoint(i,c4d.Vector(new_x,pntA[i].y,pntA[i].z))
On 05/02/2015 at 00:14, xxxxxxxx wrote:
Hello,
so, what exactly is your question?
Best wishes,
Sebastian