[Bf-extensions-cvs] [f8e239c5] master: Remove: space_view3d_panel_measure: unsupported: T63750

meta-androcto noreply at git.blender.org
Sun Apr 21 06:47:36 CEST 2019


Commit: f8e239c5a3be83e01cea1b7e2354968be81cb068
Author: meta-androcto
Date:   Sun Apr 21 14:47:17 2019 +1000
Branches: master
https://developer.blender.org/rBACf8e239c5a3be83e01cea1b7e2354968be81cb068

Remove: space_view3d_panel_measure: unsupported: T63750

===================================================================

D	space_view3d_panel_measure.py

===================================================================

diff --git a/space_view3d_panel_measure.py b/space_view3d_panel_measure.py
deleted file mode 100644
index 7cde227c..00000000
--- a/space_view3d_panel_measure.py
+++ /dev/null
@@ -1,1588 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-#
-# Uses volume calculation and manifold check code (GPL2+) from:
-# http://www.shapeways.com/forum/index.php?t=msg&goto=3639
-# Shapeways Volume Calculator by Benjamin Lauritzen (Loonsbury)
-#
-# #################################
-
-bl_info = {
-    "name": "Measure Panel",
-    "author": "Buerbaum Martin (Pontiac), TNae (Normal patch), "
-              "Benjamin Lauritzen (Loonsbury; Volume code), "
-              "Alessandro Sala (patch: Units in 3D View), "
-              "Daniel Ashby (callback removal code) ",
-    "version": (0, 9, 1),
-    "blender": (2, 74, 0),
-    "location": "View3D > Properties > Measure Panel",
-    "description": "Measure distances between objects",
-    "warning": "Disable during Render. Broken register",
-    "tracker_url": "https://developer.blender.org/maniphest/task/edit/form/2/",
-    "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
-                "Scripts/3D_interaction/Panel_Measure",
-    "category": "3D View",
-}
-
-"""
-Measure panel
-
-This script displays in OBJECT MODE:
-* The distance of the 3D cursor to the origin of the
-  3D space (if NOTHING is selected).
-* The distance of the 3D cursor to the center of an object
-  (if exactly ONE object is selected).
-* The distance between 2 object centers
-  (if exactly TWO objects are selected).
-* The surface area of any selected mesh object.
-* The average normal of the mesh surface of any selected mesh object.
-* The volume of any selected mesh object.
-
-Display in EDIT MODE (Local and Global space supported):
-* The distance of the 3D cursor to the origin
-  (in Local space it is the object center instead).
-* The distance of the 3D cursor to a selected vertex.
-* The distance between 2 selected vertices.
-
-Usage:
-
-This functionality can be accessed via the
-"Properties" panel in 3D View ([N] key).
-
-It's very helpful to use one or two "Empty" objects with
-"Snap during transform" enabled for fast measurement.
-
-More links:
-http://gitorious.org/blender-scripts/blender-measure-panel-script
-http://blenderartists.org/forum/showthread.php?t=177800
-"""
-
-import bpy
-from bpy.props import *
-from bpy.app.handlers import persistent
-from mathutils import Vector, Matrix
-import bgl
-import blf
-from bpy_extras.view3d_utils import location_3d_to_region_2d
-from bpy_extras.mesh_utils import ngon_tessellate
-
-
-# Precicion for display of float values.
-PRECISION = 5
-
-# Name of the custom properties as stored in the scene.
-COLOR_LOCAL = (1.0, 0.5, 0.0, 0.8)
-COLOR_GLOBAL = (0.5, 0.0, 1.0, 0.8)
-
-# 3D View - text offset
-OFFSET_LINE = 10   # Offset the text a bit to the right.
-OFFSET_Y = 15      # Offset of the lines.
-OFFSET_VALUE = 30  # Offset of value(s) from the text.
-
-# 3D View - line width
-LINE_WIDTH_XYZ = 1
-LINE_WIDTH_DIST = 2
-
-
-# Returns a tuple describing the current measuring system
-# and formatting options.
-# Returned data is meant to be passed to formatDistance().
-# Original by Alessandro Sala (Feb, 12th 2012)
-# Update by Alessandro Sala (Dec, 18th 2012)
-def getUnitsInfo():
-        scale = bpy.context.scene.unit_settings.scale_length
-        unit_system = bpy.context.scene.unit_settings.system
-        separate_units = bpy.context.scene.unit_settings.use_separate
-        if unit_system == 'METRIC':
-                scale_steps = ((1000, 'km'), (1, 'm'), (1 / 100, 'cm'),
-                    (1 / 1000, 'mm'), (1 / 1000000, '\u00b5m'))
-        elif unit_system == 'IMPERIAL':
-                scale_steps = ((5280, 'mi'), (1, '\''),
-                    (1 / 12, '"'), (1 / 12000, 'thou'))
-                scale /= 0.3048  # BU to feet
-        else:
-                scale_steps = ((1, ' BU'),)
-                separate_units = False
-
-        return (scale, scale_steps, separate_units)
-
-
-# Converts a distance from BU into the measuring system
-# described by units_info.
-# Original by Alessandro Sala (Feb, 12th 2012)
-# Update by Alessandro Sala (Dec, 18th 2012)
-def convertDistance(val, units_info):
-        scale, scale_steps, separate_units = units_info
-        sval = val * scale
-        idx = 0
-        while idx < len(scale_steps) - 1:
-                if sval >= scale_steps[idx][0]:
-                        break
-                idx += 1
-        factor, suffix = scale_steps[idx]
-        sval /= factor
-        if not separate_units or idx == len(scale_steps) - 1:
-                dval = str(round(sval, PRECISION)) + suffix
-        else:
-                ival = int(sval)
-                dval = str(round(ival, PRECISION)) + suffix
-                fval = sval - ival
-                idx += 1
-                while idx < len(scale_steps):
-                        fval *= scale_steps[idx - 1][0] / scale_steps[idx][0]
-                        if fval >= 1:
-                                dval += ' ' \
-                                    + ("%.1f" % fval) \
-                                    + scale_steps[idx][1]
-                                break
-                        idx += 1
-
-        return dval
-
-
-# Returns a single selected object.
-# Returns None if more than one (or nothing) is selected.
-# Note: Ignores the active object.
-def getSingleObject():
-    if len(bpy.context.selected_objects) == 1:
-        return bpy.context.selected_objects[0]
-
-    return None
-
-
-# Returns a list with 2 3D points (Vector) and a color (RGBA)
-# depending on the current view mode and the selection.
-def getMeasurePoints(context):
-    sce = context.scene
-    mode = context.mode
-
-    # Get a single selected object (or nothing).
-    obj = getSingleObject()
-
-    if mode == 'EDIT_MESH':
-        obj = context.active_object
-
-        if obj and obj.type == 'MESH' and obj.data:
-            # Get mesh data from Object.
-            mesh = obj.data
-
-            # Get the selected vertices.
-            # @todo: Better (more efficient) way to do this?
-            verts_selected = [v for v in mesh.vertices if v.select == 1]
-
-            if len(verts_selected) == 0:
-                # Nothing selected.
-                # We measure the distance from...
-                # local  ... the object center to the 3D cursor.
-                # global ... the origin to the 3D cursor.
-                cur_loc = sce.cursor.location
-                obj_loc = obj.matrix_world.to_translation()
-
-                # Convert to local space, if needed.
-                if measureLocal(sce):
-                    p1 = cur_loc
-                    p2 = obj_loc
-                    return (p1, p2, COLOR_GLOBAL)
-
-                else:
-                    p1 = Vector((0.0, 0.0, 0.0))
-                    p2 = cur_loc
-                    return (p1, p2, COLOR_GLOBAL)
-
-            elif len(verts_selected) == 1:
-                # One vertex selected.
-                # We measure the distance from the
-                # selected vertex object to the 3D cursor.
-                cur_loc = sce.cursor.location
-                vert_loc = verts_selected[0].co.copy()
-
-                # Convert to local or global space.
-                if measureLocal(sce):
-                    p1 = vert_loc
-                    p2 = cur_loc
-                    return (p1, p2, COLOR_LOCAL)
-
-                else:
-                    p1 = obj.matrix_world * vert_loc
-                    p2 = cur_loc
-                    return (p1, p2, COLOR_GLOBAL)
-
-            elif len(verts_selected) == 2:
-                # Two vertices selected.
-                # We measure the distance between the
-                # two selected vertices.
-                obj_loc = obj.matrix_world.to_translation()
-                vert1_loc = verts_selected[0].co.copy()
-                vert2_loc = verts_selected[1].co.copy()
-
-                # Convert to local or global space.
-                if measureLocal(sce):
-                    p1 = vert1_loc
-                    p2 = vert2_loc
-                    return (p1, p2, COLOR_LOCAL)
-
-                else:
-                    p1 = obj.matrix_world * vert1_loc
-                    p2 = obj.matrix_world * vert2_loc
-                    return (p1, p2, COLOR_GLOBAL)
-
-            else:
-                return None
-
-    elif mode == 'OBJECT':
-        # We are working in object mode.
-
-        if len(context.selected_objects) > 2:
-            return None
-        elif len(context.selected_objects) == 2:
-            # 2 objects selected.
-            # We measure the distance between the 2 selected objects.
-            obj1, obj2 = context.selected_objects
-            obj1_loc = obj1.matrix_world.to_translation()
-            obj2_loc = obj2.matrix_world.to_translation()
-            return (obj1_loc, obj2_loc, COLOR_GLOBAL)
-
-        elif obj:
-            # One object selected.
-            # We measure the distance from the object to the 3D cursor.
-            cur_loc = sce.cursor.location
-            obj_loc = obj.matrix_world.to_translation()
-            return (obj_loc, cur_loc, COLOR_GLOBAL)
-
-        elif not context.selected_objects:
-            # Nothing selected.
-            # We measure the distance from the origin to the 3D cursor.
-            p1 = Vector((0.0, 0.0, 0.0))
-       

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list