[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25246] branches/sculpt25: Sculpt Branch:
Brecht Van Lommel
brecht at blender.org
Wed Dec 9 16:24:55 CET 2009
Revision: 25246
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25246
Author: blendix
Date: 2009-12-09 16:24:55 +0100 (Wed, 09 Dec 2009)
Log Message:
-----------
Sculpt Branch:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r25180:25245
Modified Paths:
--------------
branches/sculpt25/intern/elbeem/CMakeLists.txt
branches/sculpt25/intern/elbeem/SConscript
branches/sculpt25/projectfiles_vc9/blender/editors/ED_editors.vcproj
branches/sculpt25/release/datafiles/blenderbuttons
branches/sculpt25/release/scripts/modules/graphviz_export.py
branches/sculpt25/release/scripts/modules/rigify/__init__.py
branches/sculpt25/release/scripts/modules/rigify/arm.py
branches/sculpt25/release/scripts/modules/rigify/delta.py
branches/sculpt25/release/scripts/modules/rigify/leg.py
branches/sculpt25/release/scripts/modules/rigify/neck.py
branches/sculpt25/release/scripts/modules/rigify/palm.py
branches/sculpt25/release/scripts/modules/rigify/spine.py
branches/sculpt25/release/scripts/modules/rna_prop_ui.py
branches/sculpt25/release/scripts/ui/space_graph.py
branches/sculpt25/release/scripts/ui/space_info.py
branches/sculpt25/release/scripts/ui/space_sequencer.py
branches/sculpt25/release/scripts/ui/space_userpref.py
branches/sculpt25/release/scripts/ui/space_view3d.py
branches/sculpt25/source/blender/blenkernel/BKE_modifier.h
branches/sculpt25/source/blender/blenkernel/BKE_sequence.h
branches/sculpt25/source/blender/blenkernel/BKE_sound.h
branches/sculpt25/source/blender/blenkernel/intern/DerivedMesh.c
branches/sculpt25/source/blender/blenkernel/intern/fcurve.c
branches/sculpt25/source/blender/blenkernel/intern/group.c
branches/sculpt25/source/blender/blenkernel/intern/modifier.c
branches/sculpt25/source/blender/blenkernel/intern/object.c
branches/sculpt25/source/blender/blenkernel/intern/sequence.c
branches/sculpt25/source/blender/blenkernel/intern/sound.c
branches/sculpt25/source/blender/blenloader/intern/readfile.c
branches/sculpt25/source/blender/blenloader/intern/writefile.c
branches/sculpt25/source/blender/editors/animation/anim_deps.c
branches/sculpt25/source/blender/editors/animation/keyframes_draw.c
branches/sculpt25/source/blender/editors/datafiles/blenderbuttons.c
branches/sculpt25/source/blender/editors/include/ED_anim_api.h
branches/sculpt25/source/blender/editors/include/ED_armature.h
branches/sculpt25/source/blender/editors/include/ED_screen.h
branches/sculpt25/source/blender/editors/include/UI_icons.h
branches/sculpt25/source/blender/editors/interface/interface_handlers.c
branches/sculpt25/source/blender/editors/interface/resources.c
branches/sculpt25/source/blender/editors/screen/area.c
branches/sculpt25/source/blender/editors/screen/screen_edit.c
branches/sculpt25/source/blender/editors/screen/screen_ops.c
branches/sculpt25/source/blender/editors/space_action/space_action.c
branches/sculpt25/source/blender/editors/space_console/console_ops.c
branches/sculpt25/source/blender/editors/space_file/file_ops.c
branches/sculpt25/source/blender/editors/space_image/space_image.c
branches/sculpt25/source/blender/editors/space_nla/space_nla.c
branches/sculpt25/source/blender/editors/space_node/node_edit.c
branches/sculpt25/source/blender/editors/space_sequencer/sequencer_add.c
branches/sculpt25/source/blender/editors/space_sequencer/sequencer_edit.c
branches/sculpt25/source/blender/editors/space_sequencer/sequencer_select.c
branches/sculpt25/source/blender/editors/space_sequencer/space_sequencer.c
branches/sculpt25/source/blender/editors/space_text/text_ops.c
branches/sculpt25/source/blender/editors/space_view3d/drawobject.c
branches/sculpt25/source/blender/editors/space_view3d/view3d_draw.c
branches/sculpt25/source/blender/editors/space_view3d/view3d_edit.c
branches/sculpt25/source/blender/editors/space_view3d/view3d_ops.c
branches/sculpt25/source/blender/editors/transform/transform_conversions.c
branches/sculpt25/source/blender/editors/transform/transform_generics.c
branches/sculpt25/source/blender/editors/uvedit/uvedit_unwrap_ops.c
branches/sculpt25/source/blender/gpu/intern/gpu_buffers.c
branches/sculpt25/source/blender/gpu/intern/gpu_draw.c
branches/sculpt25/source/blender/imbuf/intern/rectop.c
branches/sculpt25/source/blender/makesdna/DNA_anim_types.h
branches/sculpt25/source/blender/makesdna/DNA_screen_types.h
branches/sculpt25/source/blender/makesdna/DNA_windowmanager_types.h
branches/sculpt25/source/blender/makesrna/RNA_access.h
branches/sculpt25/source/blender/makesrna/RNA_types.h
branches/sculpt25/source/blender/makesrna/intern/makesrna.c
branches/sculpt25/source/blender/makesrna/intern/rna_access.c
branches/sculpt25/source/blender/makesrna/intern/rna_action.c
branches/sculpt25/source/blender/makesrna/intern/rna_armature.c
branches/sculpt25/source/blender/makesrna/intern/rna_boid.c
branches/sculpt25/source/blender/makesrna/intern/rna_brush.c
branches/sculpt25/source/blender/makesrna/intern/rna_camera.c
branches/sculpt25/source/blender/makesrna/intern/rna_cloth.c
branches/sculpt25/source/blender/makesrna/intern/rna_constraint.c
branches/sculpt25/source/blender/makesrna/intern/rna_curve.c
branches/sculpt25/source/blender/makesrna/intern/rna_fcurve.c
branches/sculpt25/source/blender/makesrna/intern/rna_fluidsim.c
branches/sculpt25/source/blender/makesrna/intern/rna_group.c
branches/sculpt25/source/blender/makesrna/intern/rna_image.c
branches/sculpt25/source/blender/makesrna/intern/rna_internal.h
branches/sculpt25/source/blender/makesrna/intern/rna_internal_types.h
branches/sculpt25/source/blender/makesrna/intern/rna_key.c
branches/sculpt25/source/blender/makesrna/intern/rna_lamp.c
branches/sculpt25/source/blender/makesrna/intern/rna_lattice.c
branches/sculpt25/source/blender/makesrna/intern/rna_main_api.c
branches/sculpt25/source/blender/makesrna/intern/rna_material.c
branches/sculpt25/source/blender/makesrna/intern/rna_mesh.c
branches/sculpt25/source/blender/makesrna/intern/rna_meta.c
branches/sculpt25/source/blender/makesrna/intern/rna_modifier.c
branches/sculpt25/source/blender/makesrna/intern/rna_nodetree.c
branches/sculpt25/source/blender/makesrna/intern/rna_object.c
branches/sculpt25/source/blender/makesrna/intern/rna_object_force.c
branches/sculpt25/source/blender/makesrna/intern/rna_particle.c
branches/sculpt25/source/blender/makesrna/intern/rna_pose.c
branches/sculpt25/source/blender/makesrna/intern/rna_scene.c
branches/sculpt25/source/blender/makesrna/intern/rna_scene_api.c
branches/sculpt25/source/blender/makesrna/intern/rna_screen.c
branches/sculpt25/source/blender/makesrna/intern/rna_sculpt_paint.c
branches/sculpt25/source/blender/makesrna/intern/rna_sequence.c
branches/sculpt25/source/blender/makesrna/intern/rna_smoke.c
branches/sculpt25/source/blender/makesrna/intern/rna_sound.c
branches/sculpt25/source/blender/makesrna/intern/rna_space.c
branches/sculpt25/source/blender/makesrna/intern/rna_texture.c
branches/sculpt25/source/blender/makesrna/intern/rna_ui.c
branches/sculpt25/source/blender/makesrna/intern/rna_userdef.c
branches/sculpt25/source/blender/makesrna/intern/rna_wm.c
branches/sculpt25/source/blender/makesrna/intern/rna_wm_api.c
branches/sculpt25/source/blender/makesrna/intern/rna_world.c
branches/sculpt25/source/blender/python/BPY_extern.h
branches/sculpt25/source/blender/python/epy_doc_gen.py
branches/sculpt25/source/blender/python/intern/bpy_array.c
branches/sculpt25/source/blender/python/intern/bpy_interface.c
branches/sculpt25/source/blender/python/intern/bpy_rna.c
branches/sculpt25/source/blender/python/intern/bpy_rna.h
branches/sculpt25/source/blender/windowmanager/WM_api.h
branches/sculpt25/source/blender/windowmanager/WM_types.h
branches/sculpt25/source/blender/windowmanager/intern/wm.c
branches/sculpt25/source/blender/windowmanager/intern/wm_cursors.c
branches/sculpt25/source/blender/windowmanager/intern/wm_draw.c
branches/sculpt25/source/blender/windowmanager/intern/wm_event_system.c
branches/sculpt25/source/blender/windowmanager/intern/wm_files.c
branches/sculpt25/source/blender/windowmanager/intern/wm_keymap.c
branches/sculpt25/source/blender/windowmanager/intern/wm_window.c
branches/sculpt25/source/blender/windowmanager/wm_event_types.h
branches/sculpt25/source/creator/creator.c
branches/sculpt25/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.cpp
branches/sculpt25/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
branches/sculpt25/source/gameengine/Ketsji/KX_MouseFocusSensor.h
branches/sculpt25/source/gameengine/PyDoc/GameTypes.py
branches/sculpt25/source/gameengine/VideoTexture/ImageBuff.cpp
branches/sculpt25/source/gameengine/VideoTexture/ImageBuff.h
Added Paths:
-----------
branches/sculpt25/release/scripts/ui/space_dopesheet.py
branches/sculpt25/release/scripts/ui/space_nla.py
branches/sculpt25/source/blender/python/intern/bpy_driver.c
Removed Paths:
-------------
branches/sculpt25/source/blender/editors/space_action/action_header.c
branches/sculpt25/source/blender/editors/space_graph/graph_header.c
branches/sculpt25/source/blender/editors/space_nla/nla_header.c
Property Changed:
----------------
branches/sculpt25/release/scripts/ui/space_graph.py
Modified: branches/sculpt25/intern/elbeem/CMakeLists.txt
===================================================================
--- branches/sculpt25/intern/elbeem/CMakeLists.txt 2009-12-09 15:20:47 UTC (rev 25245)
+++ branches/sculpt25/intern/elbeem/CMakeLists.txt 2009-12-09 15:24:55 UTC (rev 25246)
@@ -33,9 +33,9 @@
ADD_DEFINITIONS(-DUSE_MSVC6FIXES)
ENDIF(WINDOWS)
-IF(WITH_OPENMP)
+IF(WITH_OPENMP AND NOT APPLE)
ADD_DEFINITIONS(-DPARALLEL=1)
-ENDIF(WITH_OPENMP)
+ENDIF(WITH_OPENMP AND NOT APPLE)
BLENDERLIB_NOLIST(bf_elbeem "${SRC}" "${INC}")
#, libtype='blender', priority=0 )
Modified: branches/sculpt25/intern/elbeem/SConscript
===================================================================
--- branches/sculpt25/intern/elbeem/SConscript 2009-12-09 15:20:47 UTC (rev 25245)
+++ branches/sculpt25/intern/elbeem/SConscript 2009-12-09 15:24:55 UTC (rev 25246)
@@ -8,7 +8,8 @@
defs = 'NOGUI ELBEEM_BLENDER=1'
if env['WITH_BF_OPENMP']:
- defs += ' PARALLEL'
+ if env['OURPLATFORM'] != 'darwin':
+ defs += ' PARALLEL'
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
defs += ' USE_MSVC6FIXES'
Modified: branches/sculpt25/projectfiles_vc9/blender/editors/ED_editors.vcproj
===================================================================
--- branches/sculpt25/projectfiles_vc9/blender/editors/ED_editors.vcproj 2009-12-09 15:20:47 UTC (rev 25245)
+++ branches/sculpt25/projectfiles_vc9/blender/editors/ED_editors.vcproj 2009-12-09 15:24:55 UTC (rev 25246)
@@ -632,10 +632,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\blender\editors\space_graph\graph_header.c"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\editors\space_graph\graph_intern.h"
>
</File>
@@ -836,10 +832,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\blender\editors\space_action\action_header.c"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\editors\space_action\action_intern.h"
>
</File>
@@ -876,10 +868,6 @@
>
</File>
<File
- RelativePath="..\..\..\source\blender\editors\space_nla\nla_header.c"
- >
- </File>
- <File
RelativePath="..\..\..\source\blender\editors\space_nla\nla_intern.h"
>
</File>
Modified: branches/sculpt25/release/datafiles/blenderbuttons
===================================================================
(Binary files differ)
Modified: branches/sculpt25/release/scripts/modules/graphviz_export.py
===================================================================
--- branches/sculpt25/release/scripts/modules/graphviz_export.py 2009-12-09 15:20:47 UTC (rev 25245)
+++ branches/sculpt25/release/scripts/modules/graphviz_export.py 2009-12-09 15:24:55 UTC (rev 25246)
@@ -51,7 +51,7 @@
return "* " + text
-def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True, XTRA_INFO=False):
+def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True, XTRA_INFO=True):
CONSTRAINTS = DRIVERS = True
fileobject = open(path, "w")
@@ -131,7 +131,7 @@
if XTRA_INFO:
label = "%s\n%s" % (constraint.type, constraint.name)
opts.append('label="%s"' % compat_str(label))
- fw('"%s" -> "%s" [%s] ;\n' % (subtarget, pbone.name, ','.join(opts)))
+ fw('"%s" -> "%s" [%s] ;\n' % (pbone.name, subtarget, ','.join(opts)))
# Drivers
if DRIVERS:
Modified: branches/sculpt25/release/scripts/modules/rigify/__init__.py
===================================================================
--- branches/sculpt25/release/scripts/modules/rigify/__init__.py 2009-12-09 15:20:47 UTC (rev 25245)
+++ branches/sculpt25/release/scripts/modules/rigify/__init__.py 2009-12-09 15:24:55 UTC (rev 25246)
@@ -73,19 +73,23 @@
setattr(self, attr, ebone.name)
-def _bone_class_instance_copy(self, from_prefix="", to_prefix=""):
+def _bone_class_instance_copy(self, from_fmt="%s", to_fmt="%s", exclude_attrs=(), base_names=None):
from_name_ls = []
new_name_ls = []
new_slot_ls = []
for attr in self.attr_names:
+
+ if attr in exclude_attrs:
+ continue
+
bone_name_orig = getattr(self, attr)
ebone = getattr(self, attr + "_e")
# orig_names[attr] = bone_name_orig
- # insert prefix
- if from_prefix:
- bone_name = from_prefix + bone_name_orig
+ # insert formatting
+ if from_fmt != "%s":
+ bone_name = from_fmt % bone_name_orig
ebone.name = bone_name
bone_name = ebone.name # cant be sure we get what we ask for
else:
@@ -95,8 +99,9 @@
new_slot_ls.append(attr)
from_name_ls.append(bone_name)
- bone_name_orig = bone_name_orig.replace("ORG-", "") # XXX - we need a better way to do this
- new_name_ls.append(to_prefix + bone_name_orig)
+ if base_names:
+ bone_name_orig = base_names[bone_name_orig]
+ new_name_ls.append(to_fmt % bone_name_orig)
new_bones = copy_bone_simple_list(self.obj.data, from_name_ls, new_name_ls, True)
new_bc = bone_class_instance(self.obj, new_slot_ls)
@@ -134,6 +139,10 @@
def bone_class_instance(obj, slots, name="BoneContainer"):
+
+ if len(slots) != len(set(slots)):
+ raise Exception("duplicate entries found %s" % attr_names)
+
attr_names = tuple(slots) # dont modify the original
slots = list(slots) # dont modify the original
for i in range(len(slots)):
@@ -210,6 +219,11 @@
if obj.mode == 'EDIT':
raise Exception("blending cant be called in editmode")
+ if len(apply_bones) != len(from_bones):
+ raise Exception("lists differ in length (from -> apply): \n\t%s\n\t%s" % (from_bones, apply_bones))
+ if len(apply_bones) != len(to_bones):
+ raise Exception("lists differ in length (to -> apply): \n\t%s\n\t%s" % (to_bones, apply_bones))
+
# setup the blend property
if target_bone is None:
target_bone = apply_bones[-1] # default to the last bone
@@ -272,10 +286,12 @@
new_pbone = obj.pose.bones[new_bone_name]
- if not new_pbone.bone.connected:
+ # if the bone is connected or its location is totally locked then dont add location blending.
+ if not (new_pbone.bone.connected or (False not in new_pbone.lock_location)):
blend_location(new_pbone, from_bone_name, to_bone_name)
- blend_rotation(new_pbone, from_bone_name, to_bone_name)
+ if not (False not in new_pbone.lock_rotation): # TODO. 4D chech?
+ blend_rotation(new_pbone, from_bone_name, to_bone_name)
def add_stretch_to(obj, from_name, to_name, name):
@@ -317,8 +333,9 @@
con.volume = 'NO_VOLUME'
bpy.ops.object.mode_set(mode=mode_orig)
+
+ return stretch_name
-
def add_pole_target_bone(obj, base_name, name, mode='CROSS'):
'''
Does not actually create a poll target, just the bone to use as a poll target
@@ -342,11 +359,18 @@
parent_dir = parent_head - parent_tail
distance = (base_dir.length + parent_dir.length)
-
+
if mode == 'CROSS':
+ # direction from the angle of the joint
offset = base_dir.copy().normalize() - parent_dir.copy().normalize()
offset.length = distance
+ elif mode == 'ZAVERAGE':
+ # between both bones Z axis
+ z_axis_a = base_ebone.matrix.copy().rotationPart() * Vector(0.0, 0.0, -1.0)
+ z_axis_b = parent_ebone.matrix.copy().rotationPart() * Vector(0.0, 0.0, -1.0)
+ offset = (z_axis_a + z_axis_b).normalize() * distance
else:
+ # preset axis
offset = Vector(0, 0, 0)
if mode[0] == "+":
val = distance
@@ -363,7 +387,7 @@
return poll_name
-def generate_rig(context, obj_orig, prefix="ORG-"):
+def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
from collections import OrderedDict
global_undo = context.user_preferences.edit.global_undo
@@ -371,20 +395,28 @@
bpy.ops.object.mode_set(mode='OBJECT')
+ scene = context.scene
# copy object and data
obj_orig.selected = False
obj = obj_orig.copy()
obj.data = obj_orig.data.copy()
- scene = context.scene
scene.objects.link(obj)
scene.objects.active = obj
obj.selected = True
+
+ if META_DEF:
+ obj_def = obj_orig.copy()
+ obj_def.data = obj_orig.data.copy()
+ scene.objects.link(obj_def)
arm = obj.data
# original name mapping
base_names = {}
+
+ # add all new parentless children to this bone
+ root_bone = None
bpy.ops.object.mode_set(mode='EDIT')
for bone in arm.edit_bones:
@@ -407,10 +439,23 @@
# inspect all bones and assign their definitions before modifying
for pbone in obj.pose.bones:
bone_name = pbone.name
- bone_type = obj.pose.bones[bone_name].get("type", "")
- bone_type_list = [bt for bt in bone_type.replace(",", " ").split()]
+ bone_type = pbone.get("type", "")
+ if bone_type:
+ bone_type_list = [bt for bt in bone_type.replace(",", " ").split()]
+
+ # not essential but means running autorig again wont do anything
+ del pbone["type"]
+ else:
+ bone_type_list = []
+
+ if bone_type_list == ["root"]: # special case!
+ if root_bone:
+ raise Exception("cant have more then 1 root bone, found '%s' and '%s' to have type==root" % (root_bone, bone_name))
+ root_bone = bone_name
+ bone_type_list[:] = []
for bone_type in bone_type_list:
+
type_pair = bone_type.split(".")
# 'leg.ik' will look for an ik function in the leg module
@@ -450,7 +495,7 @@
if bone_name not in bone_typeinfos:
continue
-
+
bone_def_dict = bone_definitions[bone_name]
# Only blend results from the same submodule, eg.
@@ -478,11 +523,35 @@
definition = bone_def_dict[submod_name]
if len(result_submod) == 2:
- blend_bone_list(obj, definition, result_submod[0], result_submod[1])
+ blend_bone_list(obj, definition, result_submod[0], result_submod[1], target_bone=bone_name)
- # needed to update driver deps
- # context.scene.update()
+ if root_bone:
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list