[Bf-extensions-cvs] [ec4195e] temp-camera-rigs-advanced: Initial commit for T43509

Campbell Barton noreply at git.blender.org
Fri Mar 20 04:29:26 CET 2015


Commit: ec4195e4f00e9a0d6a403e25f0b570acc6a67ec6
Author: Campbell Barton
Date:   Fri Mar 20 14:26:43 2015 +1100
Branches: temp-camera-rigs-advanced
https://developer.blender.org/rBACec4195e4f00e9a0d6a403e25f0b570acc6a67ec6

Initial commit for T43509

by @johnroper100 - temp branch for review/improvements

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

A	object_camera_rig_advanced/__init__.py

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

diff --git a/object_camera_rig_advanced/__init__.py b/object_camera_rig_advanced/__init__.py
new file mode 100644
index 0000000..4495a5a
--- /dev/null
+++ b/object_camera_rig_advanced/__init__.py
@@ -0,0 +1,754 @@
+# ##### 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 #####
+
+# <pep8 compliant>
+
+# This is based on the camera rigs addon by Wayne Dixon and Kris Wittig #
+
+bl_info = {
+    "name": "Advanced Camera Rigs",
+    "author": "John Roper",
+    "version": (15, 0,),
+    "blender": (2, 73, 0),
+    "location": "Add > Armature",
+    "description": "Adds advanced camera rigs",
+    "warning": "Autorun Python Scripts must be enabled.",
+    "wiki_url": "http://www.starlightgraphics.co.nf/software/documentation/advanced_camera_rigs.php",
+    "category": "Rigging",
+}
+
+
+import bpy
+import math
+import mathutils
+from math import pi
+from math import *
+from bpy.props import *
+from bpy.props import FloatVectorProperty
+from bpy.types import Operator
+from rna_prop_ui import rna_idprop_ui_prop_get
+from math import radians
+from mathutils import Vector
+
+
+###############################################
+# define the functions to build the Widgets   #
+###############################################
+
+
+def create_widget(self, name):
+    """ Creates an empty widget object for a bone, and returns the object."""
+    obj_name = "WDGT_" + name
+    scene = bpy.context.scene
+
+    # Check if it already exists
+    if obj_name in scene.objects:
+        return None
+    else:
+        mesh = bpy.data.meshes.new(obj_name)
+        obj = bpy.data.objects.new(obj_name, mesh)
+        scene.objects.link(obj)
+
+        # this will put the Widget objects out of the way on layer 19
+        WDGT_layers = (False, False, False, False, False, False, False, False, False, True, False, False, False, False, False, False, False, False, False, False)
+        obj.layers = WDGT_layers
+
+        return obj
+
+
+def create_root_widget(self, name):
+    # Creates a compass-shaped widget.
+
+    obj = create_widget(self, name)
+    if obj != None:
+        verts = [(0.2102552056312561, -0.0012103617191314697, 0.21025514602661133), (0.11378927528858185, -0.001210339367389679, 0.274711549282074), (-3.070153553608179e-08, -0.0012103626504540443, 0.29734566807746887), (-0.11378933489322662, -0.0012103542685508728, 0.27471157908439636), (-0.2102552056312561, -0.0012103617191314697, 0.21025516092777252), (-0.27471160888671875, -0.0012103617191314697, 0.11378928273916245), (-0.29734569787979126, -0.0012103617191314697, -1.6809221392577456 [...]
+        edges = [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (7, 8), (0, 8), (10, 11), (9, 12), (11, 12), (10, 13), (9, 14), (13, 15), (14, 15), (16, 22), (17, 18), (18, 19), (19, 20), (20, 21), (21, 22), (7, 17), (6, 16), (23, 24), (23, 25), (24, 29), (25, 28), (26, 27), (26, 29), (27, 28), (31, 32), (30, 33), (32, 33), (31, 34), (30, 35), (34, 36), (35, 36), (37, 38), (37, 39), (38, 43), (39, 42), (40, 41), (40, 43), (41, 42)]
+        mesh = obj.data
+        mesh.from_pydata(verts, edges, [])
+        mesh.update()
+
+
+def create_camera_widget(self, name):
+    # Creates a camera ctrl widget.
+
+    obj = create_widget(self, name)
+    if obj != None:
+        verts = [(0.13756819069385529, 1.0706068032106941e-08, -0.13756819069385529), (0.1797415018081665, 5.353034016053471e-09, -0.07445136457681656), (0.19455081224441528, -6.381313819948996e-16, 8.504085435845354e-09), (0.1797415018081665, -5.353034016053471e-09, 0.07445138692855835), (0.13756819069385529, -1.0706068032106941e-08, 0.13756819069385529), (0.07445137947797775, -2.1412136064213882e-08, 0.1797415018081665), (-9.740904971522468e-08, -2.1412136064213882e-08, 0.1945508122444 [...]

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list