Search found 5 matches

by revans
Wed May 09, 2007 6:15 pm
Forum: Python
Topic: Accessing mesh users ?
Replies: 4
Views: 2729

Or, if you prefer list comprehensions:

Code: Select all

def getUsers(mesh):
  scene = Scene.GetCurrent()
  meshes = [obj for obj in scene.getChildren() if obj.getType() == "Mesh"]
  return [mesh_obj.getName() for mesh_obj in meshes if mesh_obj.getData(False, True).name == mesh.name]
by revans
Wed May 09, 2007 5:48 pm
Forum: Python
Topic: Accessing mesh users ?
Replies: 4
Views: 2729

I believe reD_Fox is correct. Here's a function that I wrote that may suit your needs: def getUsers(mesh): toReturn = [] scene = Scene.GetCurrent() meshes = filter(lambda x: x.getType() == "Mesh", scene.getChildren()) for mesh_obj in meshes: if mesh_obj.getData(False, True).name == mesh.name: toRetu...
by revans
Wed May 09, 2007 12:47 am
Forum: Python
Topic: Applying scale and rotation from a script?
Replies: 1
Views: 3289

Applying scale and rotation from a script?

Is there an exposed function that will allow me to apply scale and rotation to a scene from python? (The equivalent of hitting Ctrl-A in non-edit mode)

Thanks!
Ryan
by revans
Wed May 09, 2007 12:38 am
Forum: Python
Topic: Calling Quads to Tris from a script?
Replies: 1
Views: 1859

Re: Calling Quads to Tris from a script?

Answering my own question, I found that this worked: scene = Scene.GetCurrent() # Get only meshes, since we're not doing dynamic lighting meshes = filter(lambda x: x.getType() == "Mesh", scene.getChildren()) # Export each mesh for child in meshes: Window.EditMode(0) data = Mesh.Get(child.getName()) ...
by revans
Tue May 08, 2007 10:21 pm
Forum: Python
Topic: Calling Quads to Tris from a script?
Replies: 1
Views: 1859

Calling Quads to Tris from a script?

Hi everyone, I'm trying to make a script that will select each mesh in a blend file and call Quads -> Tris on that mesh. Here's what I have so far: scene = Scene.GetCurrent() # Get only meshes, since we're not doing dynamic lighting meshes = filter(lambda x: x.getType() == "Mesh", scene.getChildren(...