Report problems with the new Python API here please!
Moderators: jesterKing, stiv
-
- Posts: 180
- Joined: Wed Oct 16, 2002 7:27 pm
- Location: Somewhere below the rivers in Holland (but not Limburg)
Report problems with the new Python API here please!
Hi,
I would like to collect all problems, bugs, inconsistencies and small changes in this topic. When you have found a problem, please first check if somebody else has already reported it. If the problem you've found is not posted yet, please give a complete report on how to reproduce it - if applicable with a few lines of Python code.
Do not ask for any new modules to be added for the 2.28 release. After 2.28 is released, new modules can be added.
Thank you for testing.
With regards,
Michel
I would like to collect all problems, bugs, inconsistencies and small changes in this topic. When you have found a problem, please first check if somebody else has already reported it. If the problem you've found is not posted yet, please give a complete report on how to reproduce it - if applicable with a few lines of Python code.
Do not ask for any new modules to be added for the 2.28 release. After 2.28 is released, new modules can be added.
Thank you for testing.
With regards,
Michel
Last edited by Michel on Mon Aug 25, 2003 3:25 pm, edited 1 time in total.
-
- Posts: 0
- Joined: Sat Mar 22, 2003 10:45 pm
Re: Report problems with the new Python API here please!
OK.Michel wrote:Hi,
I would like to collect all problems, bugs, inconsistencies and small changes in this topic. ..
in module BLender.Object
Code: Select all
import Blender
OBJLIST=Blender.Object.Get()
for o in OBJLIST:
print o.name,o.Layer,
Using a clean Global Dictionary.
Run Python script "Text" ...
Traceback (most recent call last):
File "Text", line 4, in ?
AttributeError: 'str' object has no attribute 'name'
Last edited by jms on Wed Jul 02, 2003 10:46 am, edited 4 times in total.
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.
I notice that the object names are now being reported differently to version 2.23.
For instance I have a tyre of radius 3.5 with an anti-clockwise forward rotation called Tyre01-3.5
my script extracts the data using the .name. so:
mTyre = Blender.link
rad = eval(mTyre.name[7:])
dir=eval(mTyre.name[6] + "1")
Under version 2.23 this works fine, but under this test version it doesn't. Adding the line:
print mTyre.name
shows that the returned name is now OBTyre01-3.5 instead of Tyre01-3.5.
I know it's a minor issue, solved by adding 2 to the substring arguments, but it's one people need to be aware of. I assume this is a permanent feature of the code and not just some test diagnostic s
For instance I have a tyre of radius 3.5 with an anti-clockwise forward rotation called Tyre01-3.5
my script extracts the data using the .name. so:
mTyre = Blender.link
rad = eval(mTyre.name[7:])
dir=eval(mTyre.name[6] + "1")
Under version 2.23 this works fine, but under this test version it doesn't. Adding the line:
print mTyre.name
shows that the returned name is now OBTyre01-3.5 instead of Tyre01-3.5.
I know it's a minor issue, solved by adding 2 to the substring arguments, but it's one people need to be aware of. I assume this is a permanent feature of the code and not just some test diagnostic s
-
- Posts: 180
- Joined: Wed Oct 16, 2002 7:27 pm
- Location: Somewhere below the rivers in Holland (but not Limburg)
Whoops, this is a stupid error. This will be fixed. Thanks!gowen wrote:Under version 2.23 this works fine, but under this test version it doesn't. Adding the line:
print mTyre.name
shows that the returned name is now OBTyre01-3.5 instead of Tyre01-3.5.
I know it's a minor issue, solved by adding 2 to the substring arguments, but it's one people need to be aware of. I assume this is a permanent feature of the code and not just some test diagnostics
With regards,
Michel
-
- Posts: 180
- Joined: Wed Oct 16, 2002 7:27 pm
- Location: Somewhere below the rivers in Holland (but not Limburg)
Re: Report problems with the new Python API here please!
I will look into this! Thank you.jms wrote: in module BLender.Objectreturn this:Code: Select all
import Blender OBJLIST=Blender.Object.Get() for o in OBJLIST: print o.name,o.Layer,
Using a clean Global Dictionary.
Run Python script "Text" ...
Traceback (most recent call last):
File "Text", line 4, in ?
AttributeError: 'str' object has no attribute 'name'
With regards,
Michel
Re: Report problems with the new Python API here please!
This seems to work:Michel wrote:I will look into this! Thank you.jms wrote: in module BLender.Objectreturn this:Code: Select all
import Blender OBJLIST=Blender.Object.Get() for o in OBJLIST: print o.name,o.Layer,
Using a clean Global Dictionary.
Run Python script "Text" ...
Traceback (most recent call last):
File "Text", line 4, in ?
AttributeError: 'str' object has no attribute 'name'
With regards,
Michel
Code: Select all
import Blender
O=Blender.Object.Get()
Olist=[]
for o in O:
print type(o)
Olist.append(Blender.Object.Get(o))
print str(Olist), type(Olist[0])
if str() is not used.
Last edited by jms on Wed Jul 02, 2003 12:53 pm, edited 1 time in total.
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.
Can't seem to get name in PutRaw to return anything except None, as in:-
Code: Select all
import Blender
from Blender.NMesh import Col
from Blender.Draw import *
import string
meshname="Cube"
me= Blender.NMesh.GetRaw(meshname)
i = 1
for f in me.faces:
new = Blender.NMesh.GetRaw()
new.verts = f.v
f.mat = 0
new.faces = [f]
ob=Blender.NMesh.PutRaw(new)
ob.name="Cube" + "." + string.zfill(`i`, 3)
print ob.name
i = i + 1
print i ,"pieces"
print "-------------------------------"
Blender.Redraw()
I have a set of python scripts inside blender file, example: main.py, first.py
This files are not in my disk only in the blender file.
In the main.py I just to import the first.py with:
import first
or
from first import *
With the old python It works OK, but now an error message appears
"ImportError: No module named first"
This files are not in my disk only in the blender file.
In the main.py I just to import the first.py with:
import first
or
from first import *
With the old python It works OK, but now an error message appears
"ImportError: No module named first"

Blender.Lamp.Get()
Win32 = > Win98:
crash...
not.
Code: Select all
import Blender
L=Blender.Lamp.Get()
print L
Code: Select all
import Blender
L=Blender.Lamp.Get()
print str(L)
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.
_Blender ?
Code: Select all
import _Blender
Traceback (most recent call last):
File "Text.001", line 1, in ?
ImportError: No module named _Blender
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.
world module
a Blender.World.getCurrent()/setCurrent() functions could be useful.
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.
-
- Posts: 47
- Joined: Wed Oct 16, 2002 3:05 am
- Location: NM, US
- Contact:
This doesn't work:
Fails with
Also, it appears that materials are now linked to objects (before it was linked with object data). In the settings window, I have "Material linked to" set to ObData as well.
Code: Select all
objs = Blender.Object.Get()
#objs returns ['Plane', 'Camera', etc...]
for obj in objs:
#obj returns Plane (no quotes)
name = obj.getData()
Code: Select all
AttributeError: 'str' object has no attribute 'getData()'
-ray_theray
Problem with matrix too:
Code: Select all
import Blender
L=Blender.Object.Get('Lamp.001')
print L.getMatrix()
"""
2.27 new-py
((0.0, 0.0, 0.0, 0.0),
(0.0, 0.0, 0.0, 0.0),
(0.0, 0.0, 0.0014120666310191154, 0.0),
(0.0, 0.0, 0.0, 0.008771928958594799))
"""
"""
2.27 normal
((1.0, 0.0, 0.0, 0.0),
(0.0, -4.3711388286737929e-008, 1.0, 0.0),
(0.0, -1.0, -4.3711388286737929e-008, 0.0),
(-0.25819849967956543, -7.2443208694458008, 5.5631
518363952637, 1.0))
"""
Zoo-3D.Blender, Ze French-Speaking Community SKB My french book about Blender.