[Bf-extensions-cvs] [252f465c] master: initial commit np station: T50832
meta-androcto
noreply at git.blender.org
Sun Apr 23 05:50:41 CEST 2017
Commit: 252f465ccb5533e3b60f90c0a0408e2482bcfbbb
Author: meta-androcto
Date: Sun Apr 23 13:50:10 2017 +1000
Branches: master
https://developer.blender.org/rBAC252f465ccb5533e3b60f90c0a0408e2482bcfbbb
initial commit np station: T50832
===================================================================
A np_station/__init__.py
A np_station/np_float_box.py
A np_station/np_float_poly.py
A np_station/np_float_rectangle.py
A np_station/np_point_align.py
A np_station/np_point_array.py
A np_station/np_point_copy.py
A np_station/np_point_dimension.py
A np_station/np_point_distance.py
A np_station/np_point_instance.py
A np_station/np_point_move.py
A np_station/np_point_scale.py
A np_station/np_roto_move.py
A np_station/np_shader_brush.py
A np_station/utils_function.py
A np_station/utils_geometry.py
A np_station/utils_graphics.py
===================================================================
diff --git a/np_station/__init__.py b/np_station/__init__.py
new file mode 100644
index 00000000..1db8a481
--- /dev/null
+++ b/np_station/__init__.py
@@ -0,0 +1,965 @@
+### 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 3
+# 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, see <http://www.gnu.org/licenses/>.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# Many thanks to Blender Artists, Mano Wii and Elegant Artz
+
+bl_info = {
+ 'name': 'NP Station',
+ 'author': 'Okavango with the help of Blenderartists community',
+ 'version': (0, 2, 0),
+ 'blender': (2, 78, 0),
+ 'location': 'View3D > Toolshelf > Tools tab',
+ 'warning': '',
+ 'description': 'Set of utilities for CAD-like precision modeling',
+ 'wiki_url': 'https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/NP_Station',
+ 'category': '3D View'}
+
+if 'bpy' in locals():
+ import imp
+ imp.reload(np_point_move)
+ imp.reload(np_point_copy)
+ imp.reload(np_point_instance)
+ imp.reload(np_point_array)
+ imp.reload(np_roto_move)
+ imp.reload(np_point_scale)
+ imp.reload(np_float_rectangle)
+ imp.reload(np_float_box)
+ imp.reload(np_point_align)
+ imp.reload(np_point_distance)
+ imp.reload(np_float_poly)
+ imp.reload(np_shader_brush)
+
+else:
+ from . import np_point_move
+ from . import np_point_copy
+ from . import np_point_instance
+ from . import np_point_array
+ from . import np_roto_move
+ from . import np_point_scale
+ from . import np_float_rectangle
+ from . import np_float_box
+ from . import np_point_align
+ from . import np_point_distance
+ from . import np_float_poly
+ from . import np_shader_brush
+
+import bpy
+
+
+# Defining the class that will make a NP tab panel in the tool shelf with the operator buttons:
+
+class NP020BasePanel(bpy.types.Panel):
+ # Creates a panel in the 3d view Toolshelf window
+ bl_label = 'NP Station'
+ bl_idname = 'NP_PT_020_base_panel'
+ bl_space_type = 'VIEW_3D'
+ bl_region_type = 'TOOLS'
+ bl_context = 'objectmode'
+ bl_category = 'Tools'
+
+ def draw(self, context):
+ layout = self.layout
+
+ row = self.layout.row(True)
+ col = row.column(True)
+ col.label(" Create:",icon = "MESH_CUBE")
+ col.separator()
+ col.operator('object.np_020_float_poly', icon='MESH_DATA', text='float_poly')
+ col.operator('object.np_020_float_rectangle', icon='MESH_PLANE', text='float_rectangle')
+ col.operator('object.np_020_float_box', icon='MESH_CUBE', text='float_box')
+
+ self.layout.separator()
+ row = self.layout.row(True)
+ col = row.column(True)
+ col.label(" Modify:",icon = "MODIFIER")
+ col.separator()
+ col.operator('object.np_020_point_move', icon='MAN_TRANS', text='point_move')
+ col.operator('object.np_020_point_copy', icon='ROTACTIVE', text='point_copy')
+ col.operator('object.np_020_point_instance', icon='ROTATECOLLECTION', text='point_instance')
+ col.operator('object.np_020_point_array', icon='MOD_ARRAY', text='point_array')
+ col.operator('object.np_020_roto_move', icon='MAN_ROT', text='roto_move')
+ col.operator('object.np_020_point_scale', icon='MAN_SCALE', text='point_scale')
+ col.operator('object.np_020_point_align', icon='ORTHO', text='point_align')
+
+
+ self.layout.separator()
+ row = self.layout.row(True)
+ col = row.column(True)
+ col.label(" Transfer:",icon = 'BRUSH_DATA')
+ col.separator()
+ col.operator('object.np_020_shader_brush', icon='MOD_DYNAMICPAINT', text='shader_brush')
+
+
+ self.layout.separator()
+ row = self.layout.row(True)
+ col = row.column(True)
+ col.label(" Measure:",icon = "ALIGN")
+ col.separator()
+ col.operator('object.np_020_point_distance', icon='ARROW_LEFTRIGHT', text='point_distance')
+
+
+##########################################################################################
+
+
+# Add-ons Preferences Update Panel
+
+# Define Panel classes for updating
+panels = [
+ NP020BasePanel,
+ ]
+
+
+def update_panel(self, context):
+ message = "Bool Tool: Updating Panel locations has failed"
+ try:
+ for panel in panels:
+ if "bl_rna" in panel.__dict__:
+ bpy.utils.unregister_class(panel)
+
+ for panel in panels:
+ panel.bl_category = context.user_preferences.addons[__package__].preferences.category
+ bpy.utils.register_class(panel)
+
+ except Exception as e:
+ print("\n[{}]\n{}\n\nError:\n{}".format(__package__, message, e))
+ pass
+
+
+
+# Defining the settings in the addons tab:
+
+class NP020Preferences(bpy.types.AddonPreferences):
+ # This must match the addon name, use '__package__' when defining this in a submodule of a python package.
+
+ bl_idname = __name__
+
+
+ category = bpy.props.StringProperty(
+ name="",
+ description="Choose a name for the category of the panel",
+ default="Tools",
+ update=update_panel,
+ )
+
+#----------------------------------------------------------------------------------------
+
+
+ np_col_scheme = bpy.props.EnumProperty(
+ name ='',
+ items = (
+ ('csc_default_grey', 'Blender_Default_NP_GREY',''),
+ ('csc_school_marine', 'NP_school_paper_NP_MARINE','')),
+ default = 'csc_default_grey',
+ description = 'Choose the overall addon color scheme, according to your current Blender theme')
+
+ np_size_num = bpy.props.FloatProperty(
+ name='',
+ description='Size of the numerics that display on-screen dimensions, the default is 18',
+ default=18,
+ min=10,
+ max=30,
+ step=100,
+ precision=0)
+
+ np_scale_dist = bpy.props.FloatProperty(
+ name='',
+ description='Distance multiplier (for example, for cm use 100)',
+ default=100,
+ min=0,
+ step=100,
+ precision=2)
+
+ np_suffix_dist = bpy.props.EnumProperty(
+ name='',
+ items=(("'", "'", ''), ('"', '"', ''), ('thou', 'thou', ''),
+ ('km', 'km', ''), ('m', 'm', ''), ('cm', 'cm', ''),
+ ('mm', 'mm', ''), ('nm', 'nm', ''), ('None', 'None', '')),
+ default='cm',
+ description='Add a unit extension after the numerical distance ')
+
+ np_display_badge = bpy.props.BoolProperty(
+ name='Display badge',
+ description='Use the graphical badge near the mouse cursor',
+ default=True)
+
+ np_size_badge = bpy.props.FloatProperty(
+ name='badge_size',
+ description='Size of the mouse badge, the default is 2.0',
+ default=2,
+ min=0.5,
+ step=10,
+ precision=1)
+
+
+ op_prefs = bpy.props.EnumProperty(
+ name ='Individual operator settings',
+ items = (
+ ('nppd', 'NP Point Distance',''),
+ ('npsb', 'NP Shader Brush',''),
+ ('nppl', 'NP Point Align',''),
+ ('npps', 'NP Point Scale',''),
+ ('nprm', 'NP Roto Move',''),
+ ('nppa', 'NP Point Array',''),
+ ('nppi', 'NP Point Instance',''),
+ ('nppc', 'NP Point Copy',''),
+ ('nppm', 'NP Point Move',''),
+ ('npfr', 'NP Float Box',''),
+ ('npfr', 'NP Float Rectangle',''),
+ ('npfp', 'NP Float Poly','')),
+ default = 'npfp',
+ description = 'Choose which settings would you like to access')
+
+
+#----------------------------------------------------------------------------------------
+#----------------------------------------------------------------------------------------
+
+ '''
+ nppc_dist_scale = bpy.props.FloatProperty(
+ name='Unit scale',
+ description='Distance multiplier (for example, for cm use 100)',
+ default=100,
+ min=0,
+ step=1,
+ precision=3)
+
+ nppc_suffix = bpy.props.EnumProperty(
+ name='Unit suffix',
+ items=(("'","'",''), ('"','"',''), ('thou','thou',''), ('km','km',''), ('m','m',''), ('cm','cm',''), ('mm','mm',''), ('nm','nm',''), ('None','None','')),
+ default='cm',
+ description='Add a unit extension after the numerical distance ')
+
+ nppc_badge = bpy.props.BoolProperty(
+ name='Mouse badge',
+ description='Use the graphical badge near the mouse cursor',
+ default=True)
+
+ nppc_badge_size = bpy.props.FloatProperty(
+ name='size',
+ description='Size of the mouse badge, the default is 2.0',
+ default=2,
+ min=0.5,
+ step=10,
+ precision=1)
+
+ nppc_col_line_main_DEF = bpy.props.BoolProperty(
+ name='Default',
+ description='Use the default color',
+ default=True)
+
+ nppc_col_line_shadow_DEF = bpy.props.BoolProperty(
+ name='Default',
+ description='Use the default color',
+ default=True)
+
+ nppc_col_num_main_DEF = bpy.props.BoolProperty(
+ name='Default',
+ description='Use the default color',
+ default=True)
+
+ nppc_col_num_shadow_DEF = bpy.props.BoolProperty(
+ name='Default',
+ description='Use the default color',
+ default=True)
+
+ nppc_col_line_main = bpy.props.FloatVectorProperty(name='', default=(1.0, 1.0, 1.0, 1.0), size=4, subtype="COLOR", min=0, max=1,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list