Page 1 of 3 123 LastLast
Results 1 to 20 of 53
  1. #1
    Member Crouch's Avatar
    Join Date
    Oct 2004
    Location
    the Netherlands
    Posts
    1,414

    Index Visualiser for Blender 2.5

    There already was an index visualiser for Blender 2.4, but since Campbell added drawing in the 3d-view to 2.5, I ported the old code.
    The script is kept up to date with the latest changes in Blender, so you need a recent build of blender to run it.



    Link
    You can download the script here. (This link automatically points to the most recent version, as the script is now in the contrib section of Blender)

    How to install
    There are two ways to get the script working in your .blend
    Make it available in all blend files:

    1. Put the .py file you downloaded in the folder: .blender/scripts/addons
    2. Open Blender and go to User Preferences --> Add-Ons --> Enable Add-On (Index Visualiser)

    Or just make it available in the blend file you're currently working on:

    1. Open the downloaded script inside Blender text editor
    2. Run the script once (alt+p)

    How to use

    1. Select an object and enter Editmode (tab-key)
    2. Display the properties panel (N-key)
    3. Go to the Mesh Display tab, it helps to fold the tabs above it
    4. Press the 'Visualise indices button'

    About the different buttons:
    Visualise indices - this toggles whether the indices are shown or not (press once to activate, press again to de-activate)
    Vertices / Edges / Faces - determines of which group(s) to show the indices
    Selected only - If toggled, only indices of selected verts/edges/faces are shown

    If you change the mesh (selection) in edit-mode, the indices won't automatically update. You'll have to tab in and out of object mode. This was done to improve the speed of the script.

    Technical explanation
    (outdated as of version 2.1)
    At the start of this post I said I ported the old code, but that isn't true; I had to start from scratch. The main problem was getting the right view matrix. In 2.5 it is possible to draw directly in the opengl scene (POST_VIEW and PRE_VIEW), but the rotation of the text can't be influenced then. It always faces up on the world z-axis.
    The solution is drawing to POST_PIXEL (text always faces out of the screen), but this requires to translate 3d-view coordinates to 2d screen coordinates. In 2.4 you could use Window.GetPerspMatrix() as part of the procedure, but in 2.5 this doesn't exist anymore. So my solution was to get 2 opengl matrices from POST_VIEW, and use them in a second callback that draws in POST_PIXEL.
    All this slows down the script quite a lot, so it's recommended not to have too many indices on the screen. To slightly speed up the script I disabled automatic updating of the selected vertices. So if you change the mesh (selection) in edit-mode, you'll have to tab in and out of objectmode manually, to update the indices. If you wish to have this automatically, you can uncomment lines 36 and 37 in the script.
    Last edited by Crouch; 10-Mar-11 at 09:50.



  2. #2
    Member Loolarge's Avatar
    Join Date
    Aug 2008
    Location
    Illumation, Germany
    Posts
    517
    I think that's most useful for scripting people. Thanks alot, i did not know the 2.4x version. Certainly nice to have!

    Very interesting to see you using BGL! Can it draw images in the 3d view allready, do you know about that? I was not aware the BGL is working in at all yet in 2.5, nice
    Last edited by Loolarge; 01-Mar-10 at 17:31.



  3. #3
    Member Crouch's Avatar
    Join Date
    Oct 2004
    Location
    the Netherlands
    Posts
    1,414
    The reason I rewrote the script is that I need it for other scripts I want to develop, so it's indeed mainly meant for developers. Normal users of Blender really don't have a need for knowing what the index of a vertex is.

    Drawing in the 3d view was only added three days ago (by Campbell in his free time, thanks a lot! ). As far as I know you should be able to draw images as well, but it'll be a bit harder than in 2.4 as you'll have to use native opengl commands (no more shortcuts like Draw.Image() in 2.4).



  4. #4
    thanks for converting this one
    very usefufll when making new object primitive with scripts

    any idea if some of the old functions like you said are going to come back later on!

    i mean 2.5 is supposed to have all of the old features of 2.49 and new ones too!


    nice work
    happy 2.5



  5. #5
    Thank you very much Crouch.



  6. #6



  7. #7
    thank you! this really helps =)

    where is the 2.4x version though?



  8. #8
    Member Crouch's Avatar
    Join Date
    Oct 2004
    Location
    the Netherlands
    Posts
    1,414
    mandoragon: I already linked to it in the first post. Here it is again.

    I've also made a slight change to the script for Blender 2.5, so here is Index Visualiser 2.1.
    It includes a minor speed increase. Written and tested for svn 27407 (it needs a pretty recent build).



  9. #9
    one suggeston here

    can you change the header name for index show or else......

    cause i had problem finding this with the word display

    dipslay word reminds me more of something in otherblender's panel!

    would be easier to find this new panel in N Panel!


    i used it this week to prepare some new primitives

    very usefull tool and esasy to use ounce you find where the anel is located

    Thanks



  10. #10
    Member Crouch's Avatar
    Join Date
    Oct 2004
    Location
    the Netherlands
    Posts
    1,414
    The buttons are actually added to an existing panel (which is called Display), so I can't change the name of the existing panel.
    I'm glad the tool was useful to you though.



  11. #11
    Member Crouch's Avatar
    Join Date
    Oct 2004
    Location
    the Netherlands
    Posts
    1,414
    The script has been in Blender Contrib for some time now. This means that it is kept up to date with all changes in Blender and can even be automatically included when you build Blender yourself.
    Practically this means that you can always find the most recent version of the script, at this link.



  12. #12
    Member PapaSmurf's Avatar
    Join Date
    Sep 2004
    Location
    Southeast USA
    Posts
    8,812
    Fantastico! I have been thinking about CAD and how to possibly like show the angle between two edges selected in 3D view, or the length of an edge, etc. Seeing just the screenshot lets me know it can be done. I love how one idea spawns another.



  13. #13
    Great work here, i'm just learning a lot with all your marvellous scripts !

    Small Improvement: Script doesn't keep in mind weather vertex/edge/face is hidden, so it always show index numbers although you have used "H" key to hide some vertexs.

    line 68 modified: added "not v.hidden" and parenthesis.
    Code:
            for v in me.verts:
                if not v.hidden and (v.selected or not bpy.context.scene.display_sel_only):
                    locs.append([1.0, 1.0, 1.0, v.index, v.co.copy().resize4D()])
    Is there any reason it shouldn't be done?

    Thank you very much for your work !
    PS: English is not my native language, sure you noticed



  14. #14
    Member Crouch's Avatar
    Join Date
    Oct 2004
    Location
    the Netherlands
    Posts
    1,414
    The script has been updated to work correctly with Blender 2.54. It also takes into account if a vertex/edge/face is hidden.

    The most recent version right now is 2.6.3. Download link can be found in the first post.



  15. #15
    sorry but the link in first post seems to be dead ?

    happy 2.5



  16. #16
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    No works perfectly! The link as well as the addon!
    Last edited by PKHG; 15-Sep-10 at 07:26. Reason: correctin of typing error



  17. #17
    ok, i'm going to debug this unless you have a more uptodate version.



  18. #18
    the link in first post is still dead !

    happy 2.5



  19. #19
    Member PKHG's Avatar
    Join Date
    Sep 2009
    Location
    NL
    Posts
    1,928
    No, link to the script is alive ;-)



  20. #20
    well when i click on that link a get a blank WEB page!

    how come?

    Thanks



Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •