vertices.co.z always 0.0 - inline python

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

ros2468
Posts: 1
Joined: Wed Nov 21, 2012 3:15 am

vertices.co.z always 0.0 - inline python

Postby ros2468 » Wed Nov 21, 2012 3:35 am

Hello,
Im using the inline console for retrieving vertex data of a plane triangle, but the vertexes z axis value seem to be wrong.
Link to picture

CoDEmanX
Posts: 894
Joined: Sun Apr 05, 2009 7:42 pm
Location: Germany

Postby CoDEmanX » Wed Nov 21, 2012 2:08 pm

if you use the "old" bpy api, you need to toggle edit mode, or you will still get the vertex locations as they were before you entered edit mode.

bpy.ops.object.mode_set(mode='OBJECT')

you can avoid changing mode by using the bmesh module
http://www.blender.org/documentation/bl ... bmesh.html
I'm sitting, waiting, wishing, building Blender in superstition...


Return to “Python”

Who is online

Users browsing this forum: No registered users and 2 guests