Missing function???

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Hqpsy
Posts: 14
Joined: Sun May 25, 2003 12:56 am

Missing function???

Postby Hqpsy » Sun May 25, 2003 1:08 am

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():
self.ExportData(obj)

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?

ray_theray
Posts: 49
Joined: Wed Oct 16, 2002 3:05 am
Location: NM, US
Contact:

Postby ray_theray » Sun May 25, 2003 2:41 am

Use this:

Code: Select all

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

Hqpsy
Posts: 14
Joined: Sun May 25, 2003 12:56 am

Postby Hqpsy » Sun May 25, 2003 10:19 am

Ohh.. thx!!!

ray_theray
Posts: 49
Joined: Wed Oct 16, 2002 3:05 am
Location: NM, US
Contact:

Postby ray_theray » Mon May 26, 2003 12:17 am

Wait... It should be:

Code: Select all

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

Hqpsy
Posts: 14
Joined: Sun May 25, 2003 12:56 am

Postby Hqpsy » Tue May 27, 2003 2:12 pm

The first thing you wrote works fine, thx


Return to “Python”

Who is online

Users browsing this forum: No registered users and 1 guest