I need the "real" coordinates

Hi!
I want to use blender mesh data’s an other application. I export some datas. If I use scale, rotate and don’t apply size/rotation the mesh’s coords are bad.
How do I calculate “real” coords?
Is there are funtions?

example: size
realx = x * size.x
realy = y * size.y
realz = z * size.z

It’s ok, but circuitous, for all data (vertex, normals) and rotate… bah

Another idea:
How do I call in python:
ApplyChanges
Undo

I think so, I call ApplyChanges before export mesh’s data, and Undo after export. It isn’t elegant, perhaps works.

Re,
Kammu

Hmm, I don’t know if there is a python function that transforms object coordinates to python coordinates, but even if there isn’t one you should be able to retrieve the transform matrices for all transformations on the mesh, combine them to a single matrix by multiplying them and then just apply the final transform matrix to your vertices. There’s several documents about matrix transforms for 3d operations, just google ‘matrix 3d’ or ‘matrix transform’, once you pruned out movie related results you should have plenty of documentation.

In the blender 2.36 CVS, you have to use the current testing built version :


#From api2_2x cvs doc
# This script outputs deformed meshes worldspace vertex locations
# for a selected object
import Blender
from Blender import NMesh, Object
     
ob = Object.GetSelected()[0] # Get the first selected object
me = NMesh.GetRawFromObject(ob) # Get the objects deformed mesh data
me.transform(ob.matrix)
   
for v in me.verts:
       print 'worldspace vert', v.co


I have used blender 2.36, but GetRawFromObject - unknown, and
transform(ob.matrix) - makes an error

:frowning:

An error in the doc . Try :

me = NMesh.GetRawFromObject(ob.name) # Get the objects deformed mesh data

Yeah! That’s work!

Unfortunately .trasform() makes Attributes error!
I’m seaching .tranform in API, but I didn’t find :slight_smile:

I don’t understand, why have to I use transform.

This function gets deformed mesh data, already modified for rendering

  • from API
    I try without transform, coordinates are bad:(

Are you really working with this blender version :http://www.zoo-logique.org/3D.Blender/galeries_automatiques/galeries/images_blender/2005/236splshcvs.jpg
?

No, I’m working with 2.36. I looked the link which is written by you (test build) but I can’t find there cvs version.

I tried CVS page http://projects.blender.org/ and http://download.blender.org/. I don’t see download binary (compiled) cvs version.
I can’t compile blender source.

Do you give me right link for cvs version?

you didn’t look too hard eh? :stuck_out_tongue:

There is an entire forum dedicated to testing builds:

http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewforum&f=18

Madcow

Thx!
I’ve never read test build forum. Jms’s link doesn’t have real link for download cvs version (only changes list). I was lamer :slight_smile:

jms

Mega thanks!
Script works! (apparently) I will be testing more.
[/quote]

When a new build is available, it seems that gabio removes the old link .