Page 1 of 1

Missing function???

Posted: Sun May 25, 2003 1:08 am
by Hqpsy
I'm trying to write an exporter for Blender.

This is pretty much the first week I'm trying Blender.

However, here is my problem:

I'm going through all objects in the scene and I just want to
export meshes, not lamps or cameras.

so I wrote:
for obj in self.scene.getChildre():

But I want to check if obj is a mesh first. In the old API you could write Blender.IsMesh(obj) but it's not possible in 2.27, I get an error :-(

Is there any other way?

Posted: Sun May 25, 2003 2:41 am
by ray_theray
Use this:

Code: Select all

for obj in Blender.Object.Get():
     if obj.getType == "Mesh":
          #do whatever...

Posted: Sun May 25, 2003 10:19 am
by Hqpsy
Ohh.. thx!!!

Posted: Mon May 26, 2003 12:17 am
by ray_theray
Wait... It should be:

Code: Select all

if object.getType() == "Mesh":

Posted: Tue May 27, 2003 2:12 pm
by Hqpsy
The first thing you wrote works fine, thx