Previous Thread  Next Thread

chat icon Number of indices for a face

damix

Posted: Wed May 23, 2012 7:00 am
Joined: 07 Dec 2011
Posts: 21
Hi everybody, I'm not sure this is the right place to report this. However I was browsing the documentation of bpy.types.MeshPolygon and I found the following. I think the the number 3 is not correct, since there may be more than 3 vertices.

vertices
Vertex indices

Type : int array of 3 items in [0, inf], default (0, 0, 0)

I'll be happy to report this in the appropriate forum or wiki if it is really an error.

Thank you for all your work on this amazing software.

Dario "damix" D'Amico
Reply with quote


ldo

Posted: Wed May 23, 2012 10:19 am
Joined: 07 Nov 2010
Posts: 544
Yup:

Code:
>>> list(bpy.data.meshes["Cube"].polygons[0].vertices)
[4, 5, 1, 0]


I don’t think any of the Blender developers read these forums, to be honest. Not sure if this is a code bug; perhaps documentation corrections should be mentioned in the “Foundation and Websites” forum.
Reply with quote


ideasman

Posted: Wed May 23, 2012 7:01 pm
Joined: 25 Feb 2003
Posts: 998
They are vertex index values.

Code:

me = bpy.data.meshes["Cube"]
for v_index in me.polygons[0].vertices:
    print(me.vertices[v_index].co)
Reply with quote


CoDEmanX

Posted: Wed May 23, 2012 8:37 pm
Joined: 05 Apr 2009
Posts: 693
it's not a real docu error, as property list get generated automatically from .c scripts (makesrna.exe?)

Polygon.vertices is initialized as 3 element RNA array, but flagged to be dynamical. The generator doesn't seem to take this flag into account.
_________________
I'm sitting, waiting, wishing, building Blender in superstition...
Reply with quote


damix

Posted: Thu May 24, 2012 7:36 am
Joined: 07 Dec 2011
Posts: 21
Thank you for checking!
Reply with quote


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