Previous Thread  Next Thread

chat icon Creating a Text "label" on the model in Python

TheModerator

Posted: Wed Aug 01, 2012 11:23 am
Joined: 01 Aug 2012
Posts: 1
Okay, So I'm a python n00b, but I have programming experience in 4 other languages, and am picking up the python language quickly.

As an exercise, I want to label all the 'verts in a mesh with their respective lengths in blender units. by "label", I mean, some text that appears at a defined xyz coordinate that is always facing the viewer, regardless of rotation, In a similar way to rendering particles as "Number"

I've got the for-each script for running through all the vertices in a mesh, but am struggling to find any way of putting this text "label" in the viewport

Can anyone help me by way of example code?

Thanks so much to anyone who's read this, and especially to people who can help me!!! Thanks!
Reply with quote


CoDEmanX

Posted: Wed Aug 01, 2012 8:55 pm
Joined: 05 Apr 2009
Posts: 680
such a feature already exists, see N panel in 3d viewport, under Mesh Display (in edit mode), Numerics: Edge Length

to draw stuff in viewport like this, you gotta use OpenGL, see bgl module in blender python docs
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group