Measure script (Blender 2.5x and newer)

The same happens under WinXP, tested with couple builds - latest r30586 from LoopDuplicate.
Only CPU usage jumps to 25% when hovering over input fields in prop. panel.
Both my systems have no Python3, so B25 uses its own, bundled version.
Another thing is wrong drawing blue measure line when in quad view. Line is copied from right-top subwindow to tree others - is it possible to correct it?
Thanks anyway for great script.
PS. Recently I had to change my graphic card ( a month ago or so ) and I remember those strange lines were displayed on my old config too, so I guess it’s not hardware related bug.

Just to be sure, which script are you using?
The one bundled with Blender 2.5 or the one you can download here? (I didn’t sync this one up with the bundled one for some time).

Pontiac

It’s bundled version 0.7.
And more info:

  • when Blender starts with script enabled - no lines and problem appears when I disable and enable again ANY script from UP, so it may be OpenGL related ( Blender internal bug ?)
  • lines are joining exactly in the middle of 3dView like those when window is set to quad-view ( it looks like border of top-right quarter).
    Your script is running endless loop.I looked into it and set printed messages in some places to see what is going on and when I hover mouse over buttons, console is scrolling whole bunch of my messages. I’m not sure but can it lock tool tips?.
    And one more, when script tab is closed and I check button to see measure line nothing happens until 3dView move.

The script is in the Blender 2.5 beta. (2.53)
It is fully working.

@Meta-Androcto:
Yes it’s running and doing what it’s supposed to do but I have some side effects described earlier.
Do you have tool tips popping up while script is running and you hover mouse over buttons in Properties panel?
I’ve tried official 2.53 and newer builds under Karmic and WinXP and effects are the same.
After Sunday I will try on other machines/config.

Works for me.
I saved my user prefs with the measure script enabled and it draws the lines on startup.

Confirmed.
I’ll look into this.
Note: In quad-view only the real 3D view is updated correctly.
The other 3 views are compeltly wrong.

Not sure what you mean here?
I can con

Endless loop -> That’s how scripts like this work. Not much I can do there (unless there is some obvious optimization I can apply).

Confirmed (also the other way around)
I thought Blender refreshes the view when one clicks a panel button like this (as is done when the tab is open).
I’ll see if i can fix this on teh script-side.

Confirmed.
I’m not sure what causes this, but I guess my script is somehow blocking (replacing) the tooltip drawing code?

Confirmed. I also think the two issues are related.
No idea what is going on here, the mechanics behind this are not obvious to me.

Known issue, some sort of problem with (my?) OpenGL drawing code.
I already searched for a solution quite a some time, but didn’t really find the cause to begin with :-/

Known issue again, but I’m not yet sure how to fix that.
Basically this disables the panel, but not the OpenGL drawing function that drawns the lines.

Hello,

I just added the X, Y and Z distance from each measurement aswell. If you find it nice, maybe you could implement this on the default measure addon?

http://data.fuskbugg.se/skalman01/space_view3d_panel_measure_delux.py

Thanks for a very good addon!!!

@warpi: Thanks for the patch.
I’ve modified it a bit to make text formatting easier.

@emu: Sorry for answering so late.
I didn’t yet read your volume patch, but it sounds promising.
Didn’t have the time to check&include it yet though.
What happens in the code of the volume is mesh is not “clean”?
Is there some way to tell the user that?

################
Anyway, here’s a small update (for the thread) on what is in trunk right now:
Version 0.7.3 of the script is now available

Version 0.7.3

  • Added display of delta x/y/z value in 3d view.

  • Inspired by warpi’s patch.

  • Also added display of dx,dy,dz lines

  • Changed the “dist” colors to something not already used by x/y/z axes.
    Version 0.7.2 & 0.7.1

  • Various API fixes
    Version 0.7

  • Initial support for drawing lines. (Thanks to Algorith for applying my perspective_matrix patch.)

  • The distance value (in BUs) is also drawn in the 3D view now.

  • Also fixed some wrong calculations of global/local distances. Now it’s really “what you see is what is calculated”.

  • Use “3D View” in category & name

  • Active object is only used for edit-mode now. Measurement with exactly one sel. (but not necessarily active) object now gets the obj via the sel-object array.

  • API change Mathutils -> mathutils (r557)

  • Deselecting 1 of 2 objects now works correctly (active object is ignored).

  • Force a redraw of the area so disabling the “measure_panel_draw” checkbox will clear the line/text.

  • You can now add the script file in your .blender/scripts/addons/ directory and then enable/disable it in the User Preferences under Add-Ons.

Version 0.6.4

  • Fixed unneeded meshdata duplication (sometimes crashes Blender).
  • The script now correctly calculated the surface area (faceAreaGlobal) of scaled meshes.

See the [http://blenderartists.org/forum/showthread.php?t=177800"]original post](http://[URL) for the download links.

Hello Pontiac,

very nice! I just tried the addon version v0.7.3.1 through the following releases

2.53.1~beta1~svn30816-lucid~ppa1 (https://launchpad.net/~philip5/+archive/extra)
2.53.1+svn30847~lucid1 (https://launchpad.net/~cheleb/+archive/blender-svn)

On the 30816 release it worked great, but on the 30847, activating the script made the navigation not work properly and blender almost hang itself. Maybe this is a temporarly development issue with Blender but will probably find that out.

How did you update the measure script in to central blender development and who does update the http://wiki.blender.org/index.php/Extensions:2.5/Py/Scripts/3D_interaction/Panel_Measure

Just check this, the problem is stil there in most recent svn revision (30890).
Not sure what is wrong here, it certainly did work fine at the time I created the v0.7.3.xx version.

EDIT: I investigated further and found out that revision 30835 of blender trunk causes the issue.
Not sure if it’s a bug in the commit or my script yet.
EDIT2: Just tested reverting that change (“svn merge -r30835:30834 .”). That fixes the issue, but I still don’t know what causes it.

I have access to the seperate “extensions” source repository. This is used to add contributed scripts to the main package of Blender.
I updated the wiki page to reflect the new script version.

Interesting,

As of what Ive seen so far, Blender seems like to best alternative for open source mechanical work, so Im very interested in trying to make it more suitable for this. With this measure tool, it just got 100% better :slight_smile:

That’s why I coded this script. (I still miss some sort of real CSG support, that would be awesome, but unlikely ;-))

BTW: “open source mechanical work” … Have a look at FreeCAD, it was pretty usable the last time I played with it. Must’ve improved quite a bit since.

Cheers,
Martin

Version 0.7.4 of the script is now available
I tried this with the most recent blender version from svn and it worked for me.
EDIT: Tooltips should now work again as well as far as I can see.

Version 0.7.4

  • Fixed the add_modal_handler and callback_add code.

See the [http://http://blenderartists.org/forum/showthread.php?t=177800"]original post](http://[URL) for the download links.

Yes, CSG would be nice. I have used solidworks, proengineer and other solid modulating applications, but in one way, I like the raw feeling of blender using vertices, faces etc.

But what is needed when drawing with these is that there is pleanty of tools to measure, automaticly select vertices, faces and create faces in a nice manner etc…

I tried the latest version 0.10 some days ago and it is promising, but there was a lot of features that is needed that i didnt find or didnt exist, such as sketching with constraints and beeing able to change these after an extrusion.

EDIT:

I just tested the 0.7.4 script with blender 2.53.1 r30878 (from https://launchpad.net/~cheleb/+archive/blender-svn) and it behaved still very strange, but maybe I dont have the most recent version.

Part of this is being worked on (search for “sketcher” on their development pages).
And it is one of their goals to reach functionality like this IIRC.

Anyway, I tested 0.7.4 with 30902 and it works fine for me.
Gotta hurry now to catch my bus. Will check again later.

EDIT: Dammit, on my Linux machine the lagging is still there and I also see the gray lines in the middle :-/

Cheers,
Martin

Yep, saw that as well, they have very nice goals which seems very promising.

Tested 30904 just now and they lag and the gray lines is there. I wonder what causes this? Im running at 64-bit ubuntu.

There are an old project related to mechanical.
Mechanical Blender

You can view some info here:

http://vimeo.com/6321556
https://projects.blender.org/projects/mechanicblender

Yes, I know :slight_smile: Is this the only mechanical related project when talking about Blender?

I fixed the freezing and drawing issues for now, should run fine everywhere again.

space_view3d_panel_measure.py (v0.7.4) and blender 2.53.1 (r30915) is now working perfect!