Hi ThomasL,
Your .pdf does look very useful and interesting, but could you please make it available from somewhere else than RapidShare ? I tried to download it twice this morning, and at the second attempt I got kicked off their site with a rude message…
Thanks in advance,
Thierry
I confirm for Rapidshare. I thought I had to register, I tried to but could not validate my account. The Java scripts on their page seem to be shot, you get rude messages, these people SUCK. Please do try to find somebody else.
Thanks,
Thierry
in shapekey.py i had to change 3 times this line (usage without Argument)
bpy.ops.object.shape_key_add() #False)
and in batch.py
i changed the version-check to
version = [2, 55, 0]
and
because it is only possible for me to run batch.py one time with the default scene (thats the scene with 1 cube, lamp, cam)
i changed: #for ob in bpy.data.objects:
for ob in scn.objects:
to look only for objects in the scene, but even then it was
not possible to delete all objects created with the batch.
it says a lot “cyclic” and maybe it is necessary to have
different loops: one first setting all objects to mode=OBJECT
and then unlinking and deleting the list of objects for several times
until the cyclic dependency is solved by deleting the “parent”-object
to free the childs, so those will be deleted in the next run --?–
Would this work?
from the date of my posting,
there was this version(check the first posting of this thread, where he makes the updates):
Code_snippets_updated_for_Blender_254_2010_10_17.zip
and i dont know about any newer version.
Thats why there ist the change vor the version-number-check too (in my changes)
I have a question about curve creation. When I use the code snippet from the pdf it works and does exactly what it should until I change the handle type. The code I used is below:
import bpy
from mathutils import Vector
# Add curve and object.
aCurve = bpy.data.curves.new('aCurve','CURVE')
aObj = bpy.data.objects.new('aObj',aCurve)
bpy.context.scene.objects.link(aObj)
# Set attributes
aCurve.dimensions = '3D'
aCurve.use_fill_back = False
aCurve.use_fill_front = False
# Set the control coordinates
points = [(0,0,0),(2,2,-2),(3,-1,5)]
spline = aCurve.splines.new('BEZIER')
numPoints=len(points)
spline.bezier_points.add(numPoints-1) # Make sure only numPoints points in the curve, 1 is created with the new Bezier.
for n in range(numPoints):
newPoint = spline.bezier_points[n] # New point
newPoint.co = points[n] # Set the coordinates
newPoint.handle_left = newPoint.co+Vector((0,0,1)) # Set the handles above and below the points
newPoint.handle_right = newPoint.co+Vector((0,0,-1))
newPoint.handle_right_type='AUTO' # Set the handle type
newPoint.handle_left_type='AUTO'
However, if you enter edit mode the handles are clearly not in AUTO mode. If you select a point, press ‘G’ and then ‘ESC’ they will fix themselves.
Does anyone know why this happens and why they are not already correctly in AUTO mode?
The shapekey problem is due to an api change after 2.55 was released. It will be corrected eventually, but I want to wait a while and see if there will be more api changes.
Thankyou for this great thread, would you know how to get the colour info from an image/ texture.
so in 2.49 I have: r,g,b,a = zoneMap.getPixelF(rowPix, colPix)
what would it be in 2.5?
are you going to come up with a new vesion soon ?
there has been many changes to API in last 2 months
and hope it will stabilize soon!
also would it be possible to add more snippet for curves
like how do you identify curves
poly bezier spline
and also some examples on how to read/write the points for theses different
type of curves
then how to convert curves to another type of curve let say from bezier to poly or psline
and convert to mesh controlling the REso for a curve or bevel curve
another exmaple would be nice for adding a bevel and taper curve!
Looks like the add lattice and a few other of the scripts are not functioning. Seems “assign” isn’t an attribute anymore. Any ideas on what the current method would be?
This is a sample of the code in question. The ob.vertex_groups.assign is resulting in an error and an invalid attribute.
for v in ob.data.vertices:
if v.co[o] > 0.001:
ob.vertex_groups.assign([v.index], left, 1.0, 'REPLACE')