[Bf-python] A bug in new python?

Manuel manuelbastioni at tin.it
Tue Jul 8 21:45:00 CEST 2003


The code

pippo = Blender.Object.getSelected()
 if pippo[0].getType() == "Mesh":
    pippoData = Blender.NMesh.GetRawFromObject(pippo[0].name)

give me an attribute error: in the scene I've "plane" and "sphere", but
Blender try
"OBplane", "OBsphere", and I've this message:

AttributeError: OBSphere


I've try to use this instead:

if pippo[0].getType() == "Mesh":
  pippoData = Blender.NMesh.GetRawFromObject(str(pippo[0].name)[2:])

but I've this message, at the same line:

Traceback (most recent call last):
  File "truedisplacement13.py", line 112, in bevent
  File "truedisplacement13.py", line 58, in displaceTrue
  File "C:\Python22\lib\warnings.py", line 38, in warn
    filename = sys.argv[0]
AttributeError: 'module' object has no attribute 'argv'

If I print str(pippo[0].name)[2:] the result is correct, like "sphere" or
"plane"...

I've the same error with this code:
pippoData = Blender.NMesh.GetRawFromObject("sphere")







More information about the Bf-python mailing list