Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-06-19 02:53:49 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-06-19 02:53:49 +0400
commit4d141cf80821fa0dc9533f24583fbf7e53eab5b4 (patch)
treef0096d5ec7281574805a9282cdbea00f827041cb
parentdf0b629e246cc7fa091b00b97a2158877bd10ce3 (diff)
parent615af47559f7c1bf0aa13011d21ed972f433613c (diff)
Merged changes in the trunk up to revision 29550.
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp2
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp7
-rw-r--r--release/scripts/io/engine_render_pov.py2
-rw-r--r--release/scripts/io/export_3ds.py6
-rw-r--r--release/scripts/io/export_fbx.py12
-rw-r--r--release/scripts/io/export_mdd.py8
-rw-r--r--release/scripts/io/export_obj.py12
-rw-r--r--release/scripts/io/export_ply.py8
-rw-r--r--release/scripts/io/export_x3d.py6
-rw-r--r--release/scripts/io/import_anim_bvh.py4
-rw-r--r--release/scripts/io/import_scene_3ds.py4
-rw-r--r--release/scripts/io/import_scene_obj.py23
-rw-r--r--release/scripts/io/import_shape_mdd.py6
-rw-r--r--release/scripts/io/netrender/operators.py2
-rw-r--r--release/scripts/io/netrender/utils.py2
-rwxr-xr-xrelease/scripts/modules/blend_render_info.py99
-rw-r--r--release/scripts/modules/bpy_types.py16
-rw-r--r--release/scripts/modules/graphviz_export.py6
-rw-r--r--release/scripts/modules/rna_info.py16
-rw-r--r--release/scripts/modules/rna_prop_ui.py28
-rw-r--r--release/scripts/op/image.py24
-rw-r--r--release/scripts/op/presets.py12
-rw-r--r--release/scripts/op/uv.py6
-rw-r--r--release/scripts/op/wm.py96
-rw-r--r--release/scripts/presets/interaction/maya.py30
-rw-r--r--release/scripts/templates/operator.py10
-rw-r--r--release/scripts/ui/properties_data_armature_rigify.py6
-rw-r--r--release/scripts/ui/properties_data_curve.py2
-rw-r--r--release/scripts/ui/properties_data_modifier.py13
-rw-r--r--release/scripts/ui/properties_object.py2
-rw-r--r--release/scripts/ui/properties_physics_softbody.py4
-rw-r--r--release/scripts/ui/properties_scene.py12
-rw-r--r--release/scripts/ui/space_info.py25
-rw-r--r--release/scripts/ui/space_userpref.py39
-rw-r--r--release/scripts/ui/space_userpref_keymap.py22
-rw-r--r--release/scripts/ui/space_view3d.py22
-rw-r--r--release/scripts/ui/space_view3d_toolbar.py4
-rw-r--r--source/Makefile2
-rw-r--r--source/blender/blenkernel/BKE_idprop.h3
-rw-r--r--source/blender/blenkernel/BKE_softbody.h6
-rw-r--r--source/blender/blenkernel/intern/anim.c2
-rw-r--r--source/blender/blenkernel/intern/collision.c19
-rw-r--r--source/blender/blenkernel/intern/effect.c2
-rw-r--r--source/blender/blenkernel/intern/idprop.c42
-rw-r--r--source/blender/blenkernel/intern/image.c5
-rw-r--r--source/blender/blenkernel/intern/lattice.c22
-rw-r--r--source/blender/blenkernel/intern/object.c35
-rw-r--r--source/blender/blenkernel/intern/packedFile.c2
-rw-r--r--source/blender/blenkernel/intern/particle_system.c2
-rw-r--r--source/blender/blenkernel/intern/report.c2
-rw-r--r--source/blender/blenkernel/intern/scene.c67
-rw-r--r--source/blender/blenkernel/intern/sequencer.c2
-rw-r--r--source/blender/blenkernel/intern/softbody.c1002
-rw-r--r--source/blender/blenlib/BLI_rect.h2
-rw-r--r--source/blender/blenlib/BLI_uvproject.h3
-rw-r--r--source/blender/blenlib/intern/path_util.c6
-rw-r--r--source/blender/blenlib/intern/rct.c21
-rw-r--r--source/blender/blenlib/intern/uvproject.c7
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c38
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c32
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c2
-rw-r--r--source/blender/editors/animation/keyframing.c15
-rw-r--r--source/blender/editors/animation/keyingsets.c2
-rw-r--r--source/blender/editors/armature/poselib.c2
-rw-r--r--source/blender/editors/curve/curve_intern.h7
-rw-r--r--source/blender/editors/curve/curve_ops.c9
-rw-r--r--source/blender/editors/curve/editcurve.c148
-rw-r--r--source/blender/editors/curve/editfont.c10
-rw-r--r--source/blender/editors/include/ED_object.h2
-rw-r--r--source/blender/editors/interface/interface_anim.c2
-rw-r--r--source/blender/editors/interface/interface_panel.c2
-rw-r--r--source/blender/editors/interface/interface_regions.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/mesh/editmesh.c20
-rw-r--r--source/blender/editors/mesh/editmesh_add.c27
-rw-r--r--source/blender/editors/mesh/mesh_data.c6
-rw-r--r--source/blender/editors/object/object_add.c71
-rw-r--r--source/blender/editors/object/object_intern.h1
-rw-r--r--source/blender/editors/object/object_modifier.c6
-rw-r--r--source/blender/editors/object/object_ops.c7
-rw-r--r--source/blender/editors/physics/particle_edit.c42
-rw-r--r--source/blender/editors/render/render_shading.c6
-rw-r--r--source/blender/editors/screen/screendump.c8
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c50
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c14
-rw-r--r--source/blender/editors/sound/sound_ops.c4
-rw-r--r--source/blender/editors/space_action/action_edit.c18
-rw-r--r--source/blender/editors/space_action/action_select.c14
-rw-r--r--source/blender/editors/space_action/space_action.c2
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c6
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c10
-rw-r--r--source/blender/editors/space_console/space_console.c8
-rw-r--r--source/blender/editors/space_file/file_ops.c2
-rw-r--r--source/blender/editors/space_file/file_panels.c2
-rw-r--r--source/blender/editors/space_file/filesel.c4
-rw-r--r--source/blender/editors/space_graph/graph_edit.c28
-rw-r--r--source/blender/editors/space_graph/graph_select.c14
-rw-r--r--source/blender/editors/space_graph/space_graph.c13
-rw-r--r--source/blender/editors/space_image/image_buttons.c10
-rw-r--r--source/blender/editors/space_image/image_ops.c88
-rw-r--r--source/blender/editors/space_image/space_image.c2
-rw-r--r--source/blender/editors/space_info/info_ops.c2
-rw-r--r--source/blender/editors/space_logic/logic_ops.c143
-rw-r--r--source/blender/editors/space_logic/logic_window.c94
-rw-r--r--source/blender/editors/space_nla/nla_channels.c18
-rw-r--r--source/blender/editors/space_nla/nla_edit.c34
-rw-r--r--source/blender/editors/space_nla/nla_select.c6
-rw-r--r--source/blender/editors/space_node/node_draw.c25
-rw-r--r--source/blender/editors/space_node/node_edit.c6
-rw-r--r--source/blender/editors/space_node/node_select.c16
-rw-r--r--source/blender/editors/space_node/space_node.c2
-rw-r--r--source/blender/editors/space_outliner/outliner.c2
-rw-r--r--source/blender/editors/space_script/script_edit.c4
-rw-r--r--source/blender/editors/space_script/script_ops.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c37
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h1
-rw-r--r--source/blender/editors/space_sequencer/sequencer_ops.c13
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c20
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c5
-rw-r--r--source/blender/editors/space_text/space_text.c10
-rw-r--r--source/blender/editors/space_text/text_draw.c3
-rw-r--r--source/blender/editors/space_text/text_ops.c12
-rw-r--r--source/blender/editors/space_view3d/CMakeLists.txt2
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c24
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_ops.c18
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c15
-rw-r--r--source/blender/editors/transform/transform.c8
-rw-r--r--source/blender/editors/transform/transform_conversions.c4
-rw-r--r--source/blender/editors/transform/transform_ops.c4
-rw-r--r--source/blender/makesdna/DNA_camera_types.h6
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h18
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h1
-rw-r--r--source/blender/makesdna/DNA_scene_types.h10
-rw-r--r--source/blender/makesrna/RNA_access.h1
-rw-r--r--source/blender/makesrna/intern/rna_access.c23
-rw-r--r--source/blender/makesrna/intern/rna_action.c50
-rw-r--r--source/blender/makesrna/intern/rna_boid.c4
-rw-r--r--source/blender/makesrna/intern/rna_controller.c74
-rw-r--r--source/blender/makesrna/intern/rna_curve.c9
-rw-r--r--source/blender/makesrna/intern/rna_fcurve.c98
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_lamp.c1
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c3
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c9
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
-rw-r--r--source/blender/makesrna/intern/rna_particle.c8
-rw-r--r--source/blender/makesrna/intern/rna_scene.c2
-rw-r--r--source/blender/makesrna/intern/rna_screen.c4
-rw-r--r--source/blender/makesrna/intern/rna_sculpt_paint.c2
-rw-r--r--source/blender/makesrna/intern/rna_sequencer.c6
-rw-r--r--source/blender/makesrna/intern/rna_space.c2
-rw-r--r--source/blender/modifiers/intern/MOD_hook.c29
-rw-r--r--source/blender/modifiers/intern/MOD_solidify.c6
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c109
-rw-r--r--source/blender/python/doc/sphinx_doc_gen.py55
-rw-r--r--source/blender/python/generic/mathutils.c12
-rw-r--r--source/blender/python/intern/bpy.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c65
-rw-r--r--source/blender/render/intern/include/render_types.h7
-rw-r--r--source/blender/render/intern/source/imagetexture.c12
-rw-r--r--source/blender/render/intern/source/rayobject_instance.c7
-rw-r--r--source/blender/windowmanager/WM_api.h2
-rw-r--r--source/blender/windowmanager/WM_types.h27
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c13
-rw-r--r--source/blender/windowmanager/intern/wm_files.c22
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c139
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
-rw-r--r--source/gameengine/Ketsji/BL_BlenderShader.h7
-rw-r--r--source/gameengine/Ketsji/KX_BlenderMaterial.h1
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp7
-rw-r--r--source/gameengine/Ketsji/KX_ObjectActuator.cpp4
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp2
-rw-r--r--source/gameengine/PyDoc/bge.types.rst2
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp10
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.h2
-rw-r--r--source/gameengine/VideoTexture/blendVideoTex.cpp2
182 files changed, 2372 insertions, 1663 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index 76ce7703c06..91c1927f8e7 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -271,6 +271,8 @@ GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
+ if (!GetActiveWindow())
+ return GHOST_kFailure;
return ::SetCursorPos(x, y) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
}
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 1ae9b666c6b..052c868e5e0 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -465,7 +465,7 @@ GHOST_SystemX11::processEvent(XEvent *xe)
/* could also clamp to screen bounds
* wrap with a window outside the view will fail atm */
- bounds.wrapPoint(x_new, y_new, 2); /* offset of one incase blender is at screen bounds */
+ bounds.wrapPoint(x_new, y_new, 8); /* offset of one incase blender is at screen bounds */
window->getCursorGrabAccum(x_accum, y_accum);
if(x_new != xme.x_root || y_new != xme.y_root) {
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index b3b1c8ae0f7..60e12ff78df 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -57,6 +57,9 @@ typedef struct {
#define MWM_HINTS_DECORATIONS (1L << 1)
+
+// #define GHOST_X11_GRAB
+
/*
* A Client can't change the window property, that is
* the work of the window manager. In case, we send
@@ -1442,7 +1445,9 @@ setWindowCursorGrab(
setWindowCursorVisibility(false);
}
+#ifdef GHOST_X11_GRAB
XGrabPointer(m_display, m_window, False, ButtonPressMask| ButtonReleaseMask|PointerMotionMask, GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
+#endif
}
else {
if (m_cursorGrab==GHOST_kGrabHide) {
@@ -1460,7 +1465,9 @@ setWindowCursorGrab(
/* Almost works without but important otherwise the mouse GHOST location can be incorrect on exit */
setCursorGrabAccum(0, 0);
m_cursorGrabBounds.m_l= m_cursorGrabBounds.m_r= -1; /* disable */
+#ifdef GHOST_X11_GRAB
XUngrabPointer(m_display, CurrentTime);
+#endif
}
XFlush(m_display);
diff --git a/release/scripts/io/engine_render_pov.py b/release/scripts/io/engine_render_pov.py
index bf57d02391b..426bc761041 100644
--- a/release/scripts/io/engine_render_pov.py
+++ b/release/scripts/io/engine_render_pov.py
@@ -766,7 +766,7 @@ class PovrayRender(bpy.types.RenderEngine):
self._process = subprocess.Popen([pov_binary, self._temp_file_ini]) # stdout=subprocess.PIPE, stderr=subprocess.PIPE
except OSError:
# TODO, report api
- print("POVRAY: could not execute povray, possibly povray isn't installed: '%s'" % pov_binary)
+ print("POVRAY: could not execute '%s', possibly povray isn't installed" % pov_binary)
import traceback
traceback.print_exc()
print ("***-DONE-***")
diff --git a/release/scripts/io/export_3ds.py b/release/scripts/io/export_3ds.py
index 9cb5f3a077b..e234ab8600c 100644
--- a/release/scripts/io/export_3ds.py
+++ b/release/scripts/io/export_3ds.py
@@ -1123,11 +1123,11 @@ class Export3DS(bpy.types.Operator):
# filename = StringProperty(name="File Name", description="File name used for exporting the 3DS file", maxlen= 1024, default= ""),
- path = StringProperty(name="File Path", description="File path used for exporting the 3DS file", maxlen= 1024, default= "")
+ filepath = StringProperty(name="File Path", description="Filepath used for exporting the 3DS file", maxlen= 1024, default= "")
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
def execute(self, context):
- save_3ds(self.properties.path, context)
+ save_3ds(self.properties.filepath, context)
return {'FINISHED'}
def invoke(self, context, event):
@@ -1142,7 +1142,7 @@ class Export3DS(bpy.types.Operator):
# Add to a menu
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".3ds")
- self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").path = default_path
+ self.layout.operator(Export3DS.bl_idname, text="3D Studio (.3ds)").filepath = default_path
def register():
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py
index c2a93a5089e..967bbf50307 100644
--- a/release/scripts/io/export_fbx.py
+++ b/release/scripts/io/export_fbx.py
@@ -3335,7 +3335,7 @@ class ExportFBX(bpy.types.Operator):
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for exporting the FBX file", maxlen= 1024, default="")
+ filepath = StringProperty(name="File Path", description="Filepath used for exporting the FBX file", maxlen= 1024, default="")
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
EXP_OBS_SELECTED = BoolProperty(name="Selected Objects", description="Export selected objects on visible layers", default=True)
@@ -3369,8 +3369,8 @@ class ExportFBX(bpy.types.Operator):
return context.active_object
def execute(self, context):
- if not self.properties.path:
- raise Exception("path not set")
+ if not self.properties.filepath:
+ raise Exception("filepath not set")
GLOBAL_MATRIX = mtx4_identity
GLOBAL_MATRIX[0][0] = GLOBAL_MATRIX[1][1] = GLOBAL_MATRIX[2][2] = self.properties.TX_SCALE
@@ -3378,7 +3378,7 @@ class ExportFBX(bpy.types.Operator):
if self.properties.TX_YROT90: GLOBAL_MATRIX = mtx4_y90n * GLOBAL_MATRIX
if self.properties.TX_ZROT90: GLOBAL_MATRIX = mtx4_z90n * GLOBAL_MATRIX
- write(self.properties.path,
+ write(self.properties.filepath,
None, # XXX
context,
self.properties.EXP_OBS_SELECTED,
@@ -3411,7 +3411,7 @@ class ExportFBX(bpy.types.Operator):
# if __name__ == "__main__":
-# bpy.ops.EXPORT_OT_ply(path="/tmp/test.ply")
+# bpy.ops.EXPORT_OT_ply(filepath="/tmp/test.ply")
# NOTES (all line numbers correspond to original export_fbx.py (under release/scripts)
@@ -3439,7 +3439,7 @@ class ExportFBX(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".fbx")
- self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX (.fbx)").path = default_path
+ self.layout.operator(ExportFBX.bl_idname, text="Autodesk FBX (.fbx)").filepath = default_path
def register():
diff --git a/release/scripts/io/export_mdd.py b/release/scripts/io/export_mdd.py
index 3ae6ed3de9b..3c82ff5d497 100644
--- a/release/scripts/io/export_mdd.py
+++ b/release/scripts/io/export_mdd.py
@@ -159,7 +159,7 @@ class ExportMDD(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for exporting the MDD file", maxlen=1024)
+ filepath = StringProperty(name="File Path", description="Filepath used for exporting the MDD file", maxlen=1024)
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default=25)
frame_start = IntProperty(name="Start Frame", description="Start frame for baking", min=minframe, max=maxframe, default=1)
@@ -170,9 +170,9 @@ class ExportMDD(bpy.types.Operator):
return (ob and ob.type == 'MESH')
def execute(self, context):
- if not self.properties.path:
+ if not self.properties.filepath:
raise Exception("filename not set")
- write(self.properties.path, context.scene, context.active_object,
+ write(self.properties.filepath, context.scene, context.active_object,
self.properties.frame_start, self.properties.frame_end, self.properties.fps)
return {'FINISHED'}
@@ -184,7 +184,7 @@ class ExportMDD(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".mdd")
- self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)").path = default_path
+ self.layout.operator(ExportMDD.bl_idname, text="Lightwave Point Cache (.mdd)").filepath = default_path
def register():
diff --git a/release/scripts/io/export_obj.py b/release/scripts/io/export_obj.py
index 9c065c6dac9..40ef68041de 100644
--- a/release/scripts/io/export_obj.py
+++ b/release/scripts/io/export_obj.py
@@ -900,7 +900,7 @@ class ExportOBJ(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= "")
+ filepath = StringProperty(name="File Path", description="Filepath used for exporting the OBJ file", maxlen= 1024, default= "")
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
# context group
@@ -932,11 +932,11 @@ class ExportOBJ(bpy.types.Operator):
def execute(self, context):
- path = self.properties.path
- if not path.lower().endswith(".obj"):
- path += ".obj"
+ filepath = self.properties.filepath
+ if not filepath.lower().endswith(".obj"):
+ filepath += ".obj"
- do_export(path, context,
+ do_export(filepath, context,
EXPORT_TRI=self.properties.use_triangles,
EXPORT_EDGES=self.properties.use_edges,
EXPORT_NORMALS=self.properties.use_normals,
@@ -965,7 +965,7 @@ class ExportOBJ(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".obj")
- self.layout.operator(ExportOBJ.bl_idname, text="Wavefront (.obj)").path = default_path
+ self.layout.operator(ExportOBJ.bl_idname, text="Wavefront (.obj)").filepath = default_path
def register():
diff --git a/release/scripts/io/export_ply.py b/release/scripts/io/export_ply.py
index d0f2fab9c3e..aee56550526 100644
--- a/release/scripts/io/export_ply.py
+++ b/release/scripts/io/export_ply.py
@@ -267,7 +267,7 @@ class ExportPLY(bpy.types.Operator):
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen=1024, default="")
+ filepath = StringProperty(name="File Path", description="Filepath used for exporting the PLY file", maxlen=1024, default="")
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default=True)
use_normals = BoolProperty(name="Normals", description="Export Normals for smooth and hard shaded faces", default=True)
@@ -280,10 +280,10 @@ class ExportPLY(bpy.types.Operator):
def execute(self, context):
# print("Selected: " + context.active_object.name)
- if not self.properties.path:
+ if not self.properties.filepath:
raise Exception("filename not set")
- write(self.properties.path, context.scene, context.active_object,\
+ write(self.properties.filepath, context.scene, context.active_object,\
EXPORT_APPLY_MODIFIERS=self.properties.use_modifiers,
EXPORT_NORMALS=self.properties.use_normals,
EXPORT_UV=self.properties.use_uvs,
@@ -311,7 +311,7 @@ class ExportPLY(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".ply")
- self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)").path = default_path
+ self.layout.operator(ExportPLY.bl_idname, text="Stanford (.ply)").filepath = default_path
def register():
diff --git a/release/scripts/io/export_x3d.py b/release/scripts/io/export_x3d.py
index 61f216af833..6dc2340ec93 100644
--- a/release/scripts/io/export_x3d.py
+++ b/release/scripts/io/export_x3d.py
@@ -1224,7 +1224,7 @@ class ExportX3D(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= "")
+ filepath = StringProperty(name="File Path", description="Filepath used for exporting the X3D file", maxlen= 1024, default= "")
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object", default=True)
@@ -1232,7 +1232,7 @@ class ExportX3D(bpy.types.Operator):
compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install", default=False)
def execute(self, context):
- x3d_export(self.properties.path, context, self.properties.apply_modifiers, self.properties.triangulate, self.properties.compress)
+ x3d_export(self.properties.filepath, context, self.properties.apply_modifiers, self.properties.triangulate, self.properties.compress)
return {'FINISHED'}
def invoke(self, context, event):
@@ -1243,7 +1243,7 @@ class ExportX3D(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".x3d")
- self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)").path = default_path
+ self.layout.operator(ExportX3D.bl_idname, text="X3D Extensible 3D (.x3d)").filepath = default_path
def register():
diff --git a/release/scripts/io/import_anim_bvh.py b/release/scripts/io/import_anim_bvh.py
index 4a708d684c8..d497ac47065 100644
--- a/release/scripts/io/import_anim_bvh.py
+++ b/release/scripts/io/import_anim_bvh.py
@@ -561,7 +561,7 @@ class BvhImporter(bpy.types.Operator):
bl_idname = "import_anim.bvh"
bl_label = "Import BVH"
- path = StringProperty(name="File Path", description="File path used for importing the OBJ file", maxlen=1024, default="")
+ filepath = StringProperty(name="File Path", description="Filepath used for importing the OBJ file", maxlen=1024, default="")
scale = FloatProperty(name="Scale", description="Scale the BVH by this value", min=0.0001, max=1000000.0, soft_min=0.001, soft_max=100.0, default=0.1)
frame_start = IntProperty(name="Start Frame", description="Starting frame for the animation", default=1)
loop = BoolProperty(name="Loop", description="Loop the animation playback", default=False)
@@ -585,7 +585,7 @@ class BvhImporter(bpy.types.Operator):
t1 = time.time()
print('\tparsing bvh...', end="")
- bvh_nodes = read_bvh(context, self.properties.path,
+ bvh_nodes = read_bvh(context, self.properties.filepath,
ROT_MODE=self.properties.rotate_mode,
GLOBAL_SCALE=self.properties.scale)
diff --git a/release/scripts/io/import_scene_3ds.py b/release/scripts/io/import_scene_3ds.py
index ca7ef774a72..c579f876371 100644
--- a/release/scripts/io/import_scene_3ds.py
+++ b/release/scripts/io/import_scene_3ds.py
@@ -1012,7 +1012,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for importing the 3DS file", maxlen= 1024, default= "")
+ filepath = StringProperty(name="File Path", description="Filepath used for importing the 3DS file", maxlen= 1024, default= "")
filename = StringProperty(name="File Name", description="Name of the file.")
directory = StringProperty(name="Directory", description="Directory of the file.")
@@ -1021,7 +1021,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
# apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
def execute(self, context):
- load_3ds(self.properties.path, context, 0.0, False, False)
+ load_3ds(self.properties.filepath, context, 0.0, False, False)
return {'FINISHED'}
def invoke(self, context, event):
diff --git a/release/scripts/io/import_scene_obj.py b/release/scripts/io/import_scene_obj.py
index 736c8fa91c1..942619c49ee 100644
--- a/release/scripts/io/import_scene_obj.py
+++ b/release/scripts/io/import_scene_obj.py
@@ -65,19 +65,6 @@ from geometry import PolyFill
# try: import os
# except: os= False
-# Generic path functions
-def stripFile(path):
- '''Return directory, where the file is'''
- lastSlash= max(path.rfind('\\'), path.rfind('/'))
- if lastSlash != -1:
- path= path[:lastSlash]
- return '%s%s' % (path, os.sep)
-# return '%s%s' % (path, sys.sep)
-
-def stripPath(path):
- '''Strips the slashes from the back of a string'''
- return path.split('/')[-1].split('\\')[-1]
-
def stripExt(name): # name is a string
'''Strips the prefix off the name before writing'''
index= name.rfind('.')
@@ -360,7 +347,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
Create all the used materials in this obj,
assign colors and images to the materials from all referenced material libs
'''
- DIR= stripFile(filepath)
+ DIR= os.path.dirname(filepath)
#==================================================================================#
# This function sets textures defined in .mtl file #
@@ -431,7 +418,7 @@ def create_materials(filepath, material_libs, unique_materials, unique_material_
# Add an MTL with the same name as the obj if no MTLs are spesified.
- temp_mtl= stripExt(stripPath(filepath))+ '.mtl'
+ temp_mtl = os.path.splitext((os.path.basename(filepath)))[0] + '.mtl'
if os.path.exists(DIR + temp_mtl) and temp_mtl not in material_libs:
# if sys.exists(DIR + temp_mtl) and temp_mtl not in material_libs:
@@ -523,7 +510,7 @@ def split_mesh(verts_loc, faces, unique_materials, filepath, SPLIT_OB_OR_GROUP,
(verts_loc, faces, unique_materials, dataname)
'''
- filename = stripExt(stripPath(filepath))
+ filename = os.path.splitext((os.path.basename(filepath)))[0]
if not SPLIT_OB_OR_GROUP and not SPLIT_MATERIALS:
# use the filename for the object name since we arnt chopping up the mesh.
@@ -1576,7 +1563,7 @@ class IMPORT_OT_obj(bpy.types.Operator):
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for importing the OBJ file", maxlen= 1024, default= "")
+ filepath = StringProperty(name="File Path", description="Filepath used for importing the OBJ file", maxlen= 1024, default= "")
CREATE_SMOOTH_GROUPS = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True)
CREATE_FGONS = BoolProperty(name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True)
@@ -1596,7 +1583,7 @@ class IMPORT_OT_obj(bpy.types.Operator):
def execute(self, context):
# print("Selected: " + context.active_object.name)
- load_obj(self.properties.path,
+ load_obj(self.properties.filepath,
context,
self.properties.CLAMP_SIZE,
self.properties.CREATE_FGONS,
diff --git a/release/scripts/io/import_shape_mdd.py b/release/scripts/io/import_shape_mdd.py
index 8fef7672912..ec0e7696630 100644
--- a/release/scripts/io/import_shape_mdd.py
+++ b/release/scripts/io/import_shape_mdd.py
@@ -116,7 +116,7 @@ class importMDD(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
- path = StringProperty(name="File Path", description="File path used for importing the MDD file", maxlen=1024)
+ filepath = StringProperty(name="File Path", description="Filepath used for importing the MDD file", maxlen=1024)
#fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default=25)
frame_start = IntProperty(name="Start Frame", description="Start frame for inserting animation", min=minframe, max=maxframe, default=0)
@@ -125,10 +125,10 @@ class importMDD(bpy.types.Operator):
return (ob and ob.type == 'MESH')
def execute(self, context):
- if not self.properties.path:
+ if not self.properties.filepath:
raise Exception("filename not set")
- mdd_import(self.properties.path, bpy.context.active_object, context.scene, self.properties.frame_start, 1)
+ mdd_import(self.properties.filepath, bpy.context.active_object, context.scene, self.properties.frame_start, 1)
return {'FINISHED'}
diff --git a/release/scripts/io/netrender/operators.py b/release/scripts/io/netrender/operators.py
index 02cb864cd1a..858ec800dbc 100644
--- a/release/scripts/io/netrender/operators.py
+++ b/release/scripts/io/netrender/operators.py
@@ -77,7 +77,7 @@ class RENDER_OT_netslave_bake(bpy.types.Operator):
bpy.ops.ptcache.bake_all()
- #bpy.ops.wm.save_mainfile(path = path + os.sep + root + "_baked.blend")
+ #bpy.ops.wm.save_mainfile(filepath = path + os.sep + root + "_baked.blend")
return {'FINISHED'}
diff --git a/release/scripts/io/netrender/utils.py b/release/scripts/io/netrender/utils.py
index f194cdc9559..6288b9747c0 100644
--- a/release/scripts/io/netrender/utils.py
+++ b/release/scripts/io/netrender/utils.py
@@ -215,7 +215,7 @@ def thumbnail(filename):
scene = bpy.data.scenes[0] # FIXME, this is dodgy!
scene.render.file_format = "JPEG"
scene.render.file_quality = 90
- bpy.ops.image.open(path = filename)
+ bpy.ops.image.open(filepath=filename)
img = bpy.data.images[imagename]
img.save_render(thumbname, scene=scene)
diff --git a/release/scripts/modules/blend_render_info.py b/release/scripts/modules/blend_render_info.py
new file mode 100755
index 00000000000..b7018ad6b64
--- /dev/null
+++ b/release/scripts/modules/blend_render_info.py
@@ -0,0 +1,99 @@
+#!/usr/bin/python
+
+# ##### 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 module can get render info without running from inside blender.
+#
+# This struct wont change according to Ton.
+# Note that the size differs on 32/64bit
+#
+# typedef struct BHead {
+# int code, len;
+# void *old;
+# int SDNAnr, nr;
+# } BHead;
+
+def read_blend_rend_chunk(path):
+
+ import struct
+
+ file = open(path, 'rb')
+
+ head = file.read(7)
+
+ if head[0:2] == b'\x1f\x8b': # gzip magic
+ import gzip
+ file.close()
+ file = gzip.open(path, 'rb')
+ head = file.read(7)
+
+ if head != b'BLENDER':
+ print("not a blend file:", path)
+ file.close()
+ return []
+
+ is_64_bit = (file.read(1) == b'-')
+
+ # true for PPC, false for X86
+ is_big_endian = (file.read(1) == b'V')
+
+ # Now read the bhead chunk!!!
+ file.read(3) # skip the version
+
+ scenes = []
+
+ sizeof_bhead = 24 if is_64_bit else 20
+
+ while file.read(4) == b'REND':
+ sizeof_bhead_left = sizeof_bhead - 4
+
+ rend_length = struct.unpack('>i' if is_big_endian else '<i', file.read(4))[0]
+ sizeof_bhead_left -= 4
+
+ # We dont care about the rest of the bhead struct
+ file.read(sizeof_bhead_left)
+
+ # Now we want the scene name, start and end frame. this is 32bites long
+ start_frame, end_frame = struct.unpack('>2i' if is_big_endian else '<2i', file.read(8))
+
+ scene_name = file.read(24)
+
+ scene_name = scene_name[:scene_name.index(b'\0')]
+
+ try:
+ scene_name = str(scene_name, 'utf8')
+ except TypeError:
+ pass
+
+ scenes.append((start_frame, end_frame, scene_name))
+
+ return scenes
+
+
+def main():
+ import sys
+ for arg in sys.argv[1:]:
+ if arg.lower().endswith('.blend'):
+ for value in read_blend_rend_chunk(arg):
+ print("%d %d %s" % value)
+
+if __name__ == '__main__':
+ main()
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 0ba36a7c092..f6090d76533 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -79,10 +79,10 @@ class Group(bpy_types.ID):
__slots__ = ()
@property
- def users_dupli_object(self):
- """The dupli group this group is used in, XXX, TODO, WHY DOESNT THIS WORK???"""
+ def users_dupli_group(self):
+ """The dupli group this group is used in"""
import bpy
- return tuple(obj for obj in bpy.data.objects if self == obj.dupli_object)
+ return tuple(obj for obj in bpy.data.objects if self == obj.dupli_group)
class Object(bpy_types.ID):
@@ -614,7 +614,7 @@ class Menu(StructRNA, _GenericUI):
def path_menu(self, searchpaths, operator, props_default={}):
layout = self.layout
- # hard coded to set the operators 'path' to the filename.
+ # hard coded to set the operators 'filepath' to the filename.
import os
import bpy.utils
@@ -623,12 +623,12 @@ class Menu(StructRNA, _GenericUI):
# collect paths
files = []
- for path in searchpaths:
- files.extend([(f, os.path.join(path, f)) for f in os.listdir(path)])
+ for directory in searchpaths:
+ files.extend([(f, os.path.join(directory, f)) for f in os.listdir(directory)])
files.sort()
- for f, path in files:
+ for f, filepath in files:
if f.startswith("."):
continue
@@ -639,7 +639,7 @@ class Menu(StructRNA, _GenericUI):
for attr, value in props_default.items():
setattr(props, attr, value)
- props.path = path
+ props.filepath = filepath
if operator == "script.execute_preset":
props.menu_idname = self.bl_idname
props.preset_name = preset_name
diff --git a/release/scripts/modules/graphviz_export.py b/release/scripts/modules/graphviz_export.py
index 874b79d8ea2..900d69670d5 100644
--- a/release/scripts/modules/graphviz_export.py
+++ b/release/scripts/modules/graphviz_export.py
@@ -51,10 +51,10 @@ def compat_str(text, line_length=0):
return text
-def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True, XTRA_INFO=True):
+def graph_armature(obj, filepath, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True, XTRA_INFO=True):
CONSTRAINTS = DRIVERS = True
- fileobject = open(path, "w")
+ fileobject = open(filepath, "w")
fw = fileobject.write
fw(header)
fw('label = "%s::%s" ;' % (bpy.data.filepath.split("/")[-1].split("\\")[-1], obj.name))
@@ -178,7 +178,7 @@ def graph_armature(obj, path, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=True,
import sys
sys.stdout.flush()
'''
- print("\nSaved:", path)
+ print("\nSaved:", filepath)
return True
if __name__ == "__main__":
diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py
index fa1d15a7845..0f6d60066a3 100644
--- a/release/scripts/modules/rna_info.py
+++ b/release/scripts/modules/rna_info.py
@@ -620,3 +620,19 @@ def BuildRNAInfo():
# print(rna_info)
return InfoStructRNA.global_lookup, InfoFunctionRNA.global_lookup, InfoOperatorRNA.global_lookup, InfoPropertyRNA.global_lookup
+
+
+if __name__ == "__main__":
+ import rna_info
+ struct = rna_info.BuildRNAInfo()[0]
+ data = ""
+ for struct_id, v in sorted(struct.items()):
+ struct_id_str = "".join(sid for sid in struct_id if struct_id)
+ props = [(prop.identifier, prop) for prop in v.properties]
+
+ for prop_id, prop in sorted(props):
+ data += "%s.%s: %s %s\n" % (struct_id_str, prop.identifier, prop.type, prop.description)
+
+
+ text = bpy.data.texts.new(name="api.py")
+ text.from_string(data)
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index 7af57d265b9..3e8662c275f 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -61,7 +61,7 @@ def rna_idprop_ui_prop_clear(item, prop):
def draw(layout, context, context_member, use_edit=True):
def assign_props(prop, val, key):
- prop.path = context_member
+ prop.data_path = context_member
prop.property = key
try:
@@ -81,7 +81,7 @@ def draw(layout, context, context_member, use_edit=True):
if use_edit:
row = layout.row()
props = row.operator("wm.properties_add", text="Add")
- props.path = context_member
+ props.data_path = context_member
del row
for key, val in items:
@@ -140,7 +140,7 @@ from bpy.props import *
rna_path = StringProperty(name="Property Edit",
- description="Property path edit", maxlen=1024, default="", options={'HIDDEN'})
+ description="Property data_path edit", maxlen=1024, default="", options={'HIDDEN'})
rna_value = StringProperty(name="Property Value",
description="Property value edit", maxlen=1024, default="")
@@ -153,11 +153,11 @@ rna_max = FloatProperty(name="Max", default=1.0, precision=3)
class WM_OT_properties_edit(bpy.types.Operator):
- '''Internal use (edit a property path)'''
+ '''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_edit"
bl_label = "Edit Property"
- path = rna_path
+ data_path = rna_path
property = rna_property
value = rna_value
min = rna_min
@@ -165,7 +165,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
description = StringProperty(name="Tip", default="")
def execute(self, context):
- path = self.properties.path
+ data_path = self.properties.data_path
value = self.properties.value
prop = self.properties.property
prop_old = self._last_prop[0]
@@ -176,7 +176,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
value_eval = value
# First remove
- item = eval("context.%s" % path)
+ item = eval("context.%s" % data_path)
rna_idprop_ui_prop_clear(item, prop_old)
exec_str = "del item['%s']" % prop_old
@@ -207,7 +207,7 @@ class WM_OT_properties_edit(bpy.types.Operator):
self._last_prop = [self.properties.property]
- item = eval("context.%s" % self.properties.path)
+ item = eval("context.%s" % self.properties.data_path)
# setup defaults
prop_ui = rna_idprop_ui_prop_get(item, self.properties.property, False) # dont create
@@ -225,14 +225,14 @@ class WM_OT_properties_edit(bpy.types.Operator):
class WM_OT_properties_add(bpy.types.Operator):
- '''Internal use (edit a property path)'''
+ '''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_add"
bl_label = "Add Property"
- path = rna_path
+ data_path = rna_path
def execute(self, context):
- item = eval("context.%s" % self.properties.path)
+ item = eval("context.%s" % self.properties.data_path)
def unique_name(names):
prop = 'prop'
@@ -251,14 +251,14 @@ class WM_OT_properties_add(bpy.types.Operator):
class WM_OT_properties_remove(bpy.types.Operator):
- '''Internal use (edit a property path)'''
+ '''Internal use (edit a property data_path)'''
bl_idname = "wm.properties_remove"
bl_label = "Remove Property"
- path = rna_path
+ data_path = rna_path
property = rna_property
def execute(self, context):
- item = eval("context.%s" % self.properties.path)
+ item = eval("context.%s" % self.properties.data_path)
del item[self.properties.property]
return {'FINISHED'}
diff --git a/release/scripts/op/image.py b/release/scripts/op/image.py
index 873500d8343..be583012d7a 100644
--- a/release/scripts/op/image.py
+++ b/release/scripts/op/image.py
@@ -28,7 +28,7 @@ class EditExternally(bpy.types.Operator):
bl_label = "Image Edit Externally"
bl_options = {'REGISTER'}
- path = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="")
+ filepath = StringProperty(name="File Path", description="Path to an image file", maxlen=1024, default="")
def _editor_guess(self, context):
import platform
@@ -57,12 +57,12 @@ class EditExternally(bpy.types.Operator):
def execute(self, context):
import subprocess
- path = self.properties.path
+ filepath = self.properties.filepath
image_editor = self._editor_guess(context)
cmd = []
cmd.extend(image_editor)
- cmd.append(bpy.utils.expandpath(path))
+ cmd.append(bpy.utils.expandpath(filepath))
subprocess.Popen(cmd)
@@ -70,12 +70,12 @@ class EditExternally(bpy.types.Operator):
def invoke(self, context, event):
try:
- path = context.space_data.image.filepath
+ filepath = context.space_data.image.filepath
except:
self.report({'ERROR'}, "Image not found on disk")
return {'CANCELLED'}
- self.properties.path = path
+ self.properties.filepath = filepath
self.execute(context)
return {'FINISHED'}
@@ -91,13 +91,13 @@ class SaveDirty(bpy.types.Operator):
unique_paths = set()
for image in bpy.data.images:
if image.dirty:
- path = bpy.utils.expandpath(image.filepath)
- if "\\" not in path and "/" not in path:
- self.report({'WARNING'}, "Invalid path: " + path)
- elif path in unique_paths:
- self.report({'WARNING'}, "Path used by more then one image: " + path)
+ filepath = bpy.utils.expandpath(image.filepath)
+ if "\\" not in filepath and "/" not in filepath:
+ self.report({'WARNING'}, "Invalid path: " + filepath)
+ elif filepath in unique_paths:
+ self.report({'WARNING'}, "Path used by more then one image: " + filepath)
else:
- unique_paths.add(path)
+ unique_paths.add(filepath)
image.save()
return {'FINISHED'}
@@ -161,7 +161,7 @@ class ProjectEdit(bpy.types.Operator):
image_new.file_format = 'PNG'
image_new.save()
- bpy.ops.image.external_edit(path=filepath_final)
+ bpy.ops.image.external_edit(filepath=filepath_final)
return {'FINISHED'}
diff --git a/release/scripts/op/presets.py b/release/scripts/op/presets.py
index 03d70afc43b..a813cb5339d 100644
--- a/release/scripts/op/presets.py
+++ b/release/scripts/op/presets.py
@@ -46,13 +46,13 @@ class AddPresetBase(bpy.types.Operator):
target_path = bpy.utils.preset_paths(self.preset_subdir)[0] # we need some way to tell the user and system preset path
- path = os.path.join(target_path, filename)
+ filepath = os.path.join(target_path, filename)
if getattr(self, "save_keyconfig", True):
- bpy.ops.wm.keyconfig_export(path=path, kc_name=self.properties.name)
- file_preset = open(path, 'a')
+ bpy.ops.wm.keyconfig_export(filepath=filepath, kc_name=self.properties.name)
+ file_preset = open(filepath, 'a')
file_preset.write("wm.active_keyconfig = kc\n\n")
else:
- file_preset = open(path, 'w')
+ file_preset = open(filepath, 'w')
for rna_path in self.preset_values:
value = eval(rna_path)
@@ -79,7 +79,7 @@ class ExecutePreset(bpy.types.Operator):
bl_idname = "script.execute_preset"
bl_label = "Execute a Python Preset"
- path = bpy.props.StringProperty(name="Path", description="Path of the Python file to execute", maxlen=512, default="")
+ filepath = bpy.props.StringProperty(name="Path", description="Path of the Python file to execute", maxlen=512, default="")
preset_name = bpy.props.StringProperty(name="Preset Name", description="Name of the Preset being executed", default="")
menu_idname = bpy.props.StringProperty(name="Menu ID Name", description="ID name of the menu this was called from", default="")
@@ -89,7 +89,7 @@ class ExecutePreset(bpy.types.Operator):
preset_class.bl_label = self.properties.preset_name
# execute the preset using script.python_file_run
- bpy.ops.script.python_file_run(path=self.properties.path)
+ bpy.ops.script.python_file_run(filepath=self.properties.filepath)
return {'FINISHED'}
diff --git a/release/scripts/op/uv.py b/release/scripts/op/uv.py
index cd0b7086a70..b9bc54bf264 100644
--- a/release/scripts/op/uv.py
+++ b/release/scripts/op/uv.py
@@ -29,7 +29,7 @@ class ExportUVLayout(bpy.types.Operator):
bl_label = "Export UV Layout"
bl_options = {'REGISTER', 'UNDO'}
- path = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="")
+ filepath = StringProperty(name="File Path", description="File path used for exporting the SVG file", maxlen=1024, default="")
check_existing = BoolProperty(name="Check Existing", description="Check and warn on overwriting existing files", default=True, options={'HIDDEN'})
export_all = BoolProperty(name="All UV's", description="Export all UVs in this mesh (not just the visible ones)", default=False)
mode = EnumProperty(items=(
@@ -113,7 +113,7 @@ class ExportUVLayout(bpy.types.Operator):
mode = self.properties.mode
- file = open(self.properties.path, "w")
+ file = open(self.properties.filepath, "w")
fw = file.write
if mode == 'SVG':
@@ -211,7 +211,7 @@ class ExportUVLayout(bpy.types.Operator):
def menu_func(self, context):
default_path = bpy.data.filepath.replace(".blend", ".svg")
- self.layout.operator(ExportUVLayout.bl_idname).path = default_path
+ self.layout.operator(ExportUVLayout.bl_idname).filepath = default_path
def register():
diff --git a/release/scripts/op/wm.py b/release/scripts/op/wm.py
index 4a587f41aa7..5ef79887228 100644
--- a/release/scripts/op/wm.py
+++ b/release/scripts/op/wm.py
@@ -46,10 +46,10 @@ rna_relative_prop = BoolProperty(name="Relative",
default=False)
-def context_path_validate(context, path):
+def context_path_validate(context, data_path):
import sys
try:
- value = eval("context.%s" % path)
+ value = eval("context.%s" % data_path)
except AttributeError:
if "'NoneType'" in str(sys.exc_info()[1]):
# One of the items in the rna path is None, just ignore this
@@ -62,13 +62,13 @@ def context_path_validate(context, path):
def execute_context_assign(self, context):
- if context_path_validate(context, self.properties.path) is Ellipsis:
+ if context_path_validate(context, self.properties.data_path) is Ellipsis:
return {'PASS_THROUGH'}
if getattr(self.properties, "relative", False):
- exec("context.%s+=self.properties.value" % self.properties.path)
+ exec("context.%s+=self.properties.value" % self.properties.data_path)
else:
- exec("context.%s=self.properties.value" % self.properties.path)
+ exec("context.%s=self.properties.value" % self.properties.data_path)
return {'FINISHED'}
@@ -79,7 +79,7 @@ class WM_OT_context_set_boolean(bpy.types.Operator):
bl_label = "Context Set Boolean"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value = BoolProperty(name="Value",
description="Assignment value", default=True)
@@ -92,7 +92,7 @@ class WM_OT_context_set_int(bpy.types.Operator): # same as enum
bl_label = "Context Set"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value = IntProperty(name="Value", description="Assign value", default=0)
relative = rna_relative_prop
@@ -105,18 +105,18 @@ class WM_OT_context_scale_int(bpy.types.Operator): # same as enum
bl_label = "Context Set"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value = FloatProperty(name="Value", description="Assign value", default=1.0)
always_step = BoolProperty(name="Always Step",
description="Always adjust the value by a minimum of 1 when 'value' is not 1.0.",
default=True)
def execute(self, context):
- if context_path_validate(context, self.properties.path) is Ellipsis:
+ if context_path_validate(context, self.properties.data_path) is Ellipsis:
return {'PASS_THROUGH'}
value = self.properties.value
- path = self.properties.path
+ data_path = self.properties.data_path
if value == 1.0: # nothing to do
return {'CANCELLED'}
@@ -128,9 +128,9 @@ class WM_OT_context_scale_int(bpy.types.Operator): # same as enum
else:
add = "-1"
func = "min"
- exec("context.%s = %s(round(context.%s * value), context.%s + %s)" % (path, func, path, path, add))
+ exec("context.%s = %s(round(context.%s * value), context.%s + %s)" % (data_path, func, data_path, data_path, add))
else:
- exec("context.%s *= value" % self.properties.path)
+ exec("context.%s *= value" % self.properties.data_path)
return {'FINISHED'}
@@ -141,7 +141,7 @@ class WM_OT_context_set_float(bpy.types.Operator): # same as enum
bl_label = "Context Set Float"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value = FloatProperty(name="Value",
description="Assignment value", default=0.0)
relative = rna_relative_prop
@@ -155,7 +155,7 @@ class WM_OT_context_set_string(bpy.types.Operator): # same as enum
bl_label = "Context Set String"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value = StringProperty(name="Value",
description="Assign value", maxlen=1024, default="")
@@ -168,7 +168,7 @@ class WM_OT_context_set_enum(bpy.types.Operator):
bl_label = "Context Set Enum"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value = StringProperty(name="Value",
description="Assignment value (as a string)",
maxlen=1024, default="")
@@ -182,15 +182,15 @@ class WM_OT_context_set_value(bpy.types.Operator):
bl_label = "Context Set Value"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value = StringProperty(name="Value",
description="Assignment value (as a string)",
maxlen=1024, default="")
def execute(self, context):
- if context_path_validate(context, self.properties.path) is Ellipsis:
+ if context_path_validate(context, self.properties.data_path) is Ellipsis:
return {'PASS_THROUGH'}
- exec("context.%s=%s" % (self.properties.path, self.properties.value))
+ exec("context.%s=%s" % (self.properties.data_path, self.properties.value))
return {'FINISHED'}
@@ -200,15 +200,15 @@ class WM_OT_context_toggle(bpy.types.Operator):
bl_label = "Context Toggle"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
def execute(self, context):
- if context_path_validate(context, self.properties.path) is Ellipsis:
+ if context_path_validate(context, self.properties.data_path) is Ellipsis:
return {'PASS_THROUGH'}
exec("context.%s=not (context.%s)" %
- (self.properties.path, self.properties.path))
+ (self.properties.data_path, self.properties.data_path))
return {'FINISHED'}
@@ -219,7 +219,7 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
bl_label = "Context Toggle Values"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
value_1 = StringProperty(name="Value", \
description="Toggle enum", maxlen=1024, default="")
@@ -228,12 +228,12 @@ class WM_OT_context_toggle_enum(bpy.types.Operator):
def execute(self, context):
- if context_path_validate(context, self.properties.path) is Ellipsis:
+ if context_path_validate(context, self.properties.data_path) is Ellipsis:
return {'PASS_THROUGH'}
exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \
- (self.properties.path, self.properties.value_1,\
- self.properties.value_2, self.properties.path,
+ (self.properties.data_path, self.properties.value_1,\
+ self.properties.value_2, self.properties.data_path,
self.properties.value_2))
return {'FINISHED'}
@@ -246,12 +246,12 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
bl_label = "Context Int Cycle"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
reverse = rna_reverse_prop
def execute(self, context):
- path = self.properties.path
- value = context_path_validate(context, path)
+ data_path = self.properties.data_path
+ value = context_path_validate(context, data_path)
if value is Ellipsis:
return {'PASS_THROUGH'}
@@ -260,16 +260,16 @@ class WM_OT_context_cycle_int(bpy.types.Operator):
else:
value += 1
- exec("context.%s=value" % path)
+ exec("context.%s=value" % data_path)
- if value != eval("context.%s" % path):
+ if value != eval("context.%s" % data_path):
# relies on rna clamping int's out of the range
if self.properties.reverse:
value = (1 << 32)
else:
value = - (1 << 32)
- exec("context.%s=value" % path)
+ exec("context.%s=value" % data_path)
return {'FINISHED'}
@@ -280,19 +280,19 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
bl_label = "Context Enum Cycle"
bl_options = {'UNDO'}
- path = rna_path_prop
+ data_path = rna_path_prop
reverse = rna_reverse_prop
def execute(self, context):
- value = context_path_validate(context, self.properties.path)
+ value = context_path_validate(context, self.properties.data_path)
if value is Ellipsis:
return {'PASS_THROUGH'}
orig_value = value
# Have to get rna enum values
- rna_struct_str, rna_prop_str = self.properties.path.rsplit('.', 1)
+ rna_struct_str, rna_prop_str = self.properties.data_path.rsplit('.', 1)
i = rna_prop_str.find('[')
# just incse we get "context.foo.bar[0]"
@@ -322,7 +322,7 @@ class WM_OT_context_cycle_enum(bpy.types.Operator):
advance_enum = enums[orig_index + 1]
# set the new value
- exec("context.%s=advance_enum" % self.properties.path)
+ exec("context.%s=advance_enum" % self.properties.data_path)
return {'FINISHED'}
doc_id = StringProperty(name="Doc ID",
@@ -337,27 +337,27 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
bl_idname = "wm.context_modal_mouse"
bl_label = "Context Modal Mouse"
- path_iter = StringProperty(description="The path relative to the context, must point to an iterable.")
- path_item = StringProperty(description="The path from each iterable to the value (int or float)")
+ data_path_iter = StringProperty(description="The data path relative to the context, must point to an iterable.")
+ data_path_item = StringProperty(description="The data path from each iterable to the value (int or float)")
input_scale = FloatProperty(default=0.01, description="Scale the mouse movement by this value before applying the delta")
invert = BoolProperty(default=False, description="Invert the mouse input")
initial_x = IntProperty(options={'HIDDEN'})
def _values_store(self, context):
- path_iter = self.properties.path_iter
- path_item = self.properties.path_item
+ data_path_iter = self.properties.data_path_iter
+ data_path_item = self.properties.data_path_item
self._values = values = {}
- for item in getattr(context, path_iter):
+ for item in getattr(context, data_path_iter):
try:
- value_orig = eval("item." + path_item)
+ value_orig = eval("item." + data_path_item)
except:
continue
# check this can be set, maybe this is library data.
try:
- exec("item.%s = %s" % (path_item, value_orig))
+ exec("item.%s = %s" % (data_path_item, value_orig))
except:
continue
@@ -368,17 +368,17 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
if self.properties.invert:
delta = - delta
- path_item = self.properties.path_item
+ data_path_item = self.properties.data_path_item
for item, value_orig in self._values.items():
if type(value_orig) == int:
- exec("item.%s = int(%d)" % (path_item, round(value_orig + delta)))
+ exec("item.%s = int(%d)" % (data_path_item, round(value_orig + delta)))
else:
- exec("item.%s = %f" % (path_item, value_orig + delta))
+ exec("item.%s = %f" % (data_path_item, value_orig + delta))
def _values_restore(self):
- path_item = self.properties.path_item
+ data_path_item = self.properties.data_path_item
for item, value_orig in self._values.items():
- exec("item.%s = %s" % (path_item, value_orig))
+ exec("item.%s = %s" % (data_path_item, value_orig))
self._values.clear()
@@ -407,7 +407,7 @@ class WM_OT_context_modal_mouse(bpy.types.Operator):
if not self._values:
self.report({'WARNING'}, "Nothing to operate on: %s[ ].%s" %
- (self.properties.path_iter, self.properties.path_item))
+ (self.properties.data_path_iter, self.properties.data_path_item))
return {'CANCELLED'}
else:
diff --git a/release/scripts/presets/interaction/maya.py b/release/scripts/presets/interaction/maya.py
index 3e54cb4391b..31652035dff 100644
--- a/release/scripts/presets/interaction/maya.py
+++ b/release/scripts/presets/interaction/maya.py
@@ -126,11 +126,11 @@ kmi.properties.nr = 9
kmi = km.items.add('view3d.layers', 'ZERO', 'PRESS', any=True)
kmi.properties.nr = 10
kmi = km.items.add('wm.context_toggle_enum', 'Z', 'PRESS')
-kmi.properties.path = 'space_data.viewport_shading'
+kmi.properties.data_path = 'space_data.viewport_shading'
kmi.properties.value_1 = 'SOLID'
kmi.properties.value_2 = 'WIREFRAME'
kmi = km.items.add('wm.context_toggle_enum', 'Z', 'PRESS', alt=True)
-kmi.properties.path = 'space_data.viewport_shading'
+kmi.properties.data_path = 'space_data.viewport_shading'
kmi.properties.value_1 = 'TEXTURED'
kmi.properties.value_2 = 'SOLID'
kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS')
@@ -167,23 +167,23 @@ kmi = km.items.add('view3d.object_as_camera', 'NUMPAD_0', 'PRESS', ctrl=True)
kmi = km.items.add('wm.call_menu', 'S', 'PRESS', shift=True)
kmi.properties.name = 'VIEW3D_MT_snap'
kmi = km.items.add('wm.context_set_enum', 'COMMA', 'PRESS')
-kmi.properties.path = 'space_data.pivot_point'
+kmi.properties.data_path = 'space_data.pivot_point'
kmi.properties.value = 'BOUNDING_BOX_CENTER'
kmi = km.items.add('wm.context_set_enum', 'COMMA', 'PRESS', ctrl=True)
-kmi.properties.path = 'space_data.pivot_point'
+kmi.properties.data_path = 'space_data.pivot_point'
kmi.properties.value = 'MEDIAN_POINT'
kmi = km.items.add('wm.context_toggle', 'COMMA', 'PRESS', alt=True)
-kmi.properties.path = 'space_data.pivot_point_align'
+kmi.properties.data_path = 'space_data.pivot_point_align'
kmi = km.items.add('wm.context_toggle', 'Q', 'PRESS')
-kmi.properties.path = 'space_data.manipulator'
+kmi.properties.data_path = 'space_data.manipulator'
kmi = km.items.add('wm.context_set_enum', 'PERIOD', 'PRESS')
-kmi.properties.path = 'space_data.pivot_point'
+kmi.properties.data_path = 'space_data.pivot_point'
kmi.properties.value = 'CURSOR'
kmi = km.items.add('wm.context_set_enum', 'PERIOD', 'PRESS', ctrl=True)
-kmi.properties.path = 'space_data.pivot_point'
+kmi.properties.data_path = 'space_data.pivot_point'
kmi.properties.value = 'INDIVIDUAL_ORIGINS'
kmi = km.items.add('wm.context_set_enum', 'PERIOD', 'PRESS', alt=True)
-kmi.properties.path = 'space_data.pivot_point'
+kmi.properties.data_path = 'space_data.pivot_point'
kmi.properties.value = 'ACTIVE_ELEMENT'
kmi = km.items.add('transform.translate', 'G', 'PRESS', shift=True)
kmi = km.items.add('transform.translate', 'EVT_TWEAK_S', 'ANY')
@@ -197,7 +197,7 @@ kmi = km.items.add('transform.create_orientation', 'SPACE', 'PRESS', ctrl=True,
kmi.properties.use = True
kmi = km.items.add('transform.mirror', 'M', 'PRESS', ctrl=True)
kmi = km.items.add('wm.context_toggle', 'TAB', 'PRESS', shift=True)
-kmi.properties.path = 'tool_settings.snap'
+kmi.properties.data_path = 'tool_settings.snap'
kmi = km.items.add('transform.snap_type', 'TAB', 'PRESS', shift=True, ctrl=True)
kmi = km.items.add('view3d.enable_manipulator', 'W', 'PRESS')
kmi.properties.translate = True
@@ -212,9 +212,9 @@ kmi.properties.extend = True
km = kc.add_keymap('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False)
kmi = km.items.add('wm.context_cycle_enum', 'O', 'PRESS', shift=True)
-kmi.properties.path = 'tool_settings.proportional_editing_falloff'
+kmi.properties.data_path = 'tool_settings.proportional_editing_falloff'
kmi = km.items.add('wm.context_toggle_enum', 'O', 'PRESS')
-kmi.properties.path = 'tool_settings.proportional_editing'
+kmi.properties.data_path = 'tool_settings.proportional_editing'
kmi.properties.value_1 = 'DISABLED'
kmi.properties.value_2 = 'ENABLED'
kmi = km.items.add('view3d.game_start', 'P', 'PRESS')
@@ -363,13 +363,13 @@ kmi.properties.name = 'VIEW3D_MT_uv_map'
kmi = km.items.add('wm.call_menu', 'G', 'PRESS', ctrl=True)
kmi.properties.name = 'VIEW3D_MT_vertex_group'
kmi = km.items.add('wm.context_cycle_enum', 'O', 'PRESS', shift=True)
-kmi.properties.path = 'tool_settings.proportional_editing_falloff'
+kmi.properties.data_path = 'tool_settings.proportional_editing_falloff'
kmi = km.items.add('wm.context_toggle_enum', 'O', 'PRESS')
-kmi.properties.path = 'tool_settings.proportional_editing'
+kmi.properties.data_path = 'tool_settings.proportional_editing'
kmi.properties.value_1 = 'DISABLED'
kmi.properties.value_2 = 'ENABLED'
kmi = km.items.add('wm.context_toggle_enum', 'O', 'PRESS', alt=True)
-kmi.properties.path = 'tool_settings.proportional_editing'
+kmi.properties.data_path = 'tool_settings.proportional_editing'
kmi.properties.value_1 = 'DISABLED'
kmi.properties.value_2 = 'CONNECTED'
kmi = km.items.add('mesh.select_all', 'SELECTMOUSE', 'CLICK')
diff --git a/release/scripts/templates/operator.py b/release/scripts/templates/operator.py
index 23d75607ba3..de181a13c25 100644
--- a/release/scripts/templates/operator.py
+++ b/release/scripts/templates/operator.py
@@ -1,7 +1,7 @@
import bpy
-def write_some_data(context, path, use_some_setting):
+def write_some_data(context, filepath, use_some_setting):
print("running write_some_data...")
pass
@@ -16,7 +16,7 @@ class ExportSomeData(bpy.types.Operator):
# to the class instance from the operator settings before calling.
# TODO, add better example props
- path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
+ filepath = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
use_setting = BoolProperty(name="Example Boolean", description="Example Tooltip", default= True)
type = bpy.props.EnumProperty(items=(('OPT_A', "First Option", "Description one"), ('OPT_B', "Second Option", "Description two.")),
@@ -30,10 +30,10 @@ class ExportSomeData(bpy.types.Operator):
def execute(self, context):
# # Bug, currently isnt working
- #if not self.is_property_set("path"):
+ #if not self.is_property_set("filepath"):
# raise Exception("filename not set")
- write_some_data(self.properties.path, context, self.properties.use_setting)
+ write_some_data(self.properties.filepath, context, self.properties.use_setting)
return {'FINISHED'}
@@ -63,4 +63,4 @@ menu_func = lambda self, context: self.layout.operator("export.some_data", text=
bpy.types.INFO_MT_file_export.append(menu_func)
if __name__ == "__main__":
- bpy.ops.export.some_data('INVOKE_DEFAULT', path="/tmp/test.ply")
+ bpy.ops.export.some_data('INVOKE_DEFAULT', filepath="/tmp/test.ply")
diff --git a/release/scripts/ui/properties_data_armature_rigify.py b/release/scripts/ui/properties_data_armature_rigify.py
index 0eba1fb045b..43021858f9f 100644
--- a/release/scripts/ui/properties_data_armature_rigify.py
+++ b/release/scripts/ui/properties_data_armature_rigify.py
@@ -232,14 +232,14 @@ class AsScript(bpy.types.Operator):
bl_label = "Write Metarig to Script"
bl_options = {'REGISTER', 'UNDO'}
- path = StringProperty(name="File Path", description="File path used for exporting the Armature file", maxlen=1024, default="")
+ filepath = StringProperty(name="File Path", description="File path used for exporting the Armature file", maxlen=1024, default="")
def execute(self, context):
import rigify_utils
reload(rigify_utils)
obj = context.object
code = rigify_utils.write_meta_rig(obj)
- path = self.properties.path
+ path = self.properties.filepath
file = open(path, "w")
file.write(code)
file.close()
@@ -249,7 +249,7 @@ class AsScript(bpy.types.Operator):
def invoke(self, context, event):
import os
obj = context.object
- self.properties.path = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.utils.clean_name(obj.name) + ".py"
+ self.properties.filepath = os.path.splitext(bpy.data.filepath)[0] + "-" + bpy.utils.clean_name(obj.name) + ".py"
wm = context.manager
wm.add_fileselect(self)
return {'RUNNING_MODAL'}
diff --git a/release/scripts/ui/properties_data_curve.py b/release/scripts/ui/properties_data_curve.py
index 5f1dc662b97..c5bf4b8459b 100644
--- a/release/scripts/ui/properties_data_curve.py
+++ b/release/scripts/ui/properties_data_curve.py
@@ -126,7 +126,7 @@ class DATA_PT_shape_curve(DataButtonsPanel):
sub.prop(curve, "use_deform_fill")
col.label(text="Textures:")
-# col.prop(curve, "uv_orco")
+ col.prop(curve, "map_along_length")
col.prop(curve, "auto_texspace")
diff --git a/release/scripts/ui/properties_data_modifier.py b/release/scripts/ui/properties_data_modifier.py
index 8e85b7dfb97..37764e20854 100644
--- a/release/scripts/ui/properties_data_modifier.py
+++ b/release/scripts/ui/properties_data_modifier.py
@@ -480,10 +480,10 @@ class DATA_PT_modifiers(DataButtonsPanel):
layout.separator()
- layout.prop(md, "path", text="Create Along Paths")
+ layout.prop(md, "use_path", text="Create Along Paths")
split = layout.split()
- split.active = md.path
+ split.active = md.use_path
col = split.column()
col.row().prop(md, "axis", expand=True)
col.prop(md, "keep_shape")
@@ -643,13 +643,14 @@ class DATA_PT_modifiers(DataButtonsPanel):
colsub.active = (md.vertex_group is not "")
colsub.prop(md, "invert", text="Invert")
- if wide_ui:
- col.label(text="")
-
- col.prop(md, "use_rim")
col.prop(md, "use_even_offset")
col.prop(md, "use_quality_normals")
+ col.prop(md, "use_rim")
+ colsub = col.column()
+ colsub.active = md.use_rim
+ colsub.prop(md, "use_rim_material")
+
# col = layout.column()
# col.label(text="Vertex Group:")
# col.prop_object(md, "vertex_group", ob, "vertex_groups", text="")
diff --git a/release/scripts/ui/properties_object.py b/release/scripts/ui/properties_object.py
index f1b3e63f7ab..a2637f7924b 100644
--- a/release/scripts/ui/properties_object.py
+++ b/release/scripts/ui/properties_object.py
@@ -182,7 +182,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
col.prop(group, "dupli_offset", text="")
prop = col.operator("wm.context_set_value", text="From Cursor")
- prop.path = "object.users_group[%d].dupli_offset" % index
+ prop.data_path = "object.users_group[%d].dupli_offset" % index
prop.value = value
index += 1
diff --git a/release/scripts/ui/properties_physics_softbody.py b/release/scripts/ui/properties_physics_softbody.py
index 696f29810a3..43404a5ba8b 100644
--- a/release/scripts/ui/properties_physics_softbody.py
+++ b/release/scripts/ui/properties_physics_softbody.py
@@ -197,7 +197,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
- bl_label = "Soft Body Collision"
+ bl_label = "Soft Body Self Collision"
bl_default_closed = True
def poll(self, context):
@@ -218,7 +218,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
layout.active = softbody.self_collision and softbody_panel_enabled(md)
- layout.label(text="Collision Type:")
+ layout.label(text="Collision Ball Size Calculation:")
if wide_ui:
layout.prop(softbody, "collision_type", expand=True)
else:
diff --git a/release/scripts/ui/properties_scene.py b/release/scripts/ui/properties_scene.py
index 5e83fad38a0..4319711d05e 100644
--- a/release/scripts/ui/properties_scene.py
+++ b/release/scripts/ui/properties_scene.py
@@ -105,7 +105,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel):
subcol = col.column()
subcol.operator_context = 'INVOKE_DEFAULT'
op = subcol.operator("anim.keying_set_export", text="Export to File")
- op.path = "keyingset.py"
+ op.filepath = "keyingset.py"
if wide_ui:
col = row.column()
@@ -229,7 +229,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
bl_idname = "anim.keying_set_export"
bl_label = "Export Keying Set..."
- path = bpy.props.StringProperty(name="File Path", description="File path to write file to.")
+ filepath = bpy.props.StringProperty(name="File Path", description="Filepath to write file to.")
filename = bpy.props.StringProperty(name="File Name", description="Name of the file.")
directory = bpy.props.StringProperty(name="Directory", description="Directory of the file.")
filter_folder = bpy.props.BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
@@ -237,10 +237,10 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
filter_python = bpy.props.BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
def execute(self, context):
- if not self.properties.path:
- raise Exception("File path not set.")
+ if not self.properties.filepath:
+ raise Exception("Filepath not set.")
- f = open(self.properties.path, "w")
+ f = open(self.properties.filepath, "w")
if not f:
raise Exception("Could not open file.")
@@ -301,7 +301,7 @@ class ANIM_OT_keying_set_export(bpy.types.Operator):
for ksp in ks.paths:
f.write("ksp = ks.paths.add(")
- # id-block + RNA-path
+ # id-block + data_path
if ksp.id:
# find the relevant shorthand from the cache
id_bpy_path = id_to_paths_cache[ksp.id][0]
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py
index d37190eb5eb..5ed6043cbe7 100644
--- a/release/scripts/ui/space_info.py
+++ b/release/scripts/ui/space_info.py
@@ -133,13 +133,13 @@ class INFO_MT_file_open_recent(bpy.types.Menu):
layout = self.layout
layout.operator_context = 'EXEC_AREA'
- path = os.path.join(bpy.app.home, ".Blog")
+ filepath = os.path.join(bpy.app.home, ".Blog")
- if os.path.isfile(path):
- file = open(path, "rU")
+ if os.path.isfile(filepath):
+ file = open(filepath, "rU")
for line in file:
line = line.rstrip()
- layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
+ layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').filepath = line
file.close()
else:
layout.label(text='No recent files')
@@ -212,6 +212,19 @@ class INFO_MT_curve_add(bpy.types.Menu):
layout.operator("curve.primitive_nurbs_circle_add", icon='CURVE_NCIRCLE', text="Nurbs Circle")
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
+class INFO_MT_surface_add(bpy.types.Menu):
+ bl_idname = "INFO_MT_surface_add"
+ bl_label = "Surface"
+
+ def draw(self, context):
+ layout = self.layout
+ layout.operator_context = 'INVOKE_REGION_WIN'
+ layout.operator("surface.primitive_nurbs_surface_curve_add", icon='SURFACE_NCURVE', text="NURBS Curve")
+ layout.operator("surface.primitive_nurbs_surface_circle_add", icon='SURFACE_NCIRCLE', text="NURBS Circle")
+ layout.operator("surface.primitive_nurbs_surface_surface_add", icon='SURFACE_NSURFACE', text="NURBS Surface")
+ layout.operator("surface.primitive_nurbs_surface_tube_add", icon='SURFACE_NTUBE', text="NURBS Tube")
+ layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
+ layout.operator("surface.primitive_nurbs_surface_donut_add", icon='SURFACE_NDONUT', text="NURBS Torus")
class INFO_MT_armature_add(bpy.types.Menu):
bl_idname = "INFO_MT_armature_add"
@@ -236,7 +249,8 @@ class INFO_MT_add(bpy.types.Menu):
#layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
- layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
+ #layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
+ layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
layout.separator()
@@ -367,6 +381,7 @@ classes = [
INFO_MT_add,
INFO_MT_mesh_add,
INFO_MT_curve_add,
+ INFO_MT_surface_add,
INFO_MT_armature_add,
INFO_MT_game,
INFO_MT_render,
diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py
index 9613973cea4..64f06881058 100644
--- a/release/scripts/ui/space_userpref.py
+++ b/release/scripts/ui/space_userpref.py
@@ -83,12 +83,12 @@ class USERPREF_HT_header(bpy.types.Header):
if userpref.active_section == 'INPUT':
op = layout.operator("wm.keyconfig_export")
- op.path = "keymap.py"
+ op.filepath = "keymap.py"
op = layout.operator("wm.keyconfig_import")
- op.path = "keymap.py"
+ op.filepath = "keymap.py"
elif userpref.active_section == 'ADDONS':
op = layout.operator("wm.addon_install")
- op.path = "*.py"
+ op.filepath = "*.py"
elif userpref.active_section == 'THEMES':
op = layout.operator("ui.reset_default_theme")
@@ -1207,10 +1207,25 @@ class USERPREF_PT_addons(bpy.types.Panel):
arrow.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name
row.label(text=info["name"])
- row.operator("wm.addon_disable" if is_enabled else "wm.addon_enable").module = module_name
+
+ if is_enabled: operator = "wm.addon_disable"
+ else: operator = "wm.addon_enable"
+
+ if info["warning"]: button_icon='ERROR'
+ else: button_icon='BLENDER'
+
+ row.operator(operator, icon=button_icon).module = module_name
# Expanded UI (only if additional infos are available)
if info["expanded"]:
+ if info["description"]:
+ split = column.row().split(percentage=0.15)
+ split.label(text='Description:')
+ split.label(text=info["description"])
+ if info["location"]:
+ split = column.row().split(percentage=0.15)
+ split.label(text='Location:')
+ split.label(text=info["location"])
if info["author"]:
split = column.row().split(percentage=0.15)
split.label(text='Author:')
@@ -1219,14 +1234,10 @@ class USERPREF_PT_addons(bpy.types.Panel):
split = column.row().split(percentage=0.15)
split.label(text='Version:')
split.label(text=info["version"])
- if info["location"]:
- split = column.row().split(percentage=0.15)
- split.label(text='Location:')
- split.label(text=info["location"])
- if info["description"]:
+ if info["warning"]:
split = column.row().split(percentage=0.15)
- split.label(text='Description:')
- split.label(text=info["description"])
+ split.label(text="Warning:")
+ split.label(text=' ' + info["warning"], icon = 'ERROR')
if info["wiki_url"] or info["tracker_url"]:
split = column.row().split(percentage=0.15)
split.label(text="Internet:")
@@ -1263,7 +1274,7 @@ class USERPREF_PT_addons(bpy.types.Panel):
from bpy.props import *
-def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "expanded": False}):
+def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "warning": "", "expanded": False}):
addon_info = getattr(mod, "bl_addon_info", {})
# avoid re-initializing
@@ -1350,7 +1361,7 @@ class WM_OT_addon_install(bpy.types.Operator):
module = StringProperty(name="Module", description="Module name of the addon to disable")
- path = StringProperty(name="File Path", description="File path to write file to")
+ filepath = StringProperty(name="File Path", description="File path to write file to")
filename = StringProperty(name="File Name", description="Name of the file")
directory = StringProperty(name="Directory", description="Directory of the file")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
@@ -1359,7 +1370,7 @@ class WM_OT_addon_install(bpy.types.Operator):
def execute(self, context):
import traceback
import zipfile
- pyfile = self.properties.path
+ pyfile = self.properties.filepath
path_addons = bpy.utils.script_paths("addons")[-1]
diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py
index 961b138ab7e..37007c65f7a 100644
--- a/release/scripts/ui/space_userpref_keymap.py
+++ b/release/scripts/ui/space_userpref_keymap.py
@@ -508,7 +508,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
bl_idname = "wm.keyconfig_import"
bl_label = "Import Key Configuration..."
- path = StringProperty(name="File Path", description="File path to write file to")
+ filepath = StringProperty(name="File Path", description="Filepath to write file to")
filename = StringProperty(name="File Name", description="Name of the file")
directory = StringProperty(name="Directory", description="Directory of the file")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
@@ -518,10 +518,10 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True)
def execute(self, context):
- if not self.properties.path:
- raise Exception("File path not set")
+ if not self.properties.filepath:
+ raise Exception("Filepath not set")
- f = open(self.properties.path, "r")
+ f = open(self.properties.filepath, "r")
if not f:
raise Exception("Could not open file")
@@ -545,9 +545,9 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
path = os.path.join(path, config_name + ".py")
if self.properties.keep_original:
- shutil.copy(self.properties.path, path)
+ shutil.copy(self.properties.filepath, path)
else:
- shutil.move(self.properties.path, path)
+ shutil.move(self.properties.filepath, path)
exec("import " + config_name)
@@ -569,7 +569,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
bl_idname = "wm.keyconfig_export"
bl_label = "Export Key Configuration..."
- path = StringProperty(name="File Path", description="File path to write file to")
+ filepath = StringProperty(name="File Path", description="Filepath to write file to")
filename = StringProperty(name="File Name", description="Name of the file")
directory = StringProperty(name="Directory", description="Directory of the file")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
@@ -578,10 +578,10 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
kc_name = StringProperty(name="KeyConfig Name", description="Name to save the key config as")
def execute(self, context):
- if not self.properties.path:
- raise Exception("File path not set")
+ if not self.properties.filepath:
+ raise Exception("Filepath not set")
- f = open(self.properties.path, "w")
+ f = open(self.properties.filepath, "w")
if not f:
raise Exception("Could not open file")
@@ -591,7 +591,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
if self.properties.kc_name != '':
name = self.properties.kc_name
elif kc.name == 'Blender':
- name = os.path.splitext(os.path.basename(self.properties.path))[0]
+ name = os.path.splitext(os.path.basename(self.properties.filepath))[0]
else:
name = kc.name
diff --git a/release/scripts/ui/space_view3d.py b/release/scripts/ui/space_view3d.py
index 8404ee83f16..14312d3c1ad 100644
--- a/release/scripts/ui/space_view3d.py
+++ b/release/scripts/ui/space_view3d.py
@@ -721,23 +721,23 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
props = layout.operator("wm.context_modal_mouse", text="Spot Size")
- props.path_iter = "selected_editable_objects"
- props.path_item = "data.spot_size"
+ props.data_path_iter = "selected_editable_objects"
+ props.data_path_item = "data.spot_size"
props.input_scale = 0.01
props = layout.operator("wm.context_modal_mouse", text="Distance")
- props.path_iter = "selected_editable_objects"
- props.path_item = "data.distance"
+ props.data_path_iter = "selected_editable_objects"
+ props.data_path_item = "data.distance"
props.input_scale = 0.1
props = layout.operator("wm.context_modal_mouse", text="Clip Start")
- props.path_iter = "selected_editable_objects"
- props.path_item = "data.shadow_buffer_clip_start"
+ props.data_path_iter = "selected_editable_objects"
+ props.data_path_item = "data.shadow_buffer_clip_start"
props.input_scale = 0.05
props = layout.operator("wm.context_modal_mouse", text="Clip End")
- props.path_iter = "selected_editable_objects"
- props.path_item = "data.shadow_buffer_clip_end"
+ props.data_path_iter = "selected_editable_objects"
+ props.data_path_item = "data.shadow_buffer_clip_end"
props.input_scale = 0.05
layout.separator()
@@ -1277,15 +1277,15 @@ class VIEW3D_MT_edit_mesh_selection_mode(bpy.types.Menu):
prop = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL')
prop.value = "(True, False, False)"
- prop.path = "tool_settings.mesh_selection_mode"
+ prop.data_path = "tool_settings.mesh_selection_mode"
prop = layout.operator("wm.context_set_value", text="Edge", icon='EDGESEL')
prop.value = "(False, True, False)"
- prop.path = "tool_settings.mesh_selection_mode"
+ prop.data_path = "tool_settings.mesh_selection_mode"
prop = layout.operator("wm.context_set_value", text="Face", icon='FACESEL')
prop.value = "(False, False, True)"
- prop.path = "tool_settings.mesh_selection_mode"
+ prop.data_path = "tool_settings.mesh_selection_mode"
class VIEW3D_MT_edit_mesh_extrude(bpy.types.Menu):
diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py
index 11a7fae894b..6984bbeea41 100644
--- a/release/scripts/ui/space_view3d_toolbar.py
+++ b/release/scripts/ui/space_view3d_toolbar.py
@@ -948,7 +948,7 @@ class VIEW3D_MT_tools_projectpaint_clone(bpy.types.Menu):
layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures):
prop = layout.operator("wm.context_set_int", text=tex.name)
- prop.path = "active_object.data.uv_texture_clone_index"
+ prop.data_path = "active_object.data.uv_texture_clone_index"
prop.value = i
@@ -959,7 +959,7 @@ class VIEW3D_MT_tools_projectpaint_stencil(bpy.types.Menu):
layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures):
prop = layout.operator("wm.context_set_int", text=tex.name)
- prop.path = "active_object.data.uv_texture_stencil_index"
+ prop.data_path = "active_object.data.uv_texture_stencil_index"
prop.value = i
diff --git a/source/Makefile b/source/Makefile
index 7a60a92bfcf..2ab5b4faeab 100644
--- a/source/Makefile
+++ b/source/Makefile
@@ -478,7 +478,7 @@ debug debuglink::
clean:: linkclean debuglinkclean
link: $(BINTARGETS)
- @echo "****> Build $(MAKE_START) - `date '+%H:%M:%S %d-%b-%Y'`"
+ @echo "****> Build SVN rev $(BUILD_REV), $(MAKE_START) - `date '+%H:%M:%S %d-%b-%Y'`"
ifdef NANENV
@for n in $(NANENV); do \
echo " $$n"; \
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index e33239293a8..0e0d76f4284 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -71,7 +71,8 @@ void IDP_FreeArray(struct IDProperty *prop);
void IDP_UnlinkArray(struct IDProperty *prop);
/* ---------- String Type ------------ */
-void IDP_AssignString(struct IDProperty *prop, char *st);
+IDProperty *IDP_NewString(const char *st, const char *name, int maxlen);/* maxlen excludes '\0' */
+void IDP_AssignString(struct IDProperty *prop, char *st, int maxlen); /* maxlen excludes '\0' */
void IDP_ConcatStringC(struct IDProperty *prop, char *st);
void IDP_ConcatString(struct IDProperty *str1, struct IDProperty *append);
void IDP_FreeString(struct IDProperty *prop);
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h
index ef7fa473ad0..738fe7dde82 100644
--- a/source/blender/blenkernel/BKE_softbody.h
+++ b/source/blender/blenkernel/BKE_softbody.h
@@ -1,6 +1,6 @@
/**
- * BKE_softbody.h
- *
+ * BKE_softbody.h
+ *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -43,7 +43,7 @@ typedef struct BodyPoint {
int nofsprings; int *springs;
float choke,choke2,frozen;
float colball;
- short flag;
+ short loc_flag; //reserved by locale module specific states
//char octantflag;
float mass;
float springweight;
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c
index 20afc715c77..6044cfa7692 100644
--- a/source/blender/blenkernel/intern/anim.c
+++ b/source/blender/blenkernel/intern/anim.c
@@ -475,7 +475,7 @@ void calc_curvepath(Object *ob)
bl= cu->bev.first;
if(bl==NULL || !bl->nr) return;
- cu->path=path= MEM_callocN(sizeof(Path), "path");
+ cu->path=path= MEM_callocN(sizeof(Path), "calc_curvepath");
/* if POLY: last vertice != first vertice */
cycl= (bl->poly!= -1);
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index a77ac9b8e24..9b49ac9c6ff 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -40,6 +40,7 @@
#include "BKE_DerivedMesh.h"
#include "BKE_global.h"
+#include "BKE_scene.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
#include "BKE_modifier.h"
@@ -1353,10 +1354,13 @@ Object **get_collisionobjects(Scene *scene, Object *self, Group *group, int *num
add_collision_object(&objs, &numobj, &maxobj, go->ob, self, 0);
}
else {
+ Scene *sce; /* for SETLOOPER macro */
/* add objects in same layer in scene */
- for(base = scene->base.first; base; base = base->next)
- if(base->lay & self->lay)
+ for(SETLOOPER(scene, base)) {
+ if(base->lay & self->lay)
add_collision_object(&objs, &numobj, &maxobj, base->object, self, 0);
+
+ }
}
*numcollobj= numobj;
@@ -1400,7 +1404,6 @@ static void add_collider_cache_object(ListBase **objs, Object *ob, Object *self,
ListBase *get_collider_cache(Scene *scene, Object *self, Group *group)
{
- Base *base;
GroupObject *go;
ListBase *objs= NULL;
@@ -1410,9 +1413,15 @@ ListBase *get_collider_cache(Scene *scene, Object *self, Group *group)
add_collider_cache_object(&objs, go->ob, self, 0);
}
else {
- for(base = scene->base.first; base; base = base->next)
- if(!self || (base->lay & self->lay))
+ Scene *sce; /* for SETLOOPER macro */
+ Base *base;
+
+ /* add objects in same layer in scene */
+ for(SETLOOPER(scene, base)) {
+ if(!self || (base->lay & self->lay))
add_collider_cache_object(&objs, base->object, self, 0);
+
+ }
}
return objs;
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index c780971c3fa..e9283ea867e 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -777,7 +777,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
}
if(eff->pd->flag & PFIELD_TEX_OBJECT) {
- mul_mat3_m4_v3(eff->ob->obmat, tex_co);
+ mul_m4_v3(eff->ob->obmat, tex_co);
}
hasrgb = multitex_ext(eff->pd->tex, tex_co, NULL,NULL, 0, result);
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 98b3522059c..2ccb33b088a 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -299,6 +299,34 @@ IDProperty *IDP_CopyArray(IDProperty *prop)
/* ---------- String Type ------------ */
+IDProperty *IDP_NewString(const char *st, const char *name, int maxlen)
+{
+ IDProperty *prop = MEM_callocN(sizeof(IDProperty), "IDProperty string");
+
+ if (st == NULL) {
+ prop->data.pointer = MEM_callocN(DEFAULT_ALLOC_FOR_NULL_STRINGS, "id property string 1");
+ prop->totallen = DEFAULT_ALLOC_FOR_NULL_STRINGS;
+ prop->len = 1; /*NULL string, has len of 1 to account for null byte.*/
+ }
+ else {
+ int stlen = strlen(st);
+
+ if(maxlen > 0 && maxlen < stlen)
+ stlen = maxlen;
+
+ stlen++; /* null terminator '\0' */
+
+ prop->data.pointer = MEM_callocN(stlen, "id property string 2");
+ prop->len = prop->totallen = stlen;
+ BLI_strncpy(prop->data.pointer, st, stlen);
+ }
+
+ prop->type = IDP_STRING;
+ BLI_strncpy(prop->name, name, MAX_IDPROP_NAME);
+
+ return prop;
+}
+
IDProperty *IDP_CopyString(IDProperty *prop)
{
IDProperty *newp = idp_generic_copy(prop);
@@ -312,14 +340,19 @@ IDProperty *IDP_CopyString(IDProperty *prop)
}
-void IDP_AssignString(IDProperty *prop, char *st)
+void IDP_AssignString(IDProperty *prop, char *st, int maxlen)
{
int stlen;
stlen = strlen(st);
- IDP_ResizeArray(prop, stlen+1); /*make room for null byte :) */
- strcpy(prop->data.pointer, st);
+ if(maxlen > 0 && maxlen < stlen)
+ stlen= maxlen;
+
+ stlen++; /* make room for null byte */
+
+ IDP_ResizeArray(prop, stlen);
+ BLI_strncpy(prop->data.pointer, st, stlen);
}
void IDP_ConcatStringC(IDProperty *prop, char *st)
@@ -709,9 +742,6 @@ IDProperty *IDP_New(int type, IDPropertyTemplate val, const char *name)
prop->type = type;
BLI_strncpy(prop->name, name, MAX_IDPROP_NAME);
- /*security null byte*/
- prop->name[MAX_IDPROP_NAME-1] = 0;
-
return prop;
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index ef95139abda..f06e9302a60 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1715,7 +1715,10 @@ static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
/* is there a PackedFile with this image ? */
if (ima->packedfile) {
- ibuf = IMB_ibImageFromMemory((unsigned char*)ima->packedfile->data, ima->packedfile->size, IB_rect|IB_multilayer);
+ flag = IB_rect|IB_multilayer;
+ if(ima->flag & IMA_DO_PREMUL) flag |= IB_premul;
+
+ ibuf = IMB_ibImageFromMemory((unsigned char*)ima->packedfile->data, ima->packedfile->size, flag);
}
else {
flag= IB_rect|IB_multilayer|IB_metadata;
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 53fa7c14730..1954bac7e93 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -845,26 +845,20 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
use_vgroups = 0;
if(vgroup && vgroup[0] && use_vgroups) {
- bDeformGroup *curdef;
Mesh *me = target->data;
- int index = 0;
-
- /* find the group (weak loop-in-loop) */
- for(curdef = target->defbase.first; curdef;
- curdef = curdef->next, index++)
- if(!strcmp(curdef->name, vgroup)) break;
+ int index = defgroup_name_index(target, vgroup);
+ float weight;
- if(curdef && (me->dvert || dm)) {
+ if(index >= 0 && (me->dvert || dm)) {
MDeformVert *dvert = me->dvert;
- int j;
for(a = 0; a < numVerts; a++, dvert++) {
if(dm) dvert = dm->getVertData(dm, a, CD_MDEFORMVERT);
- for(j = 0; j < dvert->totweight; j++) {
- if (dvert->dw[j].def_nr == index) {
- calc_latt_deform(laOb, vertexCos[a], dvert->dw[j].weight);
- }
- }
+
+ weight= defvert_find_weight(dvert, index);
+
+ if(weight > 0.0f)
+ calc_latt_deform(laOb, vertexCos[a], weight);
}
}
} else {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 972c07eb272..10c94ed1eeb 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -337,7 +337,7 @@ void unlink_object(Scene *scene, Object *ob)
ModifierData *md;
ARegion *ar;
RegionView3D *rv3d;
- int a;
+ int a, found;
unlink_controllers(&ob->controllers);
unlink_actuators(&ob->actuators);
@@ -609,27 +609,36 @@ void unlink_object(Scene *scene, Object *ob)
while(sa) {
SpaceLink *sl;
- if (sa->spacetype == SPACE_VIEW3D) {
- for (ar= sa->regionbase.first; ar; ar= ar->next) {
- if (ar->regiontype==RGN_TYPE_WINDOW) {
- rv3d= (RegionView3D *)ar->regiondata;
- if (rv3d->persp == RV3D_CAMOB)
- rv3d->persp= RV3D_PERSP;
- if (rv3d->localvd && rv3d->localvd->persp == RV3D_CAMOB)
- rv3d->localvd->persp= RV3D_PERSP;
- }
- }
- }
-
for (sl= sa->spacedata.first; sl; sl= sl->next) {
if(sl->spacetype==SPACE_VIEW3D) {
View3D *v3d= (View3D*) sl;
+ found= 0;
if(v3d->camera==ob) {
v3d->camera= NULL;
+ found= 1;
}
if(v3d->localvd && v3d->localvd->camera==ob ) {
v3d->localvd->camera= NULL;
+ found += 2;
+ }
+
+ if (found) {
+ if (sa->spacetype == SPACE_VIEW3D) {
+ for (ar= sa->regionbase.first; ar; ar= ar->next) {
+ if (ar->regiontype==RGN_TYPE_WINDOW) {
+ rv3d= (RegionView3D *)ar->regiondata;
+ if (found == 1 || found == 3) {
+ if (rv3d->persp == RV3D_CAMOB)
+ rv3d->persp= RV3D_PERSP;
+ }
+ if (found == 2 || found == 3) {
+ if (rv3d->localvd && rv3d->localvd->persp == RV3D_CAMOB)
+ rv3d->localvd->persp= RV3D_PERSP;
+ }
+ }
+ }
+ }
}
}
else if(sl->spacetype==SPACE_OUTLINER) {
diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c
index dc4a9ee3bdc..db457f043e7 100644
--- a/source/blender/blenkernel/intern/packedFile.c
+++ b/source/blender/blenkernel/intern/packedFile.c
@@ -216,7 +216,7 @@ void packAll(Main *bmain, ReportList *reports)
bSound *sound;
for(ima=bmain->image.first; ima; ima=ima->id.next)
- if(ima->packedfile == NULL && ima->id.lib==NULL && ELEM3(ima->type, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
+ if(ima->packedfile == NULL && ima->id.lib==NULL && ELEM3(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
ima->packedfile = newPackedFile(reports, ima->name);
for(vf=bmain->vfont.first; vf; vf=vf->id.next)
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index ce84ee96d01..aa0ed983154 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3943,7 +3943,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
BKE_animsys_evaluate_animdata(&part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
/* TODO: only free child paths in case of PSYS_RECALC_CHILD */
- if(psys->recalc & PSYS_RECALC)
+ if(psys->recalc & PSYS_RECALC || ob->recalc & OB_RECALC)
psys_free_path_cache(psys, NULL);
if(psys->recalc & PSYS_RECALC_CHILD)
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index d5990ce81ec..173c6c136f2 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -67,7 +67,7 @@ void BKE_reports_init(ReportList *reports, int flag)
memset(reports, 0, sizeof(ReportList));
reports->storelevel= RPT_INFO;
- reports->printlevel= RPT_INFO;
+ reports->printlevel= RPT_ERROR;
reports->flag= flag;
}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index e13264babf4..c85276cd2a2 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -894,68 +894,38 @@ float frame_to_float (Scene *scene, int cfra) /* see also bsystem_time in objec
return ctime;
}
-static void scene_update_newframe(Scene *scene, int cfra, unsigned int lay)
+static void scene_update_tagged_recursive(Scene *scene, Scene *scene_parent)
{
Base *base;
- Object *ob;
- int cfra_back= scene->r.cfra;
- scene->r.cfra= cfra;
-
+
+ /* sets first, we allow per definition current scene to have
+ dependencies on sets, but not the other way around. */
+ if(scene->set)
+ scene_update_tagged_recursive(scene->set, scene_parent);
+
for(base= scene->base.first; base; base= base->next) {
- ob= base->object;
-
- object_handle_update(scene, ob); // bke_object.h
+ Object *ob= base->object;
+
+ object_handle_update(scene_parent, ob);
if(ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
- group_handle_recalc_and_update(scene, ob, ob->dup_group);
-
- /* only update layer when an ipo */
- // XXX old animation system
- //if(ob->ipo && has_ipo_code(ob->ipo, OB_LAY) ) {
- // base->lay= ob->lay;
- //}
+ group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
}
-
- scene->r.cfra= cfra_back;
}
/* this is called in main loop, doing tagged updates before redraw */
void scene_update_tagged(Scene *scene)
{
- Scene *sce;
- Base *base;
- Object *ob;
- float ctime = frame_to_float(scene, scene->r.cfra);
-
scene->physics_settings.quick_cache_step= 0;
/* update all objects: drivers, matrices, displists, etc. flags set
by depgraph or manual, no layer check here, gets correct flushed */
- /* sets first, we allow per definition current scene to have
- dependencies on sets, but not the other way around. */
- if(scene->set) {
- for(SETLOOPER(scene->set, base)) {
- ob= base->object;
-
- object_handle_update(scene, ob);
-
- if(ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
- group_handle_recalc_and_update(scene, ob, ob->dup_group);
- }
- }
-
- for(base= scene->base.first; base; base= base->next) {
- ob= base->object;
-
- object_handle_update(scene, ob);
-
- if(ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
- group_handle_recalc_and_update(scene, ob, ob->dup_group);
- }
+ scene_update_tagged_recursive(scene, scene);
/* recalc scene animation data here (for sequencer) */
{
+ float ctime = frame_to_float(scene, scene->r.cfra);
AnimData *adt= BKE_animdata_from_id(&scene->id);
if(adt && (adt->recalc & ADT_RECALC_ANIM))
@@ -985,7 +955,7 @@ void scene_update_for_newframe(Scene *sce, unsigned int lay)
/* Following 2 functions are recursive
- * so dont call within 'scene_update_newframe' */
+ * so dont call within 'scene_update_tagged_recursive' */
DAG_scene_update_flags(sce, lay); // only stuff that moves or needs display still
/* All 'standard' (i.e. without any dependencies) animation is handled here,
@@ -997,13 +967,8 @@ void scene_update_for_newframe(Scene *sce, unsigned int lay)
BKE_animsys_evaluate_all_animation(G.main, ctime);
/*...done with recusrive funcs */
-
- /* sets first, we allow per definition current scene to have dependencies on sets */
- for(sce_iter= sce->set; sce_iter; sce_iter= sce_iter->set) {
- scene_update_newframe(sce_iter, sce->r.cfra, lay);
- }
-
- scene_update_newframe(sce, sce->r.cfra, lay);
+ /* object_handle_update() on all objects, groups and sets */
+ scene_update_tagged_recursive(sce, sce);
}
/* return default layer, also used to patch old files */
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 3ff7370a443..d1ab63ca65e 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -2194,7 +2194,7 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
seq->scene->markers.first= seq->scene->markers.last= NULL;
#endif
- if(sequencer_view3d_cb && doseq_gl && (seq->scene == scene || have_seq==0)) {
+ if(sequencer_view3d_cb && doseq_gl && (seq->scene == scene || have_seq==0) && seq->scene->camera) {
/* opengl offscreen render */
scene_update_for_newframe(seq->scene, seq->scene->lay);
se->ibuf= sequencer_view3d_cb(seq->scene, seqrectx, seqrecty, scene->r.seq_prev_type);
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index c06e0679a7d..b44fe1ad1d0 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -1,5 +1,5 @@
-/* softbody.c
- *
+/* softbody.c
+ *
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
@@ -32,17 +32,17 @@
******
variables on the UI for now
- float mediafrict; friction to env
- float nodemass; softbody mass of *vertex*
- float grav; softbody amount of gravitaion to apply
-
- float goalspring; softbody goal springs
- float goalfrict; softbody goal springs friction
- float mingoal; quick limits for goal
+ float mediafrict; friction to env
+ float nodemass; softbody mass of *vertex*
+ float grav; softbody amount of gravitaion to apply
+
+ float goalspring; softbody goal springs
+ float goalfrict; softbody goal springs friction
+ float mingoal; quick limits for goal
float maxgoal;
- float inspring; softbody inner springs
- float infrict; softbody inner springs friction
+ float inspring; softbody inner springs
+ float infrict; softbody inner springs friction
*****
*/
@@ -83,7 +83,7 @@ static int (*SB_localInterruptCallBack)(void) = NULL;
/* ********** soft body engine ******* */
-typedef enum {SB_EDGE=1,SB_BEND=2,SB_STIFFQUAD=3} type_spring;
+typedef enum {SB_EDGE=1,SB_BEND=2,SB_STIFFQUAD=3,SB_HANDLE=4} type_spring;
typedef struct BodySpring {
int v1, v2;
@@ -136,12 +136,12 @@ typedef struct SB_thread_context {
int tot;
}SB_thread_context;
-#define NLF_BUILD 1
-#define NLF_SOLVE 2
+#define NLF_BUILD 1
+#define NLF_SOLVE 2
#define MID_PRESERVE 1
-#define SOFTGOALSNAP 0.999f
+#define SOFTGOALSNAP 0.999f
/* if bp-> goal is above make it a *forced follow original* and skip all ODE stuff for this bp
removes *unnecessary* stiffnes from ODE system
*/
@@ -149,7 +149,11 @@ typedef struct SB_thread_context {
#define BSF_INTERSECT 1 /* edge intersects collider face */
-#define SBF_DOFUZZY 1 /* edge intersects collider face */
+
+/* private definitions for bodypoint states */
+#define SBF_DOFUZZY 1 /* Bodypoint do fuzzy */
+#define SBF_OUTOFCOLLISION 2 /* Bodypoint does not collide */
+
#define BFF_INTERSECT 1 /* collider edge intrudes face */
#define BFF_CLOSEVERT 2 /* collider vertex repulses face */
@@ -187,15 +191,15 @@ static float sb_time_scale(Object *ob)
{
SoftBody *sb= ob->soft; /* is supposed to be there */
if (sb){
- return(sb->physics_speed);
- /*hrms .. this could be IPO as well :)
+ return(sb->physics_speed);
+ /*hrms .. this could be IPO as well :)
estimated range [0.001 sluggish slug - 100.0 very fast (i hope ODE solver can handle that)]
1 approx = a unit 1 pendulum at g = 9.8 [earth conditions] has period 65 frames
- theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM)
+ theory would give a 50 frames period .. so there must be something inaccurate .. looking for that (BM)
*/
}
return (1.0f);
- /*
+ /*
this would be frames/sec independant timing assuming 25 fps is default
but does not work very well with NLA
return (25.0f/scene->r.frs_sec)
@@ -206,10 +210,10 @@ static float sb_time_scale(Object *ob)
/* helper functions for everything is animatable jow_go_for2_5 +++++++*/
/* introducing them here, because i know: steps in properties ( at frame timing )
will cause unwanted responses of the softbody system (which does inter frame calculations )
- so first 'cure' would be: interpolate linear in time ..
+ so first 'cure' would be: interpolate linear in time ..
Q: why do i write this?
A: because it happend once, that some eger coder 'streamlined' code to fail.
- We DO linear interpolation for goals .. and i think we should do on animated properties as well
+ We DO linear interpolation for goals .. and i think we should do on animated properties as well
*/
/* animate sb->maxgoal,sb->mingoal */
@@ -221,7 +225,7 @@ static float _final_goal(Object *ob,BodyPoint *bp)/*jow_go_for2_5 */
if(!(ob->softflag & OB_SB_GOAL)) return (0.0f);
if (sb&&bp){
if (bp->goal < 0.0f) return (0.0f);
- f = sb->mingoal + bp->goal*ABS(sb->maxgoal - sb->mingoal);
+ f = sb->mingoal + bp->goal*ABS(sb->maxgoal - sb->mingoal);
f = pow(f, 4.0f);
return (f);
}
@@ -247,15 +251,15 @@ static float _final_mass(Object *ob,BodyPoint *bp)
/********************
for each target object/face the axis aligned bounding box (AABB) is stored
-faces paralell to global axes
+faces paralell to global axes
so only simple "value" in [min,max] ckecks are used
float operations still
*/
/* just an ID here to reduce the prob for killing objects
** ob->sumohandle points to we should not kill :)
-*/
-const int CCD_SAVETY = 190561;
+*/
+const int CCD_SAVETY = 190561;
typedef struct ccdf_minmax{
float minx,miny,minz,maxx,maxy,maxz;
@@ -285,11 +289,11 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
MFace *mface=NULL;
float v[3],hull;
int i;
-
+
/* first some paranoia checks */
if (!dm) return NULL;
if (!dm->getNumVerts(dm) || !dm->getNumFaces(dm)) return NULL;
-
+
pccd_M = MEM_mallocN(sizeof(ccd_Mesh),"ccd_Mesh");
pccd_M->totvert = dm->getNumVerts(dm);
pccd_M->totface = dm->getNumFaces(dm);
@@ -297,32 +301,32 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
pccd_M->bbmin[0]=pccd_M->bbmin[1]=pccd_M->bbmin[2]=1e30f;
pccd_M->bbmax[0]=pccd_M->bbmax[1]=pccd_M->bbmax[2]=-1e30f;
pccd_M->mprevvert=NULL;
-
-
+
+
/* blow it up with forcefield ranges */
hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft);
-
+
/* alloc and copy verts*/
pccd_M->mvert = dm->dupVertArray(dm);
- /* ah yeah, put the verices to global coords once */
- /* and determine the ortho BB on the fly */
+ /* ah yeah, put the verices to global coords once */
+ /* and determine the ortho BB on the fly */
for(i=0; i < pccd_M->totvert; i++){
mul_m4_v3(ob->obmat, pccd_M->mvert[i].co);
-
+
/* evaluate limits */
VECCOPY(v,pccd_M->mvert[i].co);
pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
-
+
pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0],v[0]+hull);
pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1],v[1]+hull);
pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
-
+
}
/* alloc and copy faces*/
pccd_M->mface = dm->dupFaceArray(dm);
-
+
/* OBBs for idea1 */
pccd_M->mima = MEM_mallocN(sizeof(ccdf_minmax)*pccd_M->totface,"ccd_Mesh_Faces_mima");
mima = pccd_M->mima;
@@ -333,7 +337,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
for(i=0; i < pccd_M->totface; i++){
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
-
+
VECCOPY(v,pccd_M->mvert[mface->v1].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -341,7 +345,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
VECCOPY(v,pccd_M->mvert[mface->v2].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -349,7 +353,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
VECCOPY(v,pccd_M->mvert[mface->v3].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -357,7 +361,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
if(mface->v4){
VECCOPY(v,pccd_M->mvert[mface->v4].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
@@ -368,10 +372,10 @@ static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm)
mima->maxz = MAX2(mima->maxz,v[2]+hull);
}
-
+
mima++;
mface++;
-
+
}
return pccd_M;
}
@@ -381,7 +385,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
MFace *mface=NULL;
float v[3],hull;
int i;
-
+
/* first some paranoia checks */
if (!dm) return ;
if (!dm->getNumVerts(dm) || !dm->getNumFaces(dm)) return ;
@@ -391,27 +395,27 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
pccd_M->bbmin[0]=pccd_M->bbmin[1]=pccd_M->bbmin[2]=1e30f;
pccd_M->bbmax[0]=pccd_M->bbmax[1]=pccd_M->bbmax[2]=-1e30f;
-
-
+
+
/* blow it up with forcefield ranges */
hull = MAX2(ob->pd->pdef_sbift,ob->pd->pdef_sboft);
-
+
/* rotate current to previous */
if(pccd_M->mprevvert) MEM_freeN(pccd_M->mprevvert);
pccd_M->mprevvert = pccd_M->mvert;
/* alloc and copy verts*/
pccd_M->mvert = dm->dupVertArray(dm);
- /* ah yeah, put the verices to global coords once */
- /* and determine the ortho BB on the fly */
+ /* ah yeah, put the verices to global coords once */
+ /* and determine the ortho BB on the fly */
for(i=0; i < pccd_M->totvert; i++){
mul_m4_v3(ob->obmat, pccd_M->mvert[i].co);
-
+
/* evaluate limits */
VECCOPY(v,pccd_M->mvert[i].co);
pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
-
+
pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0],v[0]+hull);
pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1],v[1]+hull);
pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
@@ -421,13 +425,13 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
-
+
pccd_M->bbmax[0] = MAX2(pccd_M->bbmax[0],v[0]+hull);
pccd_M->bbmax[1] = MAX2(pccd_M->bbmax[1],v[1]+hull);
pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
-
+
}
-
+
mima = pccd_M->mima;
mface = pccd_M->mface;
@@ -436,7 +440,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
for(i=0; i < pccd_M->totface; i++){
mima->minx=mima->miny=mima->minz=1e30f;
mima->maxx=mima->maxy=mima->maxz=-1e30f;
-
+
VECCOPY(v,pccd_M->mvert[mface->v1].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -444,7 +448,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
VECCOPY(v,pccd_M->mvert[mface->v2].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -452,7 +456,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
VECCOPY(v,pccd_M->mvert[mface->v3].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -460,7 +464,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
if(mface->v4){
VECCOPY(v,pccd_M->mvert[mface->v4].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
@@ -479,7 +483,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
VECCOPY(v,pccd_M->mprevvert[mface->v2].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -487,7 +491,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
VECCOPY(v,pccd_M->mprevvert[mface->v3].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
mima->miny = MIN2(mima->miny,v[1]-hull);
@@ -495,7 +499,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxx = MAX2(mima->maxx,v[0]+hull);
mima->maxy = MAX2(mima->maxy,v[1]+hull);
mima->maxz = MAX2(mima->maxz,v[2]+hull);
-
+
if(mface->v4){
VECCOPY(v,pccd_M->mprevvert[mface->v4].co);
mima->minx = MIN2(mima->minx,v[0]-hull);
@@ -506,10 +510,10 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm)
mima->maxz = MAX2(mima->maxz,v[2]+hull);
}
-
+
mima++;
mface++;
-
+
}
return ;
}
@@ -537,7 +541,7 @@ static void ccd_build_deflector_hash(Scene *scene, Object *vertexowner, GHash *h
if(base->object->type==OB_MESH && (base->lay & vertexowner->lay)) {
ob= base->object;
if((vertexowner) && (ob == vertexowner)) {
- /* if vertexowner is given we don't want to check collision with owner object */
+ /* if vertexowner is given we don't want to check collision with owner object */
base = base->next;
continue;
}
@@ -557,11 +561,11 @@ static void ccd_build_deflector_hash(Scene *scene, Object *vertexowner, GHash *h
/* we did copy & modify all we need so give 'em away again */
dm->release(dm);
-
+
}
}/*--- only with deflecting set */
- }/* mesh && layer*/
+ }/* mesh && layer*/
base = base->next;
} /* while (base) */
}
@@ -576,16 +580,16 @@ static void ccd_update_deflector_hash(Scene *scene, Object *vertexowner, GHash *
/*Only proceed for mesh object in same layer */
if(base->object->type==OB_MESH && (base->lay & vertexowner->lay)) {
ob= base->object;
- if(ob == vertexowner){
- /* if vertexowner is given we don't want to check collision with owner object */
+ if(ob == vertexowner){
+ /* if vertexowner is given we don't want to check collision with owner object */
base = base->next;
- continue;
+ continue;
}
/*+++ only with deflecting set */
if(ob->pd && ob->pd->deflect) {
DerivedMesh *dm= NULL;
-
+
if(ob->softflag & OB_SB_COLLFINAL) { /* so maybe someone wants overkill to collide with subsurfed */
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
} else {
@@ -601,7 +605,7 @@ static void ccd_update_deflector_hash(Scene *scene, Object *vertexowner, GHash *
}
}/*--- only with deflecting set */
- }/* mesh && layer*/
+ }/* mesh && layer*/
base = base->next;
} /* while (base) */
}
@@ -616,12 +620,12 @@ static int count_mesh_quads(Mesh *me)
{
int a,result = 0;
MFace *mface= me->mface;
-
+
if(mface) {
for(a=me->totface; a>0; a--, mface++) {
if(mface->v4) result++;
}
- }
+ }
return result;
}
@@ -632,21 +636,21 @@ static void add_mesh_quad_diag_springs(Object *ob)
BodyPoint *bp;
BodySpring *bs, *bs_new;
int a ;
-
+
if (ob->soft){
int nofquads;
//float s_shear = ob->soft->shearstiff*ob->soft->shearstiff;
-
+
nofquads = count_mesh_quads(me);
if (nofquads) {
/* resize spring-array to hold additional quad springs */
bs_new= MEM_callocN( (ob->soft->totspring + nofquads *2 )*sizeof(BodySpring), "bodyspring");
memcpy(bs_new,ob->soft->bspring,(ob->soft->totspring )*sizeof(BodySpring));
-
+
if(ob->soft->bspring)
MEM_freeN(ob->soft->bspring); /* do this before reassigning the pointer or have a 1st class memory leak */
- ob->soft->bspring = bs_new;
-
+ ob->soft->bspring = bs_new;
+
/* fill the tail */
a = 0;
bs = bs_new+ob->soft->totspring;
@@ -662,11 +666,11 @@ static void add_mesh_quad_diag_springs(Object *ob)
bs->v2= mface->v4;
bs->springtype =SB_STIFFQUAD;
bs++;
-
+
}
- }
+ }
}
-
+
/* now we can announce new springs */
ob->soft->totspring += nofquads *2;
}
@@ -677,7 +681,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad
{
/*assume we have a softbody*/
SoftBody *sb= ob->soft; /* is supposed to be there */
- BodyPoint *bp,*bpo;
+ BodyPoint *bp,*bpo;
BodySpring *bs,*bs2,*bs3= NULL;
int a,b,c,notthis= 0,v0;
if (!sb->bspring){return;} /* we are 2nd order here so 1rst should have been build :) */
@@ -692,7 +696,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad
bs = sb->bspring + bp->springs[b-1];
/*nasty thing here that springs have two ends
so here we have to make sure we examine the other */
- if (( v0 == bs->v1) ){
+ if (( v0 == bs->v1) ){
bpo =sb->bpoint+bs->v2;
notthis = bs->v2;
}
@@ -700,7 +704,7 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad
if (( v0 == bs->v2) ){
bpo =sb->bpoint+bs->v1;
notthis = bs->v1;
- }
+ }
else {printf("oops we should not get here - add_2nd_order_springs");}
}
if (bpo){/* so now we have a 2nd order humpdidump */
@@ -726,9 +730,9 @@ static void add_2nd_order_roller(Object *ob,float stiffness,int *counter, int ad
}
}
-
+
}
-
+
}
/*scan for neighborhood done*/
}
@@ -740,17 +744,17 @@ static void add_2nd_order_springs(Object *ob,float stiffness)
int counter = 0;
BodySpring *bs_new;
stiffness *=stiffness;
-
+
add_2nd_order_roller(ob,stiffness,&counter,0); /* counting */
if (counter) {
/* resize spring-array to hold additional springs */
bs_new= MEM_callocN( (ob->soft->totspring + counter )*sizeof(BodySpring), "bodyspring");
memcpy(bs_new,ob->soft->bspring,(ob->soft->totspring )*sizeof(BodySpring));
-
+
if(ob->soft->bspring)
- MEM_freeN(ob->soft->bspring);
- ob->soft->bspring = bs_new;
-
+ MEM_freeN(ob->soft->bspring);
+ ob->soft->bspring = bs_new;
+
add_2nd_order_roller(ob,stiffness,&counter,1); /* adding */
ob->soft->totspring +=counter ;
}
@@ -759,7 +763,7 @@ static void add_2nd_order_springs(Object *ob,float stiffness)
static void add_bp_springlist(BodyPoint *bp,int springID)
{
int *newlist;
-
+
if (bp->springs == NULL) {
bp->springs = MEM_callocN( sizeof(int), "bpsprings");
bp->springs[0] = springID;
@@ -781,35 +785,35 @@ it is O(N^2) so scanning for springs every iteration is too expensive
static void build_bps_springlist(Object *ob)
{
SoftBody *sb= ob->soft; /* is supposed to be there */
- BodyPoint *bp;
- BodySpring *bs;
+ BodyPoint *bp;
+ BodySpring *bs;
int a,b;
-
+
if (sb==NULL) return; /* paranoya check */
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
/* throw away old list */
if (bp->springs) {
MEM_freeN(bp->springs);
bp->springs=NULL;
}
- /* scan for attached inner springs */
+ /* scan for attached inner springs */
for(b=sb->totspring, bs= sb->bspring; b>0; b--, bs++) {
- if (( (sb->totpoint-a) == bs->v1) ){
+ if (( (sb->totpoint-a) == bs->v1) ){
add_bp_springlist(bp,sb->totspring -b);
}
- if (( (sb->totpoint-a) == bs->v2) ){
+ if (( (sb->totpoint-a) == bs->v2) ){
add_bp_springlist(bp,sb->totspring -b);
}
}/*for springs*/
- }/*for bp*/
+ }/*for bp*/
}
static void calculate_collision_balls(Object *ob)
{
SoftBody *sb= ob->soft; /* is supposed to be there */
- BodyPoint *bp;
- BodySpring *bs;
+ BodyPoint *bp;
+ BodySpring *bs;
int a,b,akku_count;
float min,max,akku;
@@ -850,12 +854,12 @@ static void calculate_collision_balls(Object *ob)
}
}
else bp->colball=0;
- }/*for bp*/
+ }/*for bp*/
}
/* creates new softbody if didn't exist yet, makes new points and springs arrays */
-static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring)
+static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring)
{
SoftBody *sb;
int i;
@@ -864,38 +868,38 @@ static void renew_softbody(Scene *scene, Object *ob, int totpoint, int totspring
else free_softbody_intern(ob->soft);
sb= ob->soft;
softflag=ob->softflag;
-
+
if(totpoint) {
sb->totpoint= totpoint;
sb->totspring= totspring;
-
+
sb->bpoint= MEM_mallocN( totpoint*sizeof(BodyPoint), "bodypoint");
- if(totspring)
+ if(totspring)
sb->bspring= MEM_mallocN( totspring*sizeof(BodySpring), "bodyspring");
/* initialise BodyPoint array */
for (i=0; i<totpoint; i++) {
BodyPoint *bp = &sb->bpoint[i];
-
+
/* hum as far as i see this is overridden by _final_goal() now jow_go_for2_5 */
/* sadly breaks compatibility with older versions */
- /* but makes goals behave the same for meshes, lattices and curves */
+ /* but makes goals behave the same for meshes, lattices and curves */
if(softflag & OB_SB_GOAL) {
bp->goal= sb->defgoal;
}
- else {
- bp->goal= 0.0f;
+ else {
+ bp->goal= 0.0f;
/* so this will definily be below SOFTGOALSNAP */
}
-
+
bp->nofsprings= 0;
bp->springs= NULL;
bp->choke = 0.0f;
bp->choke2 = 0.0f;
bp->frozen = 1.0f;
bp->colball = 0.0f;
- bp->flag = 0;
+ bp->loc_flag = 0;
bp->springweight = 1.0f;
bp->mass = 1.0f;
}
@@ -912,7 +916,7 @@ static void free_softbody_baked(SoftBody *sb)
if(key) MEM_freeN(key);
}
if(sb->keys) MEM_freeN(sb->keys);
-
+
sb->keys= NULL;
sb->totkey= 0;
}
@@ -934,7 +938,7 @@ static void free_scratch(SoftBody *sb)
MEM_freeN(sb->scratch);
sb->scratch = NULL;
}
-
+
}
/* only frees internal data */
@@ -943,19 +947,19 @@ static void free_softbody_intern(SoftBody *sb)
if(sb) {
int a;
BodyPoint *bp;
-
+
if(sb->bpoint){
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- /* free spring list */
+ /* free spring list */
if (bp->springs != NULL) {
MEM_freeN(bp->springs);
}
}
MEM_freeN(sb->bpoint);
}
-
+
if(sb->bspring) MEM_freeN(sb->bspring);
-
+
sb->totpoint= sb->totspring= 0;
sb->bpoint= NULL;
sb->bspring= NULL;
@@ -968,28 +972,28 @@ static void free_softbody_intern(SoftBody *sb)
/* ************ dynamics ********** */
-/* the most general (micro physics correct) way to do collision
-** (only needs the current particle position)
+/* the most general (micro physics correct) way to do collision
+** (only needs the current particle position)
**
-** it actually checks if the particle intrudes a short range force field generated
+** it actually checks if the particle intrudes a short range force field generated
** by the faces of the target object and returns a force to drive the particel out
** the strenght of the field grows exponetially if the particle is on the 'wrong' side of the face
** 'wrong' side : projection to the face normal is negative (all referred to a vertex in the face)
**
-** flaw of this: 'fast' particles as well as 'fast' colliding faces
-** give a 'tunnel' effect such that the particle passes through the force field
-** without ever 'seeing' it
+** flaw of this: 'fast' particles as well as 'fast' colliding faces
+** give a 'tunnel' effect such that the particle passes through the force field
+** without ever 'seeing' it
** this is fully compliant to heisenberg: h >= fuzzy(location) * fuzzy(time)
** besides our h is way larger than in QM because forces propagate way slower here
** we have to deal with fuzzy(time) in the range of 1/25 seconds (typical frame rate)
-** yup collision targets are not known here any better
+** yup collision targets are not known here any better
** and 1/25 second is looong compared to real collision events
-** Q: why not use 'simple' collision here like bouncing back a particle
+** Q: why not use 'simple' collision here like bouncing back a particle
** --> reverting is velocity on the face normal
-** A: because our particles are not alone here
-** and need to tell their neighbours exactly what happens via spring forces
+** A: because our particles are not alone here
+** and need to tell their neighbours exactly what happens via spring forces
** unless sbObjectStep( .. ) is called on sub frame timing level
-** BTW that also questions the use of a 'implicit' solvers on softbodies
+** BTW that also questions the use of a 'implicit' solvers on softbodies
** since that would only valid for 'slow' moving collision targets and dito particles
*/
@@ -1006,10 +1010,10 @@ static void Vec3PlusStVec(float *v, float s, float *v1)
static int are_there_deflectors(Scene *scene, unsigned int layer)
{
Base *base;
-
+
for(base = scene->base.first; base; base= base->next) {
if( (base->lay & layer) && base->object->pd) {
- if(base->object->pd->deflect)
+ if(base->object->pd->deflect)
return 1;
}
}
@@ -1055,17 +1059,17 @@ static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_laye
mprevvert= ccdm->mprevvert;
mima= ccdm->mima;
a = ccdm->totface;
-
- if ((aabbmax[0] < ccdm->bbmin[0]) ||
+
+ if ((aabbmax[0] < ccdm->bbmin[0]) ||
(aabbmax[1] < ccdm->bbmin[1]) ||
(aabbmax[2] < ccdm->bbmin[2]) ||
- (aabbmin[0] > ccdm->bbmax[0]) ||
- (aabbmin[1] > ccdm->bbmax[1]) ||
+ (aabbmin[0] > ccdm->bbmax[0]) ||
+ (aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes dont intersect */
BLI_ghashIterator_step(ihash);
- continue;
- }
+ continue;
+ }
/* so now we have the 2 boxes overlapping */
/* forces actually not used */
@@ -1076,19 +1080,19 @@ static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_laye
/*aye that should be cached*/
printf("missing cache error \n");
BLI_ghashIterator_step(ihash);
- continue;
+ continue;
}
} /* if(ob->pd && ob->pd->deflect) */
BLI_ghashIterator_step(ihash);
} /* while () */
BLI_ghashIterator_free(ihash);
- return deflected;
+ return deflected;
}
/* --- the aabb section*/
/* +++ the face external section*/
-static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp,
+static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp,
float force[3], unsigned int par_layer,struct Object *vertexowner,float time)
{
Object *ob;
@@ -1124,33 +1128,33 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
MVert *mprevvert= NULL;
if(ccdm){
mvert= ccdm->mvert;
- a = ccdm->totvert;
- mprevvert= ccdm->mprevvert;
+ a = ccdm->totvert;
+ mprevvert= ccdm->mprevvert;
outerfacethickness =ob->pd->pdef_sboft;
- if ((aabbmax[0] < ccdm->bbmin[0]) ||
+ if ((aabbmax[0] < ccdm->bbmin[0]) ||
(aabbmax[1] < ccdm->bbmin[1]) ||
(aabbmax[2] < ccdm->bbmin[2]) ||
- (aabbmin[0] > ccdm->bbmax[0]) ||
- (aabbmin[1] > ccdm->bbmax[1]) ||
+ (aabbmin[0] > ccdm->bbmax[0]) ||
+ (aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes dont intersect */
BLI_ghashIterator_step(ihash);
- continue;
- }
+ continue;
+ }
}
else{
/*aye that should be cached*/
printf("missing cache error \n");
BLI_ghashIterator_step(ihash);
- continue;
+ continue;
}
/* use mesh*/
if (mvert) {
while(a){
- VECCOPY(nv1,mvert[a-1].co);
+ VECCOPY(nv1,mvert[a-1].co);
if(mprevvert){
mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[a-1].co);
@@ -1182,11 +1186,11 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
BLI_ghashIterator_step(ihash);
} /* while () */
BLI_ghashIterator_free(ihash);
- return deflected;
+ return deflected;
}
-static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp,
+static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp,
float force[3], unsigned int par_layer,struct Object *vertexowner,float time)
{
Object *ob;
@@ -1221,36 +1225,36 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
mprevvert= ccdm->mprevvert;
mima= ccdm->mima;
a = ccdm->totface;
-
- if ((aabbmax[0] < ccdm->bbmin[0]) ||
+
+ if ((aabbmax[0] < ccdm->bbmin[0]) ||
(aabbmax[1] < ccdm->bbmin[1]) ||
(aabbmax[2] < ccdm->bbmin[2]) ||
- (aabbmin[0] > ccdm->bbmax[0]) ||
- (aabbmin[1] > ccdm->bbmax[1]) ||
+ (aabbmin[0] > ccdm->bbmax[0]) ||
+ (aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes dont intersect */
BLI_ghashIterator_step(ihash);
- continue;
- }
+ continue;
+ }
}
else{
/*aye that should be cached*/
printf("missing cache error \n");
BLI_ghashIterator_step(ihash);
- continue;
+ continue;
}
/* use mesh*/
while (a--) {
if (
- (aabbmax[0] < mima->minx) ||
- (aabbmin[0] > mima->maxx) ||
+ (aabbmax[0] < mima->minx) ||
+ (aabbmin[0] > mima->maxx) ||
(aabbmax[1] < mima->miny) ||
- (aabbmin[1] > mima->maxy) ||
+ (aabbmin[1] > mima->maxy) ||
(aabbmax[2] < mima->minz) ||
- (aabbmin[2] > mima->maxz)
+ (aabbmin[2] > mima->maxz)
) {
mface++;
mima++;
@@ -1260,7 +1264,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
if (mvert){
- VECCOPY(nv1,mvert[mface->v1].co);
+ VECCOPY(nv1,mvert[mface->v1].co);
VECCOPY(nv2,mvert[mface->v2].co);
VECCOPY(nv3,mvert[mface->v3].co);
if (mface->v4){
@@ -1269,18 +1273,18 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
if (mprevvert){
mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
-
+
mul_v3_fl(nv2,time);
Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
-
+
mul_v3_fl(nv3,time);
Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
-
+
if (mface->v4){
mul_v3_fl(nv4,time);
Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
}
- }
+ }
}
/* switch origin to be nv2*/
@@ -1288,7 +1292,7 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
VECSUB(edge2, nv3, nv2);
cross_v3_v3v3(d_nvect, edge2, edge1);
normalize_v3(d_nvect);
- if (
+ if (
isect_line_tri_v3(nv1, nv2, face_v1, face_v2, face_v3, &t, NULL) ||
isect_line_tri_v3(nv2, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
isect_line_tri_v3(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL) ){
@@ -1299,10 +1303,10 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
if (mface->v4){ /* quad */
/* switch origin to be nv4 */
VECSUB(edge1, nv3, nv4);
- VECSUB(edge2, nv1, nv4);
+ VECSUB(edge2, nv1, nv4);
cross_v3_v3v3(d_nvect, edge2, edge1);
- normalize_v3(d_nvect);
- if (
+ normalize_v3(d_nvect);
+ if (
/* isect_line_tri_v3(nv1, nv3, face_v1, face_v2, face_v3, &t, NULL) ||
we did that edge already */
isect_line_tri_v3(nv3, nv4, face_v1, face_v2, face_v3, &t, NULL) ||
@@ -1313,13 +1317,13 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
}
}
mface++;
- mima++;
- }/* while a */
+ mima++;
+ }/* while a */
} /* if(ob->pd && ob->pd->deflect) */
BLI_ghashIterator_step(ihash);
} /* while () */
BLI_ghashIterator_free(ihash);
- return deflected;
+ return deflected;
}
@@ -1329,20 +1333,20 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
SoftBody *sb = ob->soft;
BodyFace *bf;
int a;
- float damp=0.0f,choke=1.0f;
+ float damp=0.0f,choke=1.0f;
float tune = -10.0f;
float feedback[3];
-
+
if (sb && sb->scratch->totface){
-
-
+
+
bf = sb->scratch->bodyface;
for(a=0; a<sb->scratch->totface; a++, bf++) {
- bf->ext_force[0]=bf->ext_force[1]=bf->ext_force[2]=0.0f;
+ bf->ext_force[0]=bf->ext_force[1]=bf->ext_force[2]=0.0f;
/*+++edges intruding*/
- bf->flag &= ~BFF_INTERSECT;
+ bf->flag &= ~BFF_INTERSECT;
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
+ if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
&damp, feedback, ob->lay ,ob , timenow)){
Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
Vec3PlusStVec(sb->bpoint[bf->v2].force,tune,feedback);
@@ -1353,7 +1357,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
}
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if ((bf->v4) && (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
+ if ((bf->v4) && (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
&damp, feedback, ob->lay ,ob , timenow))){
Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback);
@@ -1369,7 +1373,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
bf->flag &= ~BFF_CLOSEVERT;
tune = -1.0f;
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
+ if (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v2].pos, sb->bpoint[bf->v3].pos,
&damp, feedback, ob->lay ,ob , timenow)){
Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
Vec3PlusStVec(sb->bpoint[bf->v2].force,tune,feedback);
@@ -1380,7 +1384,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
}
feedback[0]=feedback[1]=feedback[2]=0.0f;
- if ((bf->v4) && (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
+ if ((bf->v4) && (sb_detect_face_pointCached(sb->bpoint[bf->v1].pos,sb->bpoint[bf->v3].pos, sb->bpoint[bf->v4].pos,
&damp, feedback, ob->lay ,ob , timenow))){
Vec3PlusStVec(sb->bpoint[bf->v1].force,tune,feedback);
Vec3PlusStVec(sb->bpoint[bf->v3].force,tune,feedback);
@@ -1402,7 +1406,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
if (bf->v4){
sb->bpoint[bf->v2].choke2=MAX2(sb->bpoint[bf->v2].choke2,choke);
}
- }
+ }
}
}
}
@@ -1412,7 +1416,7 @@ static void scan_for_ext_face_forces(Object *ob,float timenow)
/* +++ the spring external section*/
-static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp,
+static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp,
float force[3], unsigned int par_layer,struct Object *vertexowner,float time)
{
Object *ob;
@@ -1449,36 +1453,36 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
mprevvert= ccdm->mprevvert;
mima= ccdm->mima;
a = ccdm->totface;
-
- if ((aabbmax[0] < ccdm->bbmin[0]) ||
+
+ if ((aabbmax[0] < ccdm->bbmin[0]) ||
(aabbmax[1] < ccdm->bbmin[1]) ||
(aabbmax[2] < ccdm->bbmin[2]) ||
- (aabbmin[0] > ccdm->bbmax[0]) ||
- (aabbmin[1] > ccdm->bbmax[1]) ||
+ (aabbmin[0] > ccdm->bbmax[0]) ||
+ (aabbmin[1] > ccdm->bbmax[1]) ||
(aabbmin[2] > ccdm->bbmax[2]) ) {
- /* boxes dont intersect */
+ /* boxes dont intersect */
BLI_ghashIterator_step(ihash);
- continue;
- }
+ continue;
+ }
}
else{
/*aye that should be cached*/
printf("missing cache error \n");
BLI_ghashIterator_step(ihash);
- continue;
+ continue;
}
/* use mesh*/
while (a--) {
if (
- (aabbmax[0] < mima->minx) ||
- (aabbmin[0] > mima->maxx) ||
+ (aabbmax[0] < mima->minx) ||
+ (aabbmin[0] > mima->maxx) ||
(aabbmax[1] < mima->miny) ||
- (aabbmin[1] > mima->maxy) ||
+ (aabbmin[1] > mima->maxy) ||
(aabbmax[2] < mima->minz) ||
- (aabbmin[2] > mima->maxz)
+ (aabbmin[2] > mima->maxz)
) {
mface++;
mima++;
@@ -1488,7 +1492,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
if (mvert){
- VECCOPY(nv1,mvert[mface->v1].co);
+ VECCOPY(nv1,mvert[mface->v1].co);
VECCOPY(nv2,mvert[mface->v2].co);
VECCOPY(nv3,mvert[mface->v3].co);
if (mface->v4){
@@ -1497,18 +1501,18 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
if (mprevvert){
mul_v3_fl(nv1,time);
Vec3PlusStVec(nv1,(1.0f-time),mprevvert[mface->v1].co);
-
+
mul_v3_fl(nv2,time);
Vec3PlusStVec(nv2,(1.0f-time),mprevvert[mface->v2].co);
-
+
mul_v3_fl(nv3,time);
Vec3PlusStVec(nv3,(1.0f-time),mprevvert[mface->v3].co);
-
+
if (mface->v4){
mul_v3_fl(nv4,time);
Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
}
- }
+ }
}
/* switch origin to be nv2*/
@@ -1535,7 +1539,7 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
VECSUB(edge2, nv1, nv4);
cross_v3_v3v3(d_nvect, edge2, edge1);
- normalize_v3(d_nvect);
+ normalize_v3(d_nvect);
if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)){
float v1[3],v2[3];
float intrusiondepth,i1,i2;
@@ -1552,26 +1556,26 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
}
}
mface++;
- mima++;
- }/* while a */
+ mima++;
+ }/* while a */
} /* if(ob->pd && ob->pd->deflect) */
BLI_ghashIterator_step(ihash);
} /* while () */
BLI_ghashIterator_free(ihash);
- return deflected;
+ return deflected;
}
static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow, int ifirst, int ilast, struct ListBase *do_effector)
{
SoftBody *sb = ob->soft;
int a;
- float damp;
+ float damp;
float feedback[3];
if (sb && sb->totspring){
for(a=ifirst; a<ilast; a++) {
BodySpring *bs = &sb->bspring[a];
- bs->ext_force[0]=bs->ext_force[1]=bs->ext_force[2]=0.0f;
+ bs->ext_force[0]=bs->ext_force[1]=bs->ext_force[2]=0.0f;
feedback[0]=feedback[1]=feedback[2]=0.0f;
bs->flag &= ~BSF_INTERSECT;
@@ -1590,10 +1594,10 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
/* ---- springs colliding */
/* +++ springs seeing wind ... n stuff depending on their orientation*/
- /* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/
+ /* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/
if(sb->aeroedge){
float vel[3],sp[3],pr[3],force[3];
- float f,windfactor = 0.25f;
+ float f,windfactor = 0.25f;
/*see if we have wind*/
if(do_effector) {
EffectedPoint epoint;
@@ -1604,7 +1608,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
pd_point_from_soft(scene, pos, vel, -1, &epoint);
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
- mul_v3_fl(speed,windfactor);
+ mul_v3_fl(speed,windfactor);
add_v3_v3(vel, speed);
}
/* media in rest */
@@ -1614,7 +1618,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
f = normalize_v3(vel);
f = -0.0001f*f*f*sb->aeroedge;
/* (todo) add a nice angle dependant function done for now BUT */
- /* still there could be some nice drag/lift function, but who needs it */
+ /* still there could be some nice drag/lift function, but who needs it */
VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
project_v3_v3v3(pr,vel,sp);
@@ -1624,7 +1628,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
normalize_v3(sp);
Vec3PlusStVec(bs->ext_force,f*(1.0f-ABS(dot_v3v3(vel,sp))),vel);
}
- else{
+ else{
Vec3PlusStVec(bs->ext_force,f,vel); // to keep compatible with 2.45 release files
}
}
@@ -1638,8 +1642,8 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
static void scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow)
{
SoftBody *sb = ob->soft;
- ListBase *do_effector = NULL;
-
+ ListBase *do_effector = NULL;
+
do_effector = pdInitEffectors(scene, ob, NULL, sb->effector_weights);
if (sb){
_scan_for_ext_spring_forces(scene, ob, timenow, 0, sb->totspring, do_effector);
@@ -1652,11 +1656,11 @@ static void *exec_scan_for_ext_spring_forces(void *data)
SB_thread_context *pctx = (SB_thread_context*)data;
_scan_for_ext_spring_forces(pctx->scene, pctx->ob, pctx->timenow, pctx->ifirst, pctx->ilast, pctx->do_effector);
return 0;
-}
+}
static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,int totsprings,int *ptr_to_break_func())
{
- ListBase *do_effector = NULL;
+ ListBase *do_effector = NULL;
ListBase threads;
SB_thread_context *sb_threads;
int i, totthread,left,dec;
@@ -1680,16 +1684,16 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,
dec = totsprings/totthread +1;
for(i=0; i<totthread; i++) {
sb_threads[i].scene = scene;
- sb_threads[i].ob = ob;
- sb_threads[i].forcetime = 0.0; // not used here
- sb_threads[i].timenow = timenow;
- sb_threads[i].ilast = left;
+ sb_threads[i].ob = ob;
+ sb_threads[i].forcetime = 0.0; // not used here
+ sb_threads[i].timenow = timenow;
+ sb_threads[i].ilast = left;
left = left - dec;
if (left >0){
sb_threads[i].ifirst = left;
}
else
- sb_threads[i].ifirst = 0;
+ sb_threads[i].ifirst = 0;
sb_threads[i].do_effector = do_effector;
sb_threads[i].do_deflector = 0;// not used here
sb_threads[i].fieldfactor = 0.0f;// not used here
@@ -1709,7 +1713,7 @@ static void sb_sfesf_threads_run(Scene *scene, struct Object *ob, float timenow,
exec_scan_for_ext_spring_forces(&sb_threads[0]);
/* clean up */
MEM_freeN(sb_threads);
-
+
pdEndEffectors(&do_effector);
}
@@ -1733,10 +1737,10 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl
mindist = cp;
winner =3;
}
- switch (winner){
- case 1: VECCOPY(w,ca); break;
- case 2: VECCOPY(w,cb); break;
- case 3: VECCOPY(w,cc);
+ switch (winner){
+ case 1: VECCOPY(w,ca); break;
+ case 2: VECCOPY(w,cb); break;
+ case 3: VECCOPY(w,cc);
}
return(winner);
}
@@ -1751,7 +1755,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
GHash *hash;
GHashIterator *ihash;
float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3],d_nvect[3], dv1[3],ve[3],avel[3]={0.0,0.0,0.0},
- vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
+ vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
outerforceaccu[3],innerforceaccu[3],
facedist,n_mag,force_mag_norm,minx,miny,minz,maxx,maxy,maxz,
innerfacethickness = -0.5f, outerfacethickness = 0.2f,
@@ -1782,30 +1786,30 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
mima= ccdm->mima;
a = ccdm->totface;
- minx =ccdm->bbmin[0];
- miny =ccdm->bbmin[1];
+ minx =ccdm->bbmin[0];
+ miny =ccdm->bbmin[1];
minz =ccdm->bbmin[2];
- maxx =ccdm->bbmax[0];
- maxy =ccdm->bbmax[1];
- maxz =ccdm->bbmax[2];
+ maxx =ccdm->bbmax[0];
+ maxy =ccdm->bbmax[1];
+ maxz =ccdm->bbmax[2];
- if ((opco[0] < minx) ||
+ if ((opco[0] < minx) ||
(opco[1] < miny) ||
(opco[2] < minz) ||
- (opco[0] > maxx) ||
- (opco[1] > maxy) ||
+ (opco[0] > maxx) ||
+ (opco[1] > maxy) ||
(opco[2] > maxz) ) {
- /* outside the padded boundbox --> collision object is too far away */
+ /* outside the padded boundbox --> collision object is too far away */
BLI_ghashIterator_step(ihash);
- continue;
- }
+ continue;
+ }
}
else{
/*aye that should be cached*/
printf("missing cache error \n");
BLI_ghashIterator_step(ihash);
- continue;
+ continue;
}
/* do object level stuff */
@@ -1819,12 +1823,12 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
/* use mesh*/
while (a--) {
if (
- (opco[0] < mima->minx) ||
- (opco[0] > mima->maxx) ||
+ (opco[0] < mima->minx) ||
+ (opco[0] > mima->maxx) ||
(opco[1] < mima->miny) ||
- (opco[1] > mima->maxy) ||
+ (opco[1] > mima->maxy) ||
(opco[2] < mima->minz) ||
- (opco[2] > mima->maxz)
+ (opco[2] > mima->maxz)
) {
mface++;
mima++;
@@ -1833,7 +1837,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
if (mvert){
- VECCOPY(nv1,mvert[mface->v1].co);
+ VECCOPY(nv1,mvert[mface->v1].co);
VECCOPY(nv2,mvert[mface->v2].co);
VECCOPY(nv3,mvert[mface->v3].co);
if (mface->v4){
@@ -1842,7 +1846,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
if (mprevvert){
/* grab the average speed of the collider vertices
- before we spoil nvX
+ before we spoil nvX
humm could be done once a SB steps but then we' need to store that too
since the AABB reduced propabitlty to get here drasticallly
it might be a nice tradeof CPU <--> memory
@@ -1867,9 +1871,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
mul_v3_fl(nv4,time);
Vec3PlusStVec(nv4,(1.0f-time),mprevvert[mface->v4].co);
}
- }
+ }
}
-
+
/* switch origin to be nv2*/
VECSUB(edge1, nv1, nv2);
VECSUB(edge2, nv3, nv2);
@@ -1881,7 +1885,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
// so rules are
//
- if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
+ if ((facedist > innerfacethickness) && (facedist < outerfacethickness)){
if (isect_point_tri_prism_v3(opco, nv1, nv2, nv3) ){
force_mag_norm =(float)exp(-ee*facedist);
if (facedist > outerfacethickness*ff)
@@ -1905,7 +1909,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
*intrusion += facedist;
ci++;
}
- }
+ }
if (mface->v4){ /* quad */
/* switch origin to be nv4 */
VECSUB(edge1, nv3, nv4);
@@ -1948,7 +1952,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
float dist;
closest_to_line_segment_v3(ve, opco, nv1, nv2);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
@@ -1957,7 +1961,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
closest_to_line_segment_v3(ve, opco, nv2, nv3);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
@@ -1966,7 +1970,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
closest_to_line_segment_v3(ve, opco, nv3, nv1);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
@@ -1975,7 +1979,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
if (mface->v4){ /* quad */
closest_to_line_segment_v3(ve, opco, nv3, nv4);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
@@ -1984,22 +1988,22 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
}
closest_to_line_segment_v3(ve, opco, nv1, nv4);
- VECSUB(ve,opco,ve);
+ VECSUB(ve,opco,ve);
dist = normalize_v3(ve);
if ((dist < outerfacethickness)&&(dist < mindistedge )){
VECCOPY(coledge,ve);
mindistedge = dist,
deflected=1;
}
-
+
}
}
}
mface++;
- mima++;
- }/* while a */
+ mima++;
+ }/* while a */
} /* if(ob->pd && ob->pd->deflect) */
BLI_ghashIterator_step(ihash);
} /* while () */
@@ -2026,11 +2030,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
if (cavel) mul_v3_fl(avel,1.0f/(float)cavel);
VECCOPY(vel,avel);
if (ci) *intrusion /= ci;
- if (deflected){
+ if (deflected){
VECCOPY(facenormal,force);
normalize_v3(facenormal);
}
- return deflected;
+ return deflected;
}
@@ -2038,7 +2042,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
static int sb_deflect_face(Object *ob,float *actpos,float *facenormal,float *force,float *cf,float time,float *vel,float *intrusion)
{
float s_actpos[3];
- int deflected;
+ int deflected;
VECCOPY(s_actpos,actpos);
deflected= sb_detect_vertex_collisionCached(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
//deflected= sb_detect_vertex_collisionCachedEx(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
@@ -2047,7 +2051,7 @@ static int sb_deflect_face(Object *ob,float *actpos,float *facenormal,float *for
/* hiding this for now .. but the jacobian may pop up on other tasks .. so i'd like to keep it
static void dfdx_spring(int ia, int ic, int op, float dir[3],float L,float len,float factor)
-{
+{
float m,delta_ij;
int i ,j;
if (L < len){
@@ -2069,13 +2073,13 @@ static void dfdx_spring(int ia, int ic, int op, float dir[3],float L,float len,f
static void dfdx_goal(int ia, int ic, int op, float factor)
-{
+{
int i;
for(i=0;i<3;i++) nlMatrixAdd(ia+i,op+ic+i,factor);
}
static void dfdv_goal(int ia, int ic,float factor)
-{
+{
int i;
for(i=0;i<3;i++) nlMatrixAdd(ia+i,ic+i,factor);
}
@@ -2125,13 +2129,14 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo
kw = kw * kw;
switch (bs->springtype){
case SB_EDGE:
- forcefactor *= kw;
+ case SB_HANDLE:
+ forcefactor *= kw;
break;
case SB_BEND:
- forcefactor *=sb->secondspring*kw;
+ forcefactor *=sb->secondspring*kw;
break;
case SB_STIFFQUAD:
- forcefactor *=sb->shearstiff*sb->shearstiff* kw;
+ forcefactor *=sb->shearstiff*sb->shearstiff* kw;
break;
default:
break;
@@ -2153,12 +2158,12 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo
//int op =3*sb->totpoint;
//float mvel = -forcetime*kd;
//float mpos = -forcetime*forcefactor;
- /* depending on my pos */
+ /* depending on my pos */
// dfdx_spring(ia,ia,op,dir,bs->len,distance,-mpos);
/* depending on my vel */
// dfdv_goal(ia,ia,mvel); // well that ignores geometie
if(bp2->goal < SOFTGOALSNAP){ /* ommit this bp when it snaps */
- /* depending on other pos */
+ /* depending on other pos */
// dfdx_spring(ia,ic,op,dir,bs->len,distance,mpos);
/* depending on other vel */
// dfdv_goal(ia,ia,-mvel); // well that ignores geometie
@@ -2177,7 +2182,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
int number_of_points_here = ilast - ifirst;
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
-
+
/* intitialize */
if (sb) {
/* check conditions for various options */
@@ -2200,7 +2205,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* debugerin */
- bp = &sb->bpoint[ifirst];
+ bp = &sb->bpoint[ifirst];
for(bb=number_of_points_here; bb>0; bb--, bp++) {
/* clear forces accumulator */
bp->force[0]= bp->force[1]= bp->force[2]= 0.0;
@@ -2209,7 +2214,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
if(do_selfcollision){
int attached;
BodyPoint *obp;
- BodySpring *bs;
+ BodySpring *bs;
int c,b;
float velcenter[3],dvel[3],def[3];
float distance;
@@ -2217,7 +2222,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
float bstune = sb->ballstiff;
for(c=sb->totpoint, obp= sb->bpoint; c>=ifirst+bb; c--, obp++) {
- compare = (obp->colball + bp->colball);
+ compare = (obp->colball + bp->colball);
sub_v3_v3v3(def, bp->pos, obp->pos);
/* rather check the AABBoxes before ever calulating the real distance */
/* mathematically it is completly nuts, but performace is pretty much (3) times faster */
@@ -2255,7 +2260,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* naive ball self collision done */
if(_final_goal(ob,bp) < SOFTGOALSNAP){ /* ommit this bp when it snaps */
- float auxvect[3];
+ float auxvect[3];
float velgoal[3];
/* do goal stuff */
@@ -2272,7 +2277,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
sub_v3_v3v3(velgoal,bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob) ;
add_v3_v3v3(auxvect,velgoal,bp->vec);
-
+
if (forcetime > 0.0 ) { /* make sure friction does not become rocket motor on time reversal */
bp->force[0]-= kd * (auxvect[0]);
bp->force[1]-= kd * (auxvect[1]);
@@ -2285,15 +2290,15 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
}
}
/* done goal stuff */
-
+
/* gravitation */
- if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
+ if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
float gravity[3];
VECCOPY(gravity, scene->physics_settings.gravity);
mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob,bp)*sb->effector_weights->global_gravity); /* individual mass of node here */
add_v3_v3(bp->force, gravity);
}
-
+
/* particle field & vortex */
if(do_effector) {
EffectedPoint epoint;
@@ -2303,22 +2308,22 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */
pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint-bp, &epoint);
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
-
+
/* apply forcefield*/
- mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
+ mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
VECADD(bp->force, bp->force, force);
-
- /* BP friction in moving media */
- kd= sb->mediafrict* eval_sb_fric_force_scale;
+
+ /* BP friction in moving media */
+ kd= sb->mediafrict* eval_sb_fric_force_scale;
bp->force[0] -= kd * (bp->vec[0] + windfactor*speed[0]/eval_sb_fric_force_scale);
bp->force[1] -= kd * (bp->vec[1] + windfactor*speed[1]/eval_sb_fric_force_scale);
bp->force[2] -= kd * (bp->vec[2] + windfactor*speed[2]/eval_sb_fric_force_scale);
/* now we'll have nice centrifugal effect for vortex */
-
+
}
else {
/* BP friction in media (not) moving*/
- float kd = sb->mediafrict* sb_fric_force_scale(ob);
+ float kd = sb->mediafrict* sb_fric_force_scale(ob);
/* assume it to be proportional to actual velocity */
bp->force[0]-= bp->vec[0]*kd;
bp->force[1]-= bp->vec[1]*kd;
@@ -2328,22 +2333,22 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
/* +++cached collision targets */
bp->choke = 0.0f;
bp->choke2 = 0.0f;
- bp->flag &= ~SBF_DOFUZZY;
- if(do_deflector) {
+ bp->loc_flag &= ~SBF_DOFUZZY;
+ if(do_deflector && !(bp->loc_flag & SBF_OUTOFCOLLISION) ) {
float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion;
float kd = 1.0f;
if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){
if (intrusion < 0.0f){
sb->scratch->flag |= SBF_DOFUZZY;
- bp->flag |= SBF_DOFUZZY;
+ bp->loc_flag |= SBF_DOFUZZY;
bp->choke = sb->choke*0.01f;
}
VECSUB(cfforce,bp->vec,vel);
Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
-
- Vec3PlusStVec(bp->force,kd,defforce);
+
+ Vec3PlusStVec(bp->force,kd,defforce);
}
}
@@ -2354,19 +2359,19 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
if(ob->softflag & OB_SB_EDGES) {
if (sb->bspring){ /* spring list exists at all ? */
int b;
- BodySpring *bs;
+ BodySpring *bs;
for(b=bp->nofsprings;b>0;b--){
bs = sb->bspring + bp->springs[b-1];
if (do_springcollision || do_aero){
add_v3_v3(bp->force, bs->ext_force);
if (bs->flag & BSF_INTERSECT)
- bp->choke = bs->cf;
+ bp->choke = bs->cf;
}
// sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags)
sb_spring_force(ob,ilast-bb,bs,iks,forcetime,0);
}/* loop springs */
- }/* existing spring list */
+ }/* existing spring list */
}/*any edges*/
/* ---springs */
}/*omit on snap */
@@ -2379,7 +2384,7 @@ static void *exec_softbody_calc_forces(void *data)
SB_thread_context *pctx = (SB_thread_context*)data;
_softbody_calc_forces_slice_in_a_thread(pctx->scene, pctx->ob, pctx->forcetime, pctx->timenow, pctx->ifirst, pctx->ilast, NULL, pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor);
return 0;
-}
+}
static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float timenow,int totpoint,int *ptr_to_break_func(),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor)
{
@@ -2406,16 +2411,16 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t
dec = totpoint/totthread +1;
for(i=0; i<totthread; i++) {
sb_threads[i].scene = scene;
- sb_threads[i].ob = ob;
- sb_threads[i].forcetime = forcetime;
- sb_threads[i].timenow = timenow;
- sb_threads[i].ilast = left;
+ sb_threads[i].ob = ob;
+ sb_threads[i].forcetime = forcetime;
+ sb_threads[i].timenow = timenow;
+ sb_threads[i].ilast = left;
left = left - dec;
if (left >0){
sb_threads[i].ifirst = left;
}
else
- sb_threads[i].ifirst = 0;
+ sb_threads[i].ifirst = 0;
sb_threads[i].do_effector = do_effector;
sb_threads[i].do_deflector = do_deflector;
sb_threads[i].fieldfactor = fieldfactor;
@@ -2441,30 +2446,30 @@ static void sb_cf_threads_run(Scene *scene, Object *ob, float forcetime, float t
static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, float timenow, int nl_flags)
{
-/* rule we never alter free variables :bp->vec bp->pos in here !
- * this will ruin adaptive stepsize AKA heun! (BM)
+/* rule we never alter free variables :bp->vec bp->pos in here !
+ * this will ruin adaptive stepsize AKA heun! (BM)
*/
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bproot;
ListBase *do_effector = NULL;
float iks, gravity;
- float fieldfactor = -1.0f, windfactor = 0.25;
+ float fieldfactor = -1.0f, windfactor = 0.25;
int do_deflector,do_selfcollision,do_springcollision,do_aero;
-
- gravity = sb->grav * sb_grav_force_scale(ob);
-
+
+ gravity = sb->grav * sb_grav_force_scale(ob);
+
/* check conditions for various options */
do_deflector= query_external_colliders(scene, ob);
do_selfcollision=((ob->softflag & OB_SB_EDGES) && (sb->bspring)&& (ob->softflag & OB_SB_SELF));
do_springcollision=do_deflector && (ob->softflag & OB_SB_EDGES) &&(ob->softflag & OB_SB_EDGECOLL);
do_aero=((sb->aeroedge)&& (ob->softflag & OB_SB_EDGES));
-
+
iks = 1.0f/(1.0f-sb->inspring)-1.0f ;/* inner spring constants function */
bproot= sb->bpoint; /* need this for proper spring addressing */
-
- if (do_springcollision || do_aero)
- sb_sfesf_threads_run(scene, ob, timenow,sb->totspring,NULL);
-
+
+ if (do_springcollision || do_aero)
+ sb_sfesf_threads_run(scene, ob, timenow,sb->totspring,NULL);
+
/* after spring scan because it uses Effoctors too */
do_effector= pdInitEffectors(scene, ob, NULL, sb->effector_weights);
@@ -2477,7 +2482,7 @@ static void softbody_calc_forcesEx(Scene *scene, Object *ob, float forcetime, fl
/* finally add forces caused by face collision */
if (ob->softflag & OB_SB_FACECOLL) scan_for_ext_face_forces(ob,timenow);
-
+
/* finish matrix and solve */
pdEndEffectors(&do_effector);
}
@@ -2497,20 +2502,20 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* |||||||||||||||||||||||||| */
/* VVVVVVVVVVVVVVVVVVVVVVVVVV */
/*backward compatibility note:
- fixing bug [17428] which forces adaptive step size to tiny steps
- in some situations
+ fixing bug [17428] which forces adaptive step size to tiny steps
+ in some situations
.. keeping G.rt==17 0x11 option for old files 'needing' the bug*/
- /* rule we never alter free variables :bp->vec bp->pos in here !
- * this will ruin adaptive stepsize AKA heun! (BM)
+ /* rule we never alter free variables :bp->vec bp->pos in here !
+ * this will ruin adaptive stepsize AKA heun! (BM)
*/
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
BodyPoint *bproot;
- BodySpring *bs;
+ BodySpring *bs;
ListBase *do_effector = NULL;
float iks, ks, kd, gravity[3] = {0.0f,0.0f,0.0f};
- float fieldfactor = -1.0f, windfactor = 0.25f;
+ float fieldfactor = -1.0f, windfactor = 0.25f;
float tune = sb->ballstiff;
int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero;
@@ -2525,10 +2530,10 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
*/
- if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
+ if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
VECCOPY(gravity, scene->physics_settings.gravity);
mul_v3_fl(gravity, sb_grav_force_scale(ob)*sb->effector_weights->global_gravity);
- }
+ }
/* check conditions for various options */
do_deflector= query_external_colliders(scene, ob);
@@ -2554,7 +2559,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if(nl_flags & NLF_BUILD){
//int ia =3*(sb->totpoint-a);
//int op =3*sb->totpoint;
- /* dF/dV = v */
+ /* dF/dV = v */
/* jacobioan
nlMatrixAdd(op+ia,ia,-forcetime);
nlMatrixAdd(op+ia+1,ia+1,-forcetime);
@@ -2586,7 +2591,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
//if ((bp->octantflag & obp->octantflag) == 0) continue;
- compare = (obp->colball + bp->colball);
+ compare = (obp->colball + bp->colball);
sub_v3_v3v3(def, bp->pos, obp->pos);
/* rather check the AABBoxes before ever calulating the real distance */
@@ -2630,11 +2635,11 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/*TODO sit down an X-out the true jacobian entries*/
/*well does not make to much sense because the eigenvalues
of the jacobian go negative; and negative eigenvalues
- on a complex iterative system z(n+1)=A * z(n)
+ on a complex iterative system z(n+1)=A * z(n)
give imaginary roots in the charcateristic polynom
- --> solutions that to z(t)=u(t)* exp ( i omega t) --> oscilations we don't want here
+ --> solutions that to z(t)=u(t)* exp ( i omega t) --> oscilations we don't want here
where u(t) is a unknown amplitude function (worst case rising fast)
- */
+ */
}
/* exploit force(a,b) == -force(b,a) part2/2 */
@@ -2652,7 +2657,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* naive ball self collision done */
if(_final_goal(ob,bp) < SOFTGOALSNAP){ /* ommit this bp when it snaps */
- float auxvect[3];
+ float auxvect[3];
float velgoal[3];
/* do goal stuff */
@@ -2667,7 +2672,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if(nl_flags & NLF_BUILD){
//int ia =3*(sb->totpoint-a);
//int op =3*(sb->totpoint);
- /* depending on my pos */
+ /* depending on my pos */
//dfdx_goal(ia,ia,op,ks*forcetime);
}
@@ -2684,7 +2689,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if(nl_flags & NLF_BUILD){
//int ia =3*(sb->totpoint-a);
normalize_v3(auxvect);
- /* depending on my vel */
+ /* depending on my vel */
//dfdv_goal(ia,ia,kd*forcetime);
}
@@ -2712,11 +2717,11 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
/* apply forcefield*/
- mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
+ mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
VECADD(bp->force, bp->force, force);
- /* BP friction in moving media */
- kd= sb->mediafrict* eval_sb_fric_force_scale;
+ /* BP friction in moving media */
+ kd= sb->mediafrict* eval_sb_fric_force_scale;
bp->force[0] -= kd * (bp->vec[0] + windfactor*speed[0]/eval_sb_fric_force_scale);
bp->force[1] -= kd * (bp->vec[1] + windfactor*speed[1]/eval_sb_fric_force_scale);
bp->force[2] -= kd * (bp->vec[2] + windfactor*speed[2]/eval_sb_fric_force_scale);
@@ -2725,7 +2730,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
}
else {
/* BP friction in media (not) moving*/
- kd= sb->mediafrict* sb_fric_force_scale(ob);
+ kd= sb->mediafrict* sb_fric_force_scale(ob);
/* assume it to be proportional to actual velocity */
bp->force[0]-= bp->vec[0]*kd;
bp->force[1]-= bp->vec[1]*kd;
@@ -2733,7 +2738,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* friction in media done */
if(nl_flags & NLF_BUILD){
//int ia =3*(sb->totpoint-a);
- /* da/dv = */
+ /* da/dv = */
// nlMatrixAdd(ia,ia,forcetime*kd);
// nlMatrixAdd(ia+1,ia+1,forcetime*kd);
@@ -2744,7 +2749,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
/* +++cached collision targets */
bp->choke = 0.0f;
bp->choke2 = 0.0f;
- bp->flag &= ~SBF_DOFUZZY;
+ bp->loc_flag &= ~SBF_DOFUZZY;
if(do_deflector) {
float cfforce[3],defforce[3] ={0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}, facenormal[3], cf = 1.0f,intrusion;
kd = 1.0f;
@@ -2752,15 +2757,15 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (sb_deflect_face(ob,bp->pos,facenormal,defforce,&cf,timenow,vel,&intrusion)){
if ((!nl_flags)&&(intrusion < 0.0f)){
if(G.rt & 0x01){ // 17 we did check for bit 0x10 before
- /*fixing bug [17428] this forces adaptive step size to tiny steps
+ /*fixing bug [17428] this forces adaptive step size to tiny steps
in some situations .. keeping G.rt==17 option for old files 'needing' the bug
*/
- /*bjornmose: uugh.. what an evil hack
- violation of the 'don't touch bp->pos in here' rule
+ /*bjornmose: uugh.. what an evil hack
+ violation of the 'don't touch bp->pos in here' rule
but works nice, like this-->
we predict the solution beeing out of the collider
in heun step No1 and leave the heun step No2 adapt to it
- so we kind of introduced a implicit solver for this case
+ so we kind of introduced a implicit solver for this case
*/
Vec3PlusStVec(bp->pos,-intrusion,facenormal);
}
@@ -2772,7 +2777,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
sb->scratch->flag |= SBF_DOFUZZY;
- bp->flag |= SBF_DOFUZZY;
+ bp->loc_flag |= SBF_DOFUZZY;
bp->choke = sb->choke*0.01f;
}
else{
@@ -2801,14 +2806,14 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
if (do_springcollision || do_aero){
add_v3_v3(bp->force, bs->ext_force);
if (bs->flag & BSF_INTERSECT)
- bp->choke = bs->cf;
+ bp->choke = bs->cf;
}
// sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float forcetime,int nl_flags)
// rather remove nl_falgs from code .. will make things a lot cleaner
sb_spring_force(ob,sb->totpoint-a,bs,iks,forcetime,0);
}/* loop springs */
- }/* existing spring list */
+ }/* existing spring list */
}/*any edges*/
/* ---springs */
}/*omit on snap */
@@ -2833,7 +2838,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
nlEnd(NL_SYSTEM);
if ((G.rt == 32) && (nl_flags & NLF_BUILD))
- {
+ {
printf("####MEE#####\n");
nlPrintMatrix();
}
@@ -2905,7 +2910,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
int a,fuzzy=0;
forcetime *= sb_time_scale(ob);
-
+
aabbmin[0]=aabbmin[1]=aabbmin[2] = 1e20f;
aabbmax[0]=aabbmax[1]=aabbmax[2] = -1e20f;
@@ -2915,7 +2920,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
if (sb->nodemass > 0.009999f) timeovermass = forcetime/sb->nodemass;
else timeovermass = forcetime/0.009999f;
*/
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
/* now we have individual masses */
/* claim a minimum mass for vertex */
@@ -2926,14 +2931,14 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
if(_final_goal(ob,bp) < SOFTGOALSNAP){
/* this makes t~ = t */
if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec);
-
+
/* so here is (v)' = a(cceleration) = sum(F_springs)/m + gravitation + some friction forces + more forces*/
/* the ( ... )' operator denotes derivate respective time */
/* the euler step for velocity then becomes */
- /* v(t + dt) = v(t) + a(t) * dt */
+ /* v(t + dt) = v(t) + a(t) * dt */
mul_v3_fl(bp->force,timeovermass);/* individual mass of node here */
/* some nasty if's to have heun in here too */
- VECCOPY(dv,bp->force);
+ VECCOPY(dv,bp->force);
if (mode == 1){
VECCOPY(bp->prevvec, bp->vec);
@@ -2957,7 +2962,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* so here is (x)'= v(elocity) */
/* the euler step for location then becomes */
- /* x(t + dt) = x(t) + v(t~) * dt */
+ /* x(t + dt) = x(t) + v(t~) * dt */
mul_v3_fl(dx,forcetime);
/* the freezer coming sooner or later */
@@ -2975,7 +2980,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
VECCOPY(bp->prevpos,bp->pos);
VECCOPY(bp->prevdx ,dx);
}
-
+
if (mode ==2){
bp->pos[0] = bp->prevpos[0] + 0.5f * ( dx[0] + bp->prevdx[0]);
bp->pos[1] = bp->prevpos[1] + 0.5f * ( dx[1] + bp->prevdx[1]);
@@ -2984,9 +2989,9 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
maxerrpos = MAX2(maxerrpos,ABS(dx[1] - bp->prevdx[1]));
maxerrpos = MAX2(maxerrpos,ABS(dx[2] - bp->prevdx[2]));
-/* bp->choke is set when we need to pull a vertex or edge out of the collider.
- the collider object signals to get out by pushing hard. on the other hand
- we don't want to end up in deep space so we add some <viscosity>
+/* bp->choke is set when we need to pull a vertex or edge out of the collider.
+ the collider object signals to get out by pushing hard. on the other hand
+ we don't want to end up in deep space so we add some <viscosity>
to balance that out */
if (bp->choke2 > 0.0f){
mul_v3_fl(bp->vec,(1.0f - bp->choke2));
@@ -3005,7 +3010,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
aabbmax[0] = MAX2(aabbmax[0],bp->pos[0]);
aabbmax[1] = MAX2(aabbmax[1],bp->pos[1]);
aabbmax[2] = MAX2(aabbmax[2],bp->pos[2]);
- if (bp->flag & SBF_DOFUZZY) fuzzy =1;
+ if (bp->loc_flag & SBF_DOFUZZY) fuzzy =1;
} /*for*/
if (sb->totpoint) mul_v3_fl(cm,1.0f/sb->totpoint);
@@ -3013,7 +3018,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
VECCOPY(sb->scratch->aabbmin,aabbmin);
VECCOPY(sb->scratch->aabbmax,aabbmax);
}
-
+
if (err){ /* so step size will be controlled by biggest difference in slope */
if (sb->solverflags & SBSO_OLDERR)
*err = MAX2(maxerrpos,maxerrvel);
@@ -3032,7 +3037,7 @@ static void softbody_restore_prev_step(Object *ob)
SoftBody *sb= ob->soft; /* is supposed to be there*/
BodyPoint *bp;
int a;
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
VECCOPY(bp->vec, bp->prevvec);
VECCOPY(bp->pos, bp->prevpos);
@@ -3045,7 +3050,7 @@ static void softbody_store_step(Object *ob)
SoftBody *sb= ob->soft; /* is supposed to be there*/
BodyPoint *bp;
int a;
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
VECCOPY(bp->prevvec,bp->vec);
VECCOPY(bp->prevpos,bp->pos);
@@ -3060,12 +3065,12 @@ static void softbody_store_state(Object *ob,float *ppos,float *pvel)
BodyPoint *bp;
int a;
float *pp=ppos,*pv=pvel;
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-
- VECCOPY(pv, bp->vec);
+
+ VECCOPY(pv, bp->vec);
pv+=3;
-
+
VECCOPY(pp, bp->pos);
pp+=3;
}
@@ -3078,12 +3083,12 @@ static void softbody_retrieve_state(Object *ob,float *ppos,float *pvel)
BodyPoint *bp;
int a;
float *pp=ppos,*pv=pvel;
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-
- VECCOPY(bp->vec,pv);
+
+ VECCOPY(bp->vec,pv);
pv+=3;
-
+
VECCOPY(bp->pos,pp);
pp+=3;
}
@@ -3097,17 +3102,17 @@ static void softbody_swap_state(Object *ob,float *ppos,float *pvel)
int a;
float *pp=ppos,*pv=pvel;
float temp[3];
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-
- VECCOPY(temp, bp->vec);
- VECCOPY(bp->vec,pv);
- VECCOPY(pv,temp);
+
+ VECCOPY(temp, bp->vec);
+ VECCOPY(bp->vec,pv);
+ VECCOPY(pv,temp);
pv+=3;
-
+
VECCOPY(temp, bp->pos);
- VECCOPY(bp->pos,pp);
- VECCOPY(pp,temp);
+ VECCOPY(bp->pos,pp);
+ VECCOPY(pp,temp);
pp+=3;
}
}
@@ -3116,8 +3121,8 @@ static void softbody_swap_state(Object *ob,float *ppos,float *pvel)
/* care for bodypoints taken out of the 'ordinary' solver step
** because they are screwed to goal by bolts
-** they just need to move along with the goal in time
-** we need to adjust them on sub frame timing in solver
+** they just need to move along with the goal in time
+** we need to adjust them on sub frame timing in solver
** so now when frame is done .. put 'em to the position at the end of frame
*/
static void softbody_apply_goalsnap(Object *ob)
@@ -3125,12 +3130,12 @@ static void softbody_apply_goalsnap(Object *ob)
SoftBody *sb= ob->soft; /* is supposed to be there */
BodyPoint *bp;
int a;
-
+
for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
if (_final_goal(ob,bp) >= SOFTGOALSNAP){
VECCOPY(bp->prevpos,bp->pos);
VECCOPY(bp->pos,bp->origT);
- }
+ }
}
}
@@ -3165,20 +3170,20 @@ static void interpolate_exciter(Object *ob, int timescale, int time)
BodyPoint *bp;
float f;
int a;
-
+
f = (float)time/(float)timescale;
-
- for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
- bp->origT[0] = bp->origS[0] + f*(bp->origE[0] - bp->origS[0]);
- bp->origT[1] = bp->origS[1] + f*(bp->origE[1] - bp->origS[1]);
- bp->origT[2] = bp->origS[2] + f*(bp->origE[2] - bp->origS[2]);
+
+ for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
+ bp->origT[0] = bp->origS[0] + f*(bp->origE[0] - bp->origS[0]);
+ bp->origT[1] = bp->origS[1] + f*(bp->origE[1] - bp->origS[1]);
+ bp->origT[2] = bp->origS[2] + f*(bp->origE[2] - bp->origS[2]);
if (_final_goal(ob,bp) >= SOFTGOALSNAP){
bp->vec[0] = bp->origE[0] - bp->origS[0];
bp->vec[1] = bp->origE[1] - bp->origS[1];
bp->vec[2] = bp->origE[2] - bp->origS[2];
}
}
-
+
}
@@ -3191,13 +3196,13 @@ static void interpolate_exciter(Object *ob, int timescale, int time)
static void get_scalar_from_vertexgroup(Object *ob, int vertID, short groupindex, float *target)
/* result 0 on success, else indicates error number
-- kind of *inverse* result defintion,
--- but this way we can signal error condition to caller
+-- but this way we can signal error condition to caller
-- and yes this function must not be here but in a *vertex group module*
*/
{
MDeformVert *dv= NULL;
int i;
-
+
/* spot the vert in deform vert list at mesh */
if(ob->type==OB_MESH) {
Mesh *me= ob->data;
@@ -3218,10 +3223,10 @@ static void get_scalar_from_vertexgroup(Object *ob, int vertID, short groupindex
}
}
}
-}
+}
-/* Resetting a Mesh SB object's springs */
-/* Spring lenght are caculted from'raw' mesh vertices that are NOT altered by modifier stack. */
+/* Resetting a Mesh SB object's springs */
+/* Spring lenght are caculted from'raw' mesh vertices that are NOT altered by modifier stack. */
static void springs_from_mesh(Object *ob)
{
SoftBody *sb;
@@ -3229,21 +3234,21 @@ static void springs_from_mesh(Object *ob)
BodyPoint *bp;
int a;
float scale =1.0f;
-
- sb= ob->soft;
+
+ sb= ob->soft;
if (me && sb)
- {
+ {
/* using bp->origS as a container for spring calcualtions here
- ** will be overwritten sbObjectStep() to receive
+ ** will be overwritten sbObjectStep() to receive
** actual modifier stack positions
*/
- if(me->totvert) {
+ if(me->totvert) {
bp= ob->soft->bpoint;
for(a=0; a<me->totvert; a++, bp++) {
- VECCOPY(bp->origS, me->mvert[a].co);
+ VECCOPY(bp->origS, me->mvert[a].co);
mul_m4_v3(ob->obmat, bp->origS);
}
-
+
}
/* recalculate spring length for meshes here */
/* public version shrink to fit */
@@ -3271,21 +3276,21 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
int a, totedge;
if (ob->softflag & OB_SB_EDGES) totedge= me->totedge;
else totedge= 0;
-
+
/* renew ends with ob->soft with points and edges, also checks & makes ob->soft */
renew_softbody(scene, ob, me->totvert, totedge);
-
+
/* we always make body points */
- sb= ob->soft;
+ sb= ob->soft;
bp= sb->bpoint;
-
+
for(a=0; a<me->totvert; a++, bp++) {
/* get scalar values needed *per vertex* from vertex group functions,
- so we can *paint* them nicly ..
+ so we can *paint* them nicly ..
they are normalized [0.0..1.0] so may be we need amplitude for scale
- which can be done by caller but still .. i'd like it to go this way
- */
-
+ which can be done by caller but still .. i'd like it to go this way
+ */
+
if((ob->softflag & OB_SB_GOAL) && sb->vertgroup) { /* even this is a deprecated evil hack */
/* I'd like to have it .. if (sb->namedVG_Goal[0]) */
@@ -3300,9 +3305,9 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
else{
/* in consequence if no group was set .. but we want to animate it laters */
/* logically attach to goal with default first */
- if(ob->softflag & OB_SB_GOAL){bp->goal =sb->defgoal;}
+ if(ob->softflag & OB_SB_GOAL){bp->goal =sb->defgoal;}
}
-
+
/* to proove the concept
this enables per vertex *mass painting*
*/
@@ -3324,7 +3329,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
if (sb->namedVG_Spring_K[0])
{
int grp= defgroup_name_index (ob,sb->namedVG_Spring_K);
- //printf("VGN %s %d \n",sb->namedVG_Spring_K,grp);
+ //printf("VGN %s %d \n",sb->namedVG_Spring_K,grp);
if(grp > -1){
get_scalar_from_vertexgroup(ob, a,(short) (grp), &bp->springweight);
//printf("bp->springweight %f \n",bp->springweight);
@@ -3332,7 +3337,7 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
}
}
-
+
}
/* but we only optionally add body edge springs */
@@ -3344,13 +3349,13 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
bs->v2= medge->v2;
bs->springtype=SB_EDGE;
}
-
-
+
+
/* insert *diagonal* springs in quads if desired */
if (ob->softflag & OB_SB_QUADS) {
add_mesh_quad_diag_springs(ob);
}
-
+
build_bps_springlist(ob); /* scan for springs attached to bodypoints ONCE */
/* insert *other second order* springs if desired */
if (sb->secondspring > 0.0000001f) {
@@ -3359,22 +3364,22 @@ static void mesh_to_softbody(Scene *scene, Object *ob)
}
springs_from_mesh(ob); /* write the 'rest'-lenght of the springs */
if (ob->softflag & OB_SB_SELF) {calculate_collision_balls(ob);}
-
+
}
-
+
}
}
static void mesh_faces_to_scratch(Object *ob)
{
- SoftBody *sb= ob->soft;
+ SoftBody *sb= ob->soft;
Mesh *me= ob->data;
MFace *mface;
BodyFace *bodyface;
int a;
/* alloc and copy faces*/
-
+
bodyface = sb->scratch->bodyface = MEM_mallocN(sizeof(BodyFace)*me->totface,"SB_body_Faces");
//memcpy(sb->scratch->mface,me->mface,sizeof(MFace)*me->totface);
mface = me->mface;
@@ -3384,13 +3389,13 @@ static void mesh_faces_to_scratch(Object *ob)
bodyface->v3 = mface->v3;
bodyface->v4 = mface->v4;
bodyface->ext_force[0] = bodyface->ext_force[1] = bodyface->ext_force[2] = 0.0f;
- bodyface->flag =0;
+ bodyface->flag =0;
}
sb->scratch->totface = me->totface;
}
static void reference_to_scratch(Object *ob)
{
- SoftBody *sb= ob->soft;
+ SoftBody *sb= ob->soft;
ReferenceVert *rp;
BodyPoint *bp;
float accu_pos[3] ={0.f,0.f,0.f};
@@ -3411,14 +3416,14 @@ static void reference_to_scratch(Object *ob)
}
/*
-helper function to get proper spring length
+helper function to get proper spring length
when object is rescaled
*/
static float globallen(float *v1,float *v2,Object *ob)
{
float p1[3],p2[3];
VECCOPY(p1,v1);
- mul_m4_v3(ob->obmat, p1);
+ mul_m4_v3(ob->obmat, p1);
VECCOPY(p2,v2);
mul_m4_v3(ob->obmat, p2);
return len_v3v3(p1,p2);
@@ -3428,16 +3433,16 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *
{
BPoint *bp=lt->def, *bpu;
int u, v, w, dv, dw, bpc=0, bpuc;
-
+
dv= lt->pntsu;
dw= dv*lt->pntsv;
-
+
for(w=0; w<lt->pntsw; w++) {
-
+
for(v=0; v<lt->pntsv; v++) {
-
+
for(u=0, bpuc=0, bpu=NULL; u<lt->pntsu; u++, bp++, bpc++) {
-
+
if(w) {
bs->v1 = bpc;
bs->v2 = bpc-dw;
@@ -3459,7 +3464,7 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *
bs->len= globallen((bpu)->vec, bp->vec,ob);
bs++;
}
-
+
if (dostiff) {
if(w){
@@ -3469,14 +3474,14 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *
bs->springtype=SB_BEND;
bs->len= globallen((bp-dw-dv-1)->vec, bp->vec,ob);
bs++;
- }
+ }
if( (v < lt->pntsv-1) && (u) ) {
bs->v1 = bpc;
bs->v2 = bpc-dw+dv-1;
bs->springtype=SB_BEND;
bs->len= globallen((bp-dw+dv-1)->vec, bp->vec,ob);
bs++;
- }
+ }
}
if(w < lt->pntsw -1){
@@ -3486,14 +3491,14 @@ static void makelatticesprings(Lattice *lt, BodySpring *bs, int dostiff,Object *
bs->springtype=SB_BEND;
bs->len= globallen((bp+dw-dv-1)->vec, bp->vec,ob);
bs++;
- }
+ }
if( (v < lt->pntsv-1) && (u) ) {
bs->v1 = bpc;
bs->v2 = bpc+dw+dv-1;
bs->springtype=SB_BEND;
bs->len= globallen((bp+dw+dv-1)->vec, bp->vec,ob);
bs++;
- }
+ }
}
}
bpu = bp;
@@ -3514,19 +3519,19 @@ static void lattice_to_softbody(Scene *scene, Object *ob)
totvert= lt->pntsu*lt->pntsv*lt->pntsw;
if (ob->softflag & OB_SB_EDGES){
- totspring = ((lt->pntsu -1) * lt->pntsv
+ totspring = ((lt->pntsu -1) * lt->pntsv
+ (lt->pntsv -1) * lt->pntsu) * lt->pntsw
+lt->pntsu*lt->pntsv*(lt->pntsw -1);
if (ob->softflag & OB_SB_QUADS){
totspring += 4*(lt->pntsu -1) * (lt->pntsv -1) * (lt->pntsw-1);
}
}
-
+
/* renew ends with ob->soft with points and edges, also checks & makes ob->soft */
renew_softbody(scene, ob, totvert, totspring);
sb= ob->soft; /* can be created in renew_softbody() */
-
+
/* weights from bpoints, same code used as for mesh vertices */
/* if((ob->softflag & OB_SB_GOAL) && sb->vertgroup) { 2.4x one*/
/* new! take the weights from lattice vertex anyhow */
@@ -3539,8 +3544,8 @@ static void lattice_to_softbody(Scene *scene, Object *ob)
for(a=0; a<totvert; a++, bp++, bpnt++) {
bp->goal= bpnt->weight;
}
- }
-
+ }
+
/* create some helper edges to enable SB lattice to be usefull at all */
if (ob->softflag & OB_SB_EDGES){
makelatticesprings(lt,ob->soft->bspring,ob->softflag & OB_SB_QUADS,ob);
@@ -3560,57 +3565,64 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob)
BPoint *bpnt;
int a, curindex=0;
int totvert, totspring = 0, setgoal=0;
-
+
totvert= count_curveverts(&cu->nurb);
-
+
if (ob->softflag & OB_SB_EDGES){
if(ob->type==OB_CURVE) {
totspring= totvert - BLI_countlist(&cu->nurb);
}
}
-
+
/* renew ends with ob->soft with points and edges, also checks & makes ob->soft */
renew_softbody(scene, ob, totvert, totspring);
sb= ob->soft; /* can be created in renew_softbody() */
-
+
/* set vars now */
bp= sb->bpoint;
bs= sb->bspring;
-
+
/* weights from bpoints, same code used as for mesh vertices */
/* if((ob->softflag & OB_SB_GOAL) && sb->vertgroup) 2.4x hack*/
/* new! take the weights from curve vertex anyhow */
- if(ob->softflag & OB_SB_GOAL)
+ if(ob->softflag & OB_SB_GOAL)
setgoal= 1;
-
+
for(nu= cu->nurb.first; nu; nu= nu->next) {
if(nu->bezt) {
+ /* bezier case ; this is nicly said naive; who ever wrote this part, it was not me (JOW) :) */
+ /* a: never ever make tangent handles (sub) and or (ob)ject to collision */
+ /* b: rather calculate them using some C2 (C2= continous in second derivate -> no jump in bending ) condition */
+ /* not too hard to do, but needs some more code to care for; some one may want look at it JOW 2010/06/12*/
for(bezt=nu->bezt, a=0; a<nu->pntsu; a++, bezt++, bp+=3, curindex+=3) {
if(setgoal) {
bp->goal= bezt->weight;
-
+
/* all three triples */
(bp+1)->goal= bp->goal;
(bp+2)->goal= bp->goal;
+ /*do not collide handles */
+ (bp+1)->loc_flag |= SBF_OUTOFCOLLISION;
+ (bp+2)->loc_flag |= SBF_OUTOFCOLLISION;
}
-
+
if(totspring) {
if(a>0) {
- bs->v1= curindex-1;
+ bs->v1= curindex-3;
bs->v2= curindex;
- bs->springtype=SB_EDGE;
- bs->len= globallen( (bezt-1)->vec[2], bezt->vec[0], ob );
+ bs->springtype=SB_HANDLE;
+ bs->len= globallen( (bezt-1)->vec[0], bezt->vec[0], ob );
bs++;
}
bs->v1= curindex;
bs->v2= curindex+1;
- bs->springtype=SB_EDGE;
+ bs->springtype=SB_HANDLE;
bs->len= globallen( bezt->vec[0], bezt->vec[1], ob );
bs++;
bs->v1= curindex+1;
bs->v2= curindex+2;
- bs->springtype=SB_EDGE;
+ bs->springtype=SB_HANDLE;
bs->len= globallen( bezt->vec[1], bezt->vec[2], ob );
bs++;
}
@@ -3631,7 +3643,7 @@ static void curve_surf_to_softbody(Scene *scene, Object *ob)
}
}
}
-
+
if(totspring)
{
build_bps_springlist(ob); /* link bps to springs */
@@ -3652,7 +3664,7 @@ static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts,
for(a=0; a<numVerts; a++, bp++) {
VECCOPY(vertexCos[a], bp->pos);
- if(local==0)
+ if(local==0)
mul_m4_v3(ob->imat, vertexCos[a]); /* softbody is in global coords, baked optionally not */
}
}
@@ -3669,7 +3681,7 @@ static void sb_new_scratch(SoftBody *sb)
sb->scratch->aabbmax[0]=sb->scratch->aabbmax[1]=sb->scratch->aabbmax[2] = 1.0e30f;
sb->scratch->aabbmin[0]=sb->scratch->aabbmin[1]=sb->scratch->aabbmin[2] = -1.0e30f;
sb->scratch->Ref.ivert = NULL;
-
+
}
/* --- ************ maintaining scratch *************** */
@@ -3679,26 +3691,26 @@ static void sb_new_scratch(SoftBody *sb)
SoftBody *sbNew(Scene *scene)
{
SoftBody *sb;
-
+
sb= MEM_callocN(sizeof(SoftBody), "softbody");
-
- sb->mediafrict= 0.5f;
+
+ sb->mediafrict= 0.5f;
sb->nodemass= 1.0f;
- sb->grav= 9.8f;
+ sb->grav= 9.8f;
sb->physics_speed= 1.0f;
sb->rklimit= 0.1f;
- sb->goalspring= 0.5f;
- sb->goalfrict= 0.0f;
- sb->mingoal= 0.0f;
+ sb->goalspring= 0.5f;
+ sb->goalfrict= 0.0f;
+ sb->mingoal= 0.0f;
sb->maxgoal= 1.0f;
sb->defgoal= 0.7f;
-
+
sb->inspring= 0.5f;
- sb->infrict= 0.5f;
+ sb->infrict= 0.5f;
/*todo backward file compat should copy inspring to inpush while reading old files*/
- sb->inpush = 0.5f;
-
+ sb->inpush = 0.5f;
+
sb->interval= 10;
sb->sfra= scene->r.sfra;
sb->efra= scene->r.efra;
@@ -3750,7 +3762,7 @@ void sbObjectToSoftbody(Object *ob)
free_softbody_intern(ob->soft);
}
-static int object_has_edges(Object *ob)
+static int object_has_edges(Object *ob)
{
if(ob->type==OB_MESH) {
return ((Mesh*) ob->data)->totedge;
@@ -3763,7 +3775,7 @@ static int object_has_edges(Object *ob)
}
}
-/* SB global visible functions */
+/* SB global visible functions */
void sbSetInterruptCallBack(int (*f)(void))
{
SB_localInterruptCallBack = f;
@@ -3778,7 +3790,7 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
return;
for(a=0,bp=sb->bpoint; a<numVerts; a++, bp++) {
- /* store where goals are now */
+ /* store where goals are now */
VECCOPY(bp->origS, bp->origE);
/* copy the position of the goals at desired end time */
VECCOPY(bp->origE, vertexCos[a]);
@@ -3786,7 +3798,7 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
mul_m4_v3(ob->obmat, bp->origE);
/* just to be save give bp->origT a defined value
will be calulated in interpolate_exciter()*/
- VECCOPY(bp->origT, bp->origE);
+ VECCOPY(bp->origT, bp->origE);
}
}
@@ -3800,7 +3812,7 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
see: this is kind of reverse engeneering: having to states of a point cloud and recover what happend
our advantage here we know the identity of the vertex
there are others methods giving other results.
- lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
+ lloc,lrot,lscale are allowed to be NULL, just in case you don't need it.
should be pretty useful for pythoneers :)
not! velocity .. 2nd order stuff
vcloud_estimate_transform see
@@ -3821,10 +3833,10 @@ void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscal
if(!sb || !sb->bpoint) return;
opos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_OPOS");
rpos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_RPOS");
- /* might filter vertex selection with a vertex group */
+ /* might filter vertex selection with a vertex group */
for(a=0, bp=sb->bpoint, rp=sb->scratch->Ref.ivert; a<sb->totpoint; a++, bp++, rp++) {
- VECCOPY(rpos[a],rp->pos);
- VECCOPY(opos[a],bp->pos);
+ VECCOPY(rpos[a],rp->pos);
+ VECCOPY(opos[a],bp->pos);
}
vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com, rcom,lrot,lscale);
@@ -3834,7 +3846,7 @@ void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscal
if (lscale) copy_m3_m3(sb->lscale,lscale);
if (lrot) copy_m3_m3(sb->lrot,lrot);
-
+
MEM_freeN(opos);
MEM_freeN(rpos);
}
@@ -3857,9 +3869,9 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
1. set sheduled time step to new dtime
2. try to advance the sheduled time step, beeing optimistic execute it
3. check for success
- 3.a we 're fine continue, may be we can increase sheduled time again ?? if so, do so!
+ 3.a we 're fine continue, may be we can increase sheduled time again ?? if so, do so!
3.b we did exceed error limit --> roll back, shorten the sheduled time and try again at 2.
- 4. check if we did reach dtime
+ 4. check if we did reach dtime
4.a nope we need to do some more at 2.
4.b yup we're done
*/
@@ -3873,7 +3885,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
/* make a nice clean scratch struc */
free_scratch(sb); /* clear if any */
sb_new_scratch(sb); /* make a new */
- sb->scratch->needstobuildcollider=1;
+ sb->scratch->needstobuildcollider=1;
zero_v3(sb->lcom);
unit_m3(sb->lrot);
unit_m3(sb->lscale);
@@ -3906,15 +3918,15 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
/* the simulator */
float forcetime;
double sct,sst;
-
-
+
+
sst=PIL_check_seconds_timer();
- /* Integration back in time is possible in theory, but pretty useless here.
+ /* Integration back in time is possible in theory, but pretty useless here.
So we refuse to do so. Since we do not know anything about 'outside' canges
especially colliders we refuse to go more than 10 frames.
*/
- if(dtime < 0 || dtime > 10.5f) return;
-
+ if(dtime < 0 || dtime > 10.5f) return;
+
ccd_update_deflector_hash(scene, ob, sb->scratch->colliderhash);
if(sb->scratch->needstobuildcollider){
@@ -3924,7 +3936,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
sb->scratch->needstobuildcollider=0;
}
- if (sb->solver_ID < 2) {
+ if (sb->solver_ID < 2) {
/* special case of 2nd order Runge-Kutta type AKA Heun */
int mid_flags=0;
float err = 0;
@@ -3934,21 +3946,21 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
/* loops = counter for emergency brake
* we don't want to lock up the system if physics fail
*/
- int loops =0 ;
-
+ int loops =0 ;
+
SoftHeunTol = sb->rklimit; /* humm .. this should be calculated from sb parameters and sizes */
/* adjust loop limits */
if (sb->minloops > 0) forcetimemax = dtime / sb->minloops;
if (sb->maxloops > 0) forcetimemin = dtime / sb->maxloops;
if(sb->solver_ID>0) mid_flags |= MID_PRESERVE;
-
+
forcetime =forcetimemax; /* hope for integrating in one step */
while ( (ABS(timedone) < ABS(dtime)) && (loops < 2000) )
{
- /* set goals in time */
+ /* set goals in time */
interpolate_exciter(ob,200,(int)(200.0*(timedone/dtime)));
-
+
sb->scratch->flag &= ~SBF_DOFUZZY;
/* do predictive euler step */
softbody_calc_forces(scene, ob, forcetime,timedone/dtime,0);
@@ -3960,9 +3972,9 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
softbody_apply_forces(ob, forcetime, 2, &err,mid_flags);
softbody_apply_goalsnap(ob);
-
+
if (err > SoftHeunTol) { /* error needs to be scaled to some quantity */
-
+
if (forcetime > forcetimemin){
forcetime = MAX2(forcetime / 2.0f,forcetimemin);
softbody_restore_prev_step(ob);
@@ -3974,7 +3986,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
}
else {
float newtime = forcetime * 1.1f; /* hope for 1.1 times better conditions in next step */
-
+
if (sb->scratch->flag & SBF_DOFUZZY){
//if (err > SoftHeunTol/(2.0f*sb->fuzzyness)) { /* stay with this stepsize unless err really small */
newtime = forcetime;
@@ -3990,7 +4002,7 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
//if (newtime > forcetime) printf("up,");
if (forcetime > 0.0)
forcetime = MIN2(dtime - timedone,newtime);
- else
+ else
forcetime = MAX2(dtime - timedone,newtime);
}
loops++;
@@ -3998,20 +4010,20 @@ static void softbody_step(Scene *scene, Object *ob, SoftBody *sb, float dtime)
sct=PIL_check_seconds_timer();
if (sct-sst > 0.5f) printf("%3.0f%% \r",100.0f*timedone/dtime);
}
- /* ask for user break */
+ /* ask for user break */
if (SB_localInterruptCallBack && SB_localInterruptCallBack()) break;
}
/* move snapped to final position */
interpolate_exciter(ob, 2, 2);
softbody_apply_goalsnap(ob);
-
+
// if(G.f & G_DEBUG){
if(sb->solverflags & SBSO_MONITOR ){
if (loops > HEUNWARNLIMIT) /* monitor high loop counts */
printf("\r needed %d steps/frame",loops);
}
-
+
}
else if (sb->solver_ID == 2)
{/* do semi "fake" implicit euler */
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index 52f645705cc..0b886c17309 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -52,6 +52,8 @@ void BLI_init_rctf(struct rctf *rect, float xmin, float xmax, float ymin, float
void BLI_init_rcti(struct rcti *rect, int xmin, int xmax, int ymin, int ymax);
void BLI_translate_rctf(struct rctf *rect, float x, float y);
void BLI_translate_rcti(struct rcti *rect, int x, int y);
+void BLI_resize_rcti(struct rcti *rect, int x, int y);
+void BLI_resize_rctf(struct rctf *rect, float x, float y);
int BLI_in_rcti(struct rcti *rect, int x, int y);
int BLI_in_rctf(struct rctf *rect, float x, float y);
int BLI_isect_rctf(struct rctf *src1, struct rctf *src2, struct rctf *dest);
diff --git a/source/blender/blenlib/BLI_uvproject.h b/source/blender/blenlib/BLI_uvproject.h
index a77ca60fc15..cf8bb7cd4b8 100644
--- a/source/blender/blenlib/BLI_uvproject.h
+++ b/source/blender/blenlib/BLI_uvproject.h
@@ -37,4 +37,7 @@ void project_from_view(float target[2], float source[3], float persmat[4][4], fl
/* apply ortho uv's */
void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4]);
+/* so we can adjust scale with keeping the struct private */
+void project_camera_info_scale(struct UvCameraInfo *uci, float scale_x, float scale_y);
+
#endif
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 2cea9c21a57..045ac5a013f 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -703,7 +703,7 @@ int BLI_path_cwd(char *path)
}
-/* copy di to fi, filename only */
+/* 'di's filename component is moved into 'fi', di is made a dir path */
void BLI_splitdirstring(char *di, char *fi)
{
char *lslash= BLI_last_slash(di);
@@ -1010,8 +1010,8 @@ void BLI_make_exist(char *dir) {
void BLI_make_existing_file(char *name)
{
- char di[FILE_MAXDIR], fi[FILE_MAXFILE];
-
+ char di[FILE_MAXDIR+FILE_MAXFILE], fi[FILE_MAXFILE];
+
strcpy(di, name);
BLI_splitdirstring(di, fi);
diff --git a/source/blender/blenlib/intern/rct.c b/source/blender/blenlib/intern/rct.c
index 7fce9ac7e8d..5466acdba9f 100644
--- a/source/blender/blenlib/intern/rct.c
+++ b/source/blender/blenlib/intern/rct.c
@@ -142,6 +142,27 @@ void BLI_translate_rctf(rctf *rect, float x, float y)
rect->ymax += y;
}
+/* change width & height around the central location */
+void BLI_resize_rcti(rcti *rect, int x, int y)
+{
+ rect->xmin= rect->xmax= (rect->xmax + rect->xmin) / 2;
+ rect->ymin= rect->ymax= (rect->ymax + rect->ymin) / 2;
+ rect->xmin -= x / 2;
+ rect->ymin -= y / 2;
+ rect->xmax= rect->xmin + x;
+ rect->ymax= rect->ymin + y;
+}
+
+void BLI_resize_rctf(rctf *rect, float x, float y)
+{
+ rect->xmin= rect->xmax= (rect->xmax + rect->xmin) * 0.5f;
+ rect->ymin= rect->ymax= (rect->ymax + rect->ymin) * 0.5f;
+ rect->xmin -= x * 0.5f;
+ rect->ymin -= y * 0.5f;
+ rect->xmax= rect->xmin + x;
+ rect->ymax= rect->ymin + y;
+}
+
int BLI_isect_rctf(rctf *src1, rctf *src2, rctf *dest)
{
float xmin, xmax;
diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c
index 11d93748fe4..cc115d52928 100644
--- a/source/blender/blenlib/intern/uvproject.c
+++ b/source/blender/blenlib/intern/uvproject.c
@@ -182,3 +182,10 @@ void project_from_view_ortho(float target[2], float source[3], float rotmat[4][4
target[0] = -pv[0];
target[1] = pv[2];
}
+
+
+void project_camera_info_scale(UvCameraInfo *uci, float scale_x, float scale_y)
+{
+ uci->xasp *= scale_x;
+ uci->yasp *= scale_y;
+}
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 43a0c8de955..fee66384e65 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -592,10 +592,32 @@ static int acf_object_icon(bAnimListElem *ale)
Object *ob= base->object;
/* icon depends on object-type */
- if (ob->type == OB_ARMATURE)
- return ICON_ARMATURE_DATA;
- else
- return ICON_OBJECT_DATA;
+
+ switch (ob->type) {
+ case OB_LAMP:
+ return ICON_OUTLINER_OB_LAMP;
+ case OB_MESH:
+ return ICON_OUTLINER_OB_MESH;
+ case OB_CAMERA:
+ return ICON_OUTLINER_OB_CAMERA;
+ case OB_CURVE:
+ return ICON_OUTLINER_OB_CURVE;
+ case OB_MBALL:
+ return ICON_OUTLINER_OB_META;
+ case OB_LATTICE:
+ return ICON_OUTLINER_OB_LATTICE;
+ case OB_ARMATURE:
+ return ICON_OUTLINER_OB_ARMATURE;
+ case OB_FONT:
+ return ICON_OUTLINER_OB_FONT;
+ case OB_SURF:
+ return ICON_OUTLINER_OB_SURFACE;
+ case OB_EMPTY:
+ return ICON_OUTLINER_OB_EMPTY;
+ default:
+ return ICON_OBJECT_DATA;
+ }
+
}
/* name for object */
@@ -2836,7 +2858,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float
/* callback for (normal) widget settings - send notifiers */
static void achannel_setting_widget_cb(bContext *C, void *poin, void *poin2)
{
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
/* callback for widget settings that need flushing */
@@ -2850,7 +2872,7 @@ static void achannel_setting_flush_widget_cb(bContext *C, void *ale_npoin, void
short on = 0;
/* send notifiers before doing anything else... */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* verify animation context */
if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -2914,7 +2936,7 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi
done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag);
if (done)
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
}
@@ -2956,7 +2978,7 @@ static void achannel_setting_slider_shapekey_cb(bContext *C, void *key_poin, voi
done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag);
if (done)
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
/* free the path */
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index bdaf0bf700a..21bdb591df9 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -842,7 +842,7 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
rearrange_action_channels(&ac, mode);
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -998,7 +998,7 @@ static int animchannels_delete_exec(bContext *C, wmOperator *op)
}
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1075,7 +1075,7 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *op)
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1148,7 +1148,7 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *op)
BLI_freelistN(&all_data);
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1279,7 +1279,7 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op)
setflag_anim_channels(&ac, setting, mode, 1, flush);
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1413,7 +1413,7 @@ static int animchannels_expand_exec (bContext *C, wmOperator *op)
setflag_anim_channels(&ac, ACHANNEL_SETTING_EXPAND, ACHANNEL_SETFLAG_ADD, onlysel, 0);
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1455,7 +1455,7 @@ static int animchannels_collapse_exec (bContext *C, wmOperator *op)
setflag_anim_channels(&ac, ACHANNEL_SETTING_EXPAND, ACHANNEL_SETFLAG_CLEAR, onlysel, 0);
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1495,7 +1495,7 @@ static int animchannels_deselectall_exec(bContext *C, wmOperator *op)
ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_ADD);
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -1597,7 +1597,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
borderselect_anim_channels(&ac, &rect, selectmode);
/* send notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -1676,7 +1676,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
if (adt) adt->flag |= ADT_UI_SELECTED;
}
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
case ANIMTYPE_OBJECT:
@@ -1715,7 +1715,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
if ((adt) && (adt->flag & ADT_UI_SELECTED))
adt->flag |= ADT_UI_ACTIVE;
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
@@ -1751,7 +1751,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
ale->adt->flag |= ADT_UI_ACTIVE;
}
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
@@ -1786,7 +1786,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
if (agrp->flag & AGRP_SELECTED)
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP);
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
case ANIMTYPE_FCURVE:
@@ -1808,7 +1808,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
if (fcu->flag & FCURVE_SELECTED)
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
case ANIMTYPE_SHAPEKEY:
@@ -1826,7 +1826,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
kb->flag |= KEYBLOCK_SEL;
}
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
case ANIMTYPE_GPDATABLOCK:
@@ -1836,7 +1836,7 @@ static int mouse_anim_channels (bAnimContext *ac, float x, int channel_index, sh
/* toggle expand */
gpd->flag ^= GP_DATA_EXPAND;
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ notifierFlags |= (ND_ANIMCHAN|NA_EDITED);
}
break;
case ANIMTYPE_GPLAYER:
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 3bd8b50c889..cd6714ec51f 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -95,7 +95,7 @@ static void delete_fmodifier_cb (bContext *C, void *fmods_v, void *fcm_v)
/* send notifiers */
// XXX for now, this is the only way to get updates in all the right places... but would be nice to have a special one in this case
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------------- */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 98fcf04a5c1..882fb3e91dc 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -130,8 +130,11 @@ bAction *verify_adt_action (ID *id, short add)
/* init action if none available yet */
// TODO: need some wizardry to handle NLA stuff correct
- if ((adt->action == NULL) && (add))
- adt->action= add_empty_action("Action");
+ if ((adt->action == NULL) && (add)) {
+ char actname[sizeof(id->name)-2];
+ BLI_snprintf(actname, sizeof(actname), "%sAction", id->name+2);
+ adt->action= add_empty_action(actname);
+ }
/* return the action */
return adt->action;
@@ -1091,7 +1094,7 @@ static int insert_key_exec (bContext *C, wmOperator *op)
BKE_reportf(op->reports, RPT_INFO, "Successfully added %d Keyframes for KeyingSet '%s'", success, ks->name);
/* send notifiers that keyframes have been changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
else
BKE_report(op->reports, RPT_WARNING, "Keying Set failed to insert any keyframes");
@@ -1233,7 +1236,7 @@ static int delete_key_exec (bContext *C, wmOperator *op)
BKE_reportf(op->reports, RPT_INFO, "Successfully removed %d Keyframes for KeyingSet '%s'", success, ks->name);
/* send notifiers that keyframes have been changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
else
BKE_report(op->reports, RPT_WARNING, "Keying Set failed to remove any keyframes");
@@ -1394,7 +1397,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op)
DAG_ids_flush_update(0);
/* send notifiers that keyframes have been changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
@@ -1464,7 +1467,7 @@ static int delete_key_button_exec (bContext *C, wmOperator *op)
DAG_ids_flush_update(0);
/* send notifiers that keyframes have been changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED;
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index 49b8c1101d6..f496cec7b39 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -924,7 +924,7 @@ int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingS
}
/* send notifiers for updates (this doesn't require context to work!) */
- WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
}
diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c
index 613a3bd99db..408a2e1e599 100644
--- a/source/blender/editors/armature/poselib.c
+++ b/source/blender/editors/armature/poselib.c
@@ -806,7 +806,7 @@ static void poselib_keytag_pose (bContext *C, Scene *scene, tPoseLib_PreviewData
}
/* send notifiers for this */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* Apply the relevant changes to the pose */
diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h
index ac0825ae612..dc07822bde2 100644
--- a/source/blender/editors/curve/curve_intern.h
+++ b/source/blender/editors/curve/curve_intern.h
@@ -91,6 +91,13 @@ void CURVE_OT_primitive_nurbs_curve_add(struct wmOperatorType *ot);
void CURVE_OT_primitive_nurbs_circle_add(struct wmOperatorType *ot);
void CURVE_OT_primitive_nurbs_path_add(struct wmOperatorType *ot);
+void SURFACE_OT_primitive_nurbs_surface_curve_add(struct wmOperatorType *ot);
+void SURFACE_OT_primitive_nurbs_surface_circle_add(struct wmOperatorType *ot);
+void SURFACE_OT_primitive_nurbs_surface_surface_add(struct wmOperatorType *ot);
+void SURFACE_OT_primitive_nurbs_surface_tube_add(struct wmOperatorType *ot);
+void SURFACE_OT_primitive_nurbs_surface_sphere_add(struct wmOperatorType *ot);
+void SURFACE_OT_primitive_nurbs_surface_donut_add(struct wmOperatorType *ot);
+
void CURVE_OT_de_select_first(struct wmOperatorType *ot);
void CURVE_OT_de_select_last(struct wmOperatorType *ot);
void CURVE_OT_select_all(struct wmOperatorType *ot);
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c
index 59e4490a63e..7586023d012 100644
--- a/source/blender/editors/curve/curve_ops.c
+++ b/source/blender/editors/curve/curve_ops.c
@@ -102,7 +102,14 @@ void ED_operatortypes_curve(void)
WM_operatortype_append(CURVE_OT_primitive_nurbs_curve_add);
WM_operatortype_append(CURVE_OT_primitive_nurbs_circle_add);
WM_operatortype_append(CURVE_OT_primitive_nurbs_path_add);
-
+
+ WM_operatortype_append(SURFACE_OT_primitive_nurbs_surface_curve_add);
+ WM_operatortype_append(SURFACE_OT_primitive_nurbs_surface_circle_add);
+ WM_operatortype_append(SURFACE_OT_primitive_nurbs_surface_surface_add);
+ WM_operatortype_append(SURFACE_OT_primitive_nurbs_surface_tube_add);
+ WM_operatortype_append(SURFACE_OT_primitive_nurbs_surface_sphere_add);
+ WM_operatortype_append(SURFACE_OT_primitive_nurbs_surface_donut_add);
+
WM_operatortype_append(CURVE_OT_smooth);
WM_operatortype_append(CURVE_OT_smooth_radius);
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 274b51f03b2..7e8154f9381 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -3414,7 +3414,6 @@ static int addvert_Nurb(bContext *C, short mode, float location[3])
copy_m3_m4(mat, obedit->obmat);
invert_m3_m3(imat,mat);
- view3d_operator_needs_opengl(C);
findselectedNurbvert(editnurb, &nu, &bezt, &bp);
if(bezt==0 && bp==0) return OPERATOR_CANCELLED;
@@ -5269,7 +5268,9 @@ static int curve_prim_add(bContext *C, wmOperator *op, int type){
float mat[4][4];
//object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
+
if(obedit==NULL || obedit->type!=OB_CURVE) {
Curve *cu;
@@ -5281,8 +5282,13 @@ static int curve_prim_add(bContext *C, wmOperator *op, int type){
if(type & CU_PRIM_PATH)
cu->flag |= CU_PATH|CU_3D;
}
+ else if(obedit==NULL || obedit->type!=OB_SURF) {
+ obedit= ED_object_add_type(C, OB_SURF, loc, rot, TRUE, layer);
+ newob = 1;
+ }
else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA);
+
ED_object_new_primitive_matrix(C, obedit, loc, rot, mat);
nu= add_nurbs_primitive(C, mat, type, newob);
@@ -5298,6 +5304,7 @@ static int curve_prim_add(bContext *C, wmOperator *op, int type){
return OPERATOR_FINISHED;
}
+/* ******************** Curves ******************* */
static int add_primitive_bezier_exec(bContext *C, wmOperator *op)
{
@@ -5414,7 +5421,144 @@ void CURVE_OT_primitive_nurbs_path_add(wmOperatorType *ot)
ED_object_add_generic_props(ot, TRUE);
}
+/* **************** NURBS surfaces ********************** */
+static int add_primitive_nurbs_surface_curve_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_PRIM_CURVE|CU_NURBS);
+}
+
+void SURFACE_OT_primitive_nurbs_surface_curve_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Surface Curve";
+ ot->description= "Construct a Nurbs surface Curve";
+ ot->idname= "SURFACE_OT_primitive_nurbs_surface_curve_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_surface_curve_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_surface_circle_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_PRIM_CIRCLE|CU_NURBS);
+}
+
+void SURFACE_OT_primitive_nurbs_surface_circle_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Surface Circle";
+ ot->description= "Construct a Nurbs surface Circle";
+ ot->idname= "SURFACE_OT_primitive_nurbs_surface_circle_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_surface_circle_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_surface_surface_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_PRIM_PATCH|CU_NURBS);
+}
+
+void SURFACE_OT_primitive_nurbs_surface_surface_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Surface Patch";
+ ot->description= "Construct a Nurbs surface Patch";
+ ot->idname= "SURFACE_OT_primitive_nurbs_surface_surface_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_surface_surface_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_surface_tube_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_PRIM_TUBE|CU_NURBS);
+}
+
+void SURFACE_OT_primitive_nurbs_surface_tube_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Surface Tube";
+ ot->description= "Construct a Nurbs surface Tube";
+ ot->idname= "SURFACE_OT_primitive_nurbs_surface_tube_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_surface_tube_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_surface_sphere_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_PRIM_SPHERE|CU_NURBS);
+}
+
+void SURFACE_OT_primitive_nurbs_surface_sphere_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Surface Sphere";
+ ot->description= "Construct a Nurbs surface Sphere";
+ ot->idname= "SURFACE_OT_primitive_nurbs_surface_sphere_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_surface_sphere_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
+
+static int add_primitive_nurbs_surface_donut_exec(bContext *C, wmOperator *op)
+{
+ return curve_prim_add(C, op, CU_PRIM_DONUT|CU_NURBS);
+}
+void SURFACE_OT_primitive_nurbs_surface_donut_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Surface Donut";
+ ot->description= "Construct a Nurbs surface Donut";
+ ot->idname= "SURFACE_OT_primitive_nurbs_surface_donut_add";
+
+ /* api callbacks */
+ ot->invoke= ED_object_add_generic_invoke;
+ ot->exec= add_primitive_nurbs_surface_donut_exec;
+ ot->poll= ED_operator_scene_editable;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+ ED_object_add_generic_props(ot, TRUE);
+}
/***************** clear tilt operator ********************/
diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c
index 767c2c82594..46970a401a8 100644
--- a/source/blender/editors/curve/editfont.c
+++ b/source/blender/editors/curve/editfont.c
@@ -384,7 +384,7 @@ static int paste_file_exec(bContext *C, wmOperator *op)
char *path;
int retval;
- path= RNA_string_get_alloc(op->ptr, "path", NULL, 0);
+ path= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
retval= paste_file(C, op->reports, path);
MEM_freeN(path);
@@ -393,7 +393,7 @@ static int paste_file_exec(bContext *C, wmOperator *op)
static int paste_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return paste_file_exec(C, op);
WM_event_add_fileselect(C, op);
@@ -1564,7 +1564,7 @@ static int open_exec(bContext *C, wmOperator *op)
PointerRNA idptr;
char str[FILE_MAX];
- RNA_string_get(op->ptr, "path", str);
+ RNA_string_get(op->ptr, "filepath", str);
font = load_vfont(str);
@@ -1613,12 +1613,12 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
path = (font && font->name)? font->name: U.fontdir;
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op);
open_init(C, op);
- RNA_string_set(op->ptr, "path", path);
+ RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index da4896b3435..a03cd135f1c 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -88,7 +88,7 @@ float ED_object_new_primitive_matrix(struct bContext *C, struct Object *editob,
void ED_object_add_generic_props(struct wmOperatorType *ot, int do_editmode);
int ED_object_add_generic_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
-void ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer);
+int ED_object_add_generic_get_opts(struct bContext *C, struct wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer);
struct Object *ED_object_add_type(struct bContext *C, int type, float *loc, float *rot, int enter_editmode, unsigned int layer);
void ED_object_single_users(struct Scene *scene, int full);
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 207230a914d..4108e1c8532 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -111,7 +111,7 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
fcu->flag &= ~FCURVE_SELECTED;
insert_keyframe(id, action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag);
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
}
}
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index e598574ed24..dae2e35f99b 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1059,7 +1059,7 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
inside= 1;
if(inside && event->val==KM_PRESS) {
- if(event->type == AKEY && !ELEM3(1, event->ctrl, event->oskey, event->shift)) {
+ if(event->type == AKEY && !ELEM4(1, event->ctrl, event->oskey, event->shift, event->alt)) {
if(pa->flag & PNL_CLOSEDY) {
if((block->maxy <= my) && (block->maxy+PNL_HEADER >= my))
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 0e58f73c87e..d44e4b2b4dc 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -2316,7 +2316,7 @@ void uiPupMenuReports(bContext *C, ReportList *reports)
ds= BLI_dynstr_new();
for(report=reports->list.first; report; report=report->next) {
- if(report->type <= reports->printlevel)
+ if(report->type < reports->printlevel)
; /* pass */
else if(report->type >= RPT_ERROR)
BLI_dynstr_appendf(ds, "Error %%i%d%%t|%s", ICON_ERROR, report->message);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 05c162ef639..fb515d55854 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -428,7 +428,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6;
if(newop) {
- but= uiDefIconTextButO(block, BUT, newop, WM_OP_EXEC_DEFAULT, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL);
+ but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL);
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
}
else {
diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c
index 4545014c47f..cdcbb5cb461 100644
--- a/source/blender/editors/mesh/editmesh.c
+++ b/source/blender/editors/mesh/editmesh.c
@@ -1480,10 +1480,18 @@ static int mesh_separate_loose(Scene *scene, Base *editbase)
}
EM_clear_flag_all(em, SELECT);
-
- while(doit && em->verts.first) {
+
+ while(doit) {
/* Select a random vert to start with */
- EditVert *eve= em->verts.first;
+ EditVert *eve;
+ int tot;
+
+ /* check if all verts that are visible have been done */
+ for(eve=em->verts.first; eve; eve= eve->next)
+ if(!eve->h) break;
+ if(eve==NULL) break; /* only hidden verts left, quit early */
+
+ /* first non hidden vert */
eve->f |= SELECT;
selectconnected_mesh_all(em);
@@ -1493,8 +1501,14 @@ static int mesh_separate_loose(Scene *scene, Base *editbase)
if((eve->f & SELECT)==0) break;
if(eve==NULL) break;
+ tot= BLI_countlist(&em->verts);
+
/* and now separate */
doit= mesh_separate_selected(scene, editbase);
+
+ /* with hidden verts this can happen */
+ if(tot == BLI_countlist(&em->verts))
+ break;
}
BKE_mesh_end_editmesh(me, em);
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index f0e6f40af30..a7a0a854f1b 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -1304,7 +1304,8 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
/* sqrt(2.0f) - plane (diameter of 1.41 makes it unit size) */
make_prim_ext(C, loc, rot, enter_editmode, layer,
@@ -1336,7 +1337,8 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
/* sqrt(2.0f) - plane (diameter of 1.41 makes it unit size) */
make_prim_ext(C, loc, rot, enter_editmode, layer,
@@ -1368,7 +1370,8 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
make_prim_ext(C, loc, rot, enter_editmode, layer,
PRIM_CIRCLE, RNA_int_get(op->ptr, "vertices"), 0, 0,
@@ -1407,7 +1410,8 @@ static int add_primitive_tube_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
make_prim_ext(C, loc, rot, enter_editmode, layer,
PRIM_CYLINDER, RNA_int_get(op->ptr, "vertices"), 0, 0,
@@ -1448,7 +1452,8 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
make_prim_ext(C, loc, rot, enter_editmode, layer,
PRIM_CONE, RNA_int_get(op->ptr, "vertices"), 0, 0,
@@ -1488,7 +1493,8 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
make_prim_ext(C, loc, rot, enter_editmode, layer,
PRIM_GRID, RNA_int_get(op->ptr, "x_subdivisions"),
@@ -1527,7 +1533,8 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
make_prim_ext(C, loc, rot, enter_editmode, layer,
PRIM_MONKEY, 0, 0, 2, 0.0f, 0.0f, 0, 0);
@@ -1559,7 +1566,8 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
make_prim_ext(C, loc, rot, enter_editmode, layer,
PRIM_UVSPHERE, RNA_int_get(op->ptr, "rings"),
@@ -1598,7 +1606,8 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
make_prim_ext(C, loc, rot, enter_editmode, layer,
PRIM_ICOSPHERE, 0, 0, RNA_int_get(op->ptr, "subdivisions"),
diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c
index 5b034a5ac54..53da24fa455 100644
--- a/source/blender/editors/mesh/mesh_data.c
+++ b/source/blender/editors/mesh/mesh_data.c
@@ -326,10 +326,10 @@ static int drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
/* check input variables */
- if(RNA_property_is_set(op->ptr, "path")) {
+ if(RNA_property_is_set(op->ptr, "filepath")) {
char path[FILE_MAX];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
ima= BKE_add_image_file(path,
scene ? scene->r.cfra : 1);
}
@@ -385,7 +385,7 @@ void MESH_OT_drop_named_image(wmOperatorType *ot)
/* properties */
RNA_def_string(ot->srna, "name", "Image", 24, "Name", "Image name to assign.");
- RNA_def_string(ot->srna, "path", "Path", FILE_MAX, "Filepath", "Path to image file");
+ RNA_def_string(ot->srna, "filepath", "Path", FILE_MAX, "Filepath", "Path to image file");
}
static int uv_texture_remove_exec(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 9f8fe7ba0f2..e29c23b1f4d 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -232,7 +232,7 @@ int ED_object_add_generic_invoke(bContext *C, wmOperator *op, wmEvent *event)
return op->type->exec(C, op);
}
-void ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer)
+int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, float *rot, int *enter_editmode, unsigned int *layer)
{
int a, layer_values[32];
int view_align;
@@ -241,7 +241,23 @@ void ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, flo
if(RNA_struct_find_property(op->ptr, "enter_editmode") && RNA_boolean_get(op->ptr, "enter_editmode")) {
*enter_editmode = TRUE;
}
-
+
+ if(RNA_property_is_set(op->ptr, "layer")) {
+ RNA_boolean_get_array(op->ptr, "layer", layer_values);
+
+ for(a=0; a<32; a++) {
+ if(layer_values[a])
+ *layer |= (1 << a);
+ else
+ *layer &= ~(1 << a);
+ }
+ }
+ else {
+ /* not set, use the scenes layers */
+ Scene *scene = CTX_data_scene(C);
+ *layer = scene->layact;
+ }
+
if (RNA_property_is_set(op->ptr, "view_align"))
view_align = RNA_boolean_get(op->ptr, "view_align");
else
@@ -254,13 +270,13 @@ void ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc, flo
RNA_float_get_array(op->ptr, "location", loc);
- RNA_boolean_get_array(op->ptr, "layer", layer_values);
-
- for(a=0; a<32; a++)
- if(layer_values[a])
- *layer |= (1 << a);
- else
- *layer &= ~(1 << a);
+
+ if(*layer == 0) {
+ BKE_report(op->reports, RPT_ERROR, "Property 'layer' has no values set");
+ return 0;
+ }
+
+ return 1;
}
/* for object add primitive operators */
@@ -298,7 +314,9 @@ static int object_add_exec(bContext *C, wmOperator *op)
unsigned int layer;
float loc[3], rot[3];
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
+
ED_object_add_type(C, RNA_enum_get(op->ptr, "type"), loc, rot, enter_editmode, layer);
return OPERATOR_FINISHED;
@@ -357,7 +375,9 @@ static Object *effector_add_type(bContext *C, wmOperator *op, int type)
float mat[4][4];
object_add_generic_invoke_options(C, op);
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return NULL;
if(type==PFIELD_GUIDE) {
ob= ED_object_add_type(C, OB_CURVE, loc, rot, FALSE, layer);
@@ -391,8 +411,9 @@ static Object *effector_add_type(bContext *C, wmOperator *op, int type)
/* for object add operator */
static int effector_add_exec(bContext *C, wmOperator *op)
{
- effector_add_type(C, op, RNA_int_get(op->ptr, "type"));
-
+ if(effector_add_type(C, op, RNA_int_get(op->ptr, "type")) == NULL)
+ return OPERATOR_CANCELLED;
+
return OPERATOR_FINISHED;
}
@@ -432,7 +453,9 @@ static int object_camera_add_exec(bContext *C, wmOperator *op)
RNA_boolean_set(op->ptr, "view_align", 1);
object_add_generic_invoke_options(C, op);
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
ob= ED_object_add_type(C, OB_CAMERA, loc, rot, FALSE, layer);
@@ -489,7 +512,9 @@ static int object_add_surface_exec(bContext *C, wmOperator *op)
float mat[4][4];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
if(obedit==NULL || obedit->type!=OB_SURF) {
obedit= ED_object_add_type(C, OB_SURF, loc, rot, TRUE, layer);
@@ -554,7 +579,9 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op)
float mat[4][4];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
if(obedit==NULL || obedit->type!=OB_MBALL) {
obedit= ED_object_add_type(C, OB_MBALL, loc, rot, TRUE, layer);
@@ -624,7 +651,8 @@ static int object_add_text_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
if(obedit && obedit->type==OB_FONT)
return OPERATOR_CANCELLED;
@@ -664,7 +692,8 @@ static int object_armature_add_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op); // XXX these props don't get set right when only exec() is called
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
if ((obedit==NULL) || (obedit->type != OB_ARMATURE)) {
obedit= ED_object_add_type(C, OB_ARMATURE, loc, rot, TRUE, layer);
@@ -719,7 +748,8 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op);
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
ob= ED_object_add_type(C, OB_LAMP, loc, rot, FALSE, layer);
if(ob && ob->data)
@@ -766,7 +796,8 @@ static int group_instance_add_exec(bContext *C, wmOperator *op)
float loc[3], rot[3];
object_add_generic_invoke_options(C, op);
- ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer);
+ if(!ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer))
+ return OPERATOR_CANCELLED;
if(group) {
Object *ob= ED_object_add_type(C, OB_EMPTY, loc, rot, FALSE, layer);
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index c6164fef8a8..8bd0da3b43f 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -106,7 +106,6 @@ void OBJECT_OT_select_same_group(struct wmOperatorType *ot);
/* object_add.c */
void OBJECT_OT_add(struct wmOperatorType *ot);
void OBJECT_OT_add_named(struct wmOperatorType *ot);
-void OBJECT_OT_surface_add(struct wmOperatorType *ot);
void OBJECT_OT_metaball_add(struct wmOperatorType *ot);
void OBJECT_OT_text_add(struct wmOperatorType *ot);
void OBJECT_OT_armature_add(struct wmOperatorType *ot);
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index c5c7d49d0a4..56742413358 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1022,7 +1022,7 @@ static int multires_external_save_exec(bContext *C, wmOperator *op)
if(CustomData_external_test(&me->fdata, CD_MDISPS))
return OPERATOR_CANCELLED;
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
if(relative)
BLI_path_rel(path, G.sce);
@@ -1054,13 +1054,13 @@ static int multires_external_save_invoke(bContext *C, wmOperator *op, wmEvent *e
if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return multires_external_save_exec(C, op);
op->customdata= me;
BLI_snprintf(path, sizeof(path), "//%s.btx", me->id.name+2);
- RNA_string_set(op->ptr, "path", path);
+ RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op);
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 09fcd9432de..ba706a0d4b9 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -113,7 +113,6 @@ void ED_operatortypes_object(void)
WM_operatortype_append(OBJECT_OT_delete);
WM_operatortype_append(OBJECT_OT_text_add);
- WM_operatortype_append(OBJECT_OT_surface_add);
WM_operatortype_append(OBJECT_OT_armature_add);
WM_operatortype_append(OBJECT_OT_lamp_add);
WM_operatortype_append(OBJECT_OT_camera_add);
@@ -388,17 +387,17 @@ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keym
if(do_pet > 0) {
/* context ops */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing_falloff");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing_falloff");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing");
RNA_string_set(kmi->ptr, "value_1", "DISABLED");
RNA_string_set(kmi->ptr, "value_2", "ENABLED");
/* for modes/object types that allow 'conencted' mode, add the Alt O key */
if (do_pet > 1) {
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.proportional_editing");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing");
RNA_string_set(kmi->ptr, "value_1", "DISABLED");
RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
}
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 541b0cf494f..5ef805e25b4 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -1321,7 +1321,7 @@ static int select_all_exec(bContext *C, wmOperator *op)
}
PE_update_selection(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
}
@@ -1371,7 +1371,7 @@ int PE_mouse_particles(bContext *C, short *mval, int extend)
for_mouse_hit_keys(&data, toggle_key_select, 1); /* nearest only */
PE_update_selection(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
}
@@ -1395,7 +1395,7 @@ static int select_roots_exec(bContext *C, wmOperator *op)
foreach_point(&data, select_root);
PE_update_selection(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
}
@@ -1435,7 +1435,7 @@ static int select_tips_exec(bContext *C, wmOperator *op)
foreach_point(&data, select_tip);
PE_update_selection(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
}
@@ -1475,7 +1475,7 @@ static int select_linked_exec(bContext *C, wmOperator *op)
for_mouse_hit_keys(&data, select_keys, 1); /* nearest only */
PE_update_selection(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
}
@@ -1541,7 +1541,7 @@ int PE_border_select(bContext *C, rcti *rect, int select, int extend)
for_mouse_hit_keys(&data, select_key, 0);
PE_update_selection(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
}
@@ -1566,7 +1566,7 @@ int PE_circle_select(bContext *C, int selecting, short *mval, float rad)
for_mouse_hit_keys(&data, select_key, 0);
PE_update_selection(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
}
@@ -1632,7 +1632,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select)
}
PE_update_selection(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
}
@@ -1666,7 +1666,7 @@ static int hide_exec(bContext *C, wmOperator *op)
}
PE_update_selection(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
}
@@ -1708,7 +1708,7 @@ static int reveal_exec(bContext *C, wmOperator *op)
}
PE_update_selection(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, ob);
return OPERATOR_FINISHED;
}
@@ -1766,7 +1766,7 @@ static int select_less_exec(bContext *C, wmOperator *op)
foreach_point(&data, select_less_keys);
PE_update_selection(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
}
@@ -1827,7 +1827,7 @@ static int select_more_exec(bContext *C, wmOperator *op)
foreach_point(&data, select_more_keys);
PE_update_selection(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
}
@@ -1864,7 +1864,7 @@ static int select_inverse_exec(bContext *C, wmOperator *op)
}
PE_update_selection(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_SELECTED, data.ob);
return OPERATOR_FINISHED;
}
@@ -1955,7 +1955,7 @@ static int rekey_exec(bContext *C, wmOperator *op)
recalc_lengths(data.edit);
PE_update_object(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, data.ob);
return OPERATOR_FINISHED;
}
@@ -2260,7 +2260,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
recalc_lengths(data.edit);
PE_update_object(data.scene, data.ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, data.ob);
return OPERATOR_FINISHED;
}
@@ -2348,7 +2348,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op)
BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved);
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
return OPERATOR_FINISHED;
}
@@ -2398,7 +2398,7 @@ static int weight_set_exec(bContext *C, wmOperator *op)
}
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
return OPERATOR_FINISHED;
}
@@ -2575,7 +2575,7 @@ static int delete_exec(bContext *C, wmOperator *op)
}
DAG_id_flush_update(&data.ob->id, OB_RECALC_DATA);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, data.ob);
return OPERATOR_FINISHED;
}
@@ -2734,7 +2734,7 @@ static int mirror_exec(bContext *C, wmOperator *op)
PE_mirror_x(scene, ob, 0);
update_world_cos(ob, edit);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
return OPERATOR_FINISHED;
@@ -3519,7 +3519,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
else
PE_update_object(scene, ob, 1);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
bedit->lastmouse[0]= mouse[0];
bedit->lastmouse[1]= mouse[1];
@@ -4138,7 +4138,7 @@ static int clear_edited_exec(bContext *C, wmOperator *op)
psys->flag &= ~PSYS_EDITED;
psys_reset(psys, PSYS_RESET_DEPSGRAPH);
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
}
}
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 8d3a1acdd1b..e96eae49f33 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -969,7 +969,7 @@ static int envmap_save_exec(bContext *C, wmOperator *op)
int imtype = scene->r.imtype;
char path[FILE_MAX];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
if(scene->r.scemode & R_EXTENSION) {
BKE_add_image_extension(path, imtype);
@@ -993,12 +993,12 @@ static int envmap_save_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return envmap_save_exec(C, op);
//RNA_enum_set(op->ptr, "file_type", scene->r.imtype);
- RNA_string_set(op->ptr, "path", G.sce);
+ RNA_string_set(op->ptr, "filepath", G.sce);
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 141a7c1c050..5f592aeba52 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -75,7 +75,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
ImBuf *ibuf;
char path[FILE_MAX];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
strcpy(G.ima, path);
BLI_path_abs(path, G.sce);
@@ -147,10 +147,10 @@ static int screenshot_invoke(bContext *C, wmOperator *op, wmEvent *event)
scd->dumprect= dumprect;
op->customdata= scd;
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return screenshot_exec(C, op);
- RNA_string_set(op->ptr, "path", G.ima);
+ RNA_string_set(op->ptr, "filepath", G.ima);
WM_event_add_fileselect(C, op);
@@ -341,7 +341,7 @@ void SCREEN_OT_screencast(wmOperatorType *ot)
ot->flag= 0;
- RNA_def_property(ot->srna, "path", PROP_STRING, PROP_FILEPATH);
+ RNA_def_property(ot->srna, "filepath", PROP_STRING, PROP_FILEPATH);
RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "");
}
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index abd56babd8d..5470ac83370 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -146,34 +146,34 @@ static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *path)
wmKeyMapItem *kmi;
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 0);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", TWOKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 1);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", THREEKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 2);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FOURKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 3);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FIVEKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 4);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SIXKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 5);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SEVENKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 6);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", EIGHTKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 7);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", NINEKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 8);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ZEROKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_int_set(kmi->ptr, "value", 9);
}
@@ -182,11 +182,11 @@ static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *path)
wmKeyMapItem *kmi;
kmi= WM_keymap_add_item(keymap, "WM_OT_context_scale_int", LEFTBRACKETKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_float_set(kmi->ptr, "value", 0.9);
kmi= WM_keymap_add_item(keymap, "WM_OT_context_scale_int", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", path);
+ RNA_string_set(kmi->ptr, "data_path", path);
RNA_float_set(kmi->ptr, "value", 10.0/9.0); // 1.1111....
}
@@ -223,40 +223,40 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_anchor");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_anchor");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_smooth_stroke");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_smooth_stroke");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", RKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_rake");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_rake");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_airbrush");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.brush.use_airbrush");
/* brush switching */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", DKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Draw");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", SKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Smooth");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Pinch");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", GKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Grab");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", LKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Layer");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", TKEY, KM_PRESS, KM_SHIFT, 0); // was just T in 2.4x
- RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.active_brush_name");
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.sculpt.active_brush_name");
RNA_string_set(kmi->ptr, "value", "Flatten");
@@ -276,7 +276,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.vertex_paint.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
- RNA_string_set(kmi->ptr, "path", "vertex_paint_object.data.use_paint_mask");
+ RNA_string_set(kmi->ptr, "data_path", "vertex_paint_object.data.use_paint_mask");
/* Weight Paint mode */
keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0);
@@ -294,7 +294,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.weight_paint.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
- RNA_string_set(kmi->ptr, "path", "weight_paint_object.data.use_paint_mask");
+ RNA_string_set(kmi->ptr, "data_path", "weight_paint_object.data.use_paint_mask");
WM_keymap_verify_item(keymap, "PAINT_OT_weight_from_bones", WKEY, KM_PRESS, 0, 0);
@@ -314,7 +314,7 @@ void ED_keymap_paint(wmKeyConfig *keyconf)
ed_keymap_paint_brush_size(keymap, "tool_settings.image_paint.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS, 0, 0); /* mask toggle */
- RNA_string_set(kmi->ptr, "path", "texture_paint_object.data.use_paint_mask");
+ RNA_string_set(kmi->ptr, "data_path", "texture_paint_object.data.use_paint_mask");
/* face-mask mode */
keymap= WM_keymap_find(keyconf, "Face Mask", 0, 0);
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 2650c2e278c..c1ef23e44a2 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -864,6 +864,7 @@ void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode)
Mesh *me= get_mesh(ob);
int index;
short mval[2] = {0, 0}, sco[2];
+ int vgroup= ob->actdef-1;
if (!me) return;
@@ -938,7 +939,6 @@ void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode)
}
else {
DerivedMesh *dm;
- MDeformWeight *dw;
float w1, w2, w3, w4, co[3], fac;
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
@@ -968,21 +968,17 @@ void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode)
fac= MIN4(w1, w2, w3, w4);
if(w1==fac) {
- dw= defvert_find_index(me->dvert+mface->v1, ob->actdef-1);
- if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
+ ts->vgroup_weight= defvert_find_weight(me->dvert+mface->v1, vgroup);
}
else if(w2==fac) {
- dw= defvert_find_index(me->dvert+mface->v2, ob->actdef-1);
- if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
+ ts->vgroup_weight= defvert_find_weight(me->dvert+mface->v2, vgroup);
}
else if(w3==fac) {
- dw= defvert_find_index(me->dvert+mface->v3, ob->actdef-1);
- if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
+ ts->vgroup_weight= defvert_find_weight(me->dvert+mface->v3, vgroup);
}
else if(w4==fac) {
if(mface->v4) {
- dw= defvert_find_index(me->dvert+mface->v4, ob->actdef-1);
- if(dw) ts->vgroup_weight= dw->weight; else ts->vgroup_weight= 0.0f;
+ ts->vgroup_weight= defvert_find_weight(me->dvert+mface->v4, vgroup);
}
}
}
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index b4109692a4c..f362c584585 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -80,7 +80,7 @@ static int open_exec(bContext *C, wmOperator *op)
PointerRNA idptr;
AUD_SoundInfo info;
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
sound = sound_new_file(CTX_data_main(C), path);
if(!op->customdata)
@@ -127,7 +127,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op);
open_init(C, op);
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index b6e3327bd12..01c8ede6a2a 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -99,7 +99,7 @@ static int act_new_exec(bContext *C, wmOperator *op)
}
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -379,7 +379,7 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -474,7 +474,7 @@ static int actkeys_insertkey_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -542,7 +542,7 @@ static int actkeys_duplicate_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED; // xxx - start transform
}
@@ -629,7 +629,7 @@ static int actkeys_delete_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -693,7 +693,7 @@ static int actkeys_clean_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -757,7 +757,7 @@ static int actkeys_sample_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1238,7 +1238,7 @@ static int actkeys_snap_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1355,7 +1355,7 @@ static int actkeys_mirror_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 33f918c0711..e852afa9a87 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -156,7 +156,7 @@ static int actkeys_deselectall_exec(bContext *C, wmOperator *op)
deselect_action_keys(&ac, 1, SELECT_ADD);
/* set notifier that keyframe selection have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -317,7 +317,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op)
borderselect_action(&ac, rect, mode, selectmode);
/* set notifier that keyframe selection have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -531,7 +531,7 @@ static int actkeys_columnselect_exec(bContext *C, wmOperator *op)
columnselect_action_keys(&ac, mode);
/* set notifier that keyframe selection have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -589,7 +589,7 @@ static int actkeys_select_linked_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -667,7 +667,7 @@ static int actkeys_select_more_exec (bContext *C, wmOperator *op)
select_moreless_action_keys(&ac, SELMAP_MORE);
/* set notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -701,7 +701,7 @@ static int actkeys_select_less_exec (bContext *C, wmOperator *op)
select_moreless_action_keys(&ac, SELMAP_LESS);
/* set notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -1138,7 +1138,7 @@ static int actkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
}
/* set notifier that keyframe selection (and channels too) have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT|ND_ANIMCHAN_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|ND_ANIMCHAN|NA_SELECTED, NULL);
/* for tweak grab to work */
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index 41ae6609b80..bad35d9d3e6 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -352,7 +352,7 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn)
switch (wmn->category) {
case NC_ANIMATION:
/* for selection changes of animation data, we can just redraw... otherwise autocolor might need to be done again */
- if (ELEM(wmn->data, ND_KEYFRAME_SELECT, ND_ANIMCHAN_SELECT))
+ if (ELEM(wmn->data, ND_KEYFRAME, ND_ANIMCHAN) && (wmn->action == NA_SELECTED))
ED_area_tag_redraw(sa);
else
ED_area_tag_refresh(sa);
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index ef7b3ce6d2a..36aecd02138 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -88,10 +88,10 @@ static int file_browse_exec(bContext *C, wmOperator *op)
FileBrowseOp *fbo= op->customdata;
char *str;
- if (RNA_property_is_set(op->ptr, "path")==0 || fbo==NULL)
+ if (RNA_property_is_set(op->ptr, "filepath")==0 || fbo==NULL)
return OPERATOR_CANCELLED;
- str= RNA_string_get_alloc(op->ptr, "path", 0, 0);
+ str= RNA_string_get_alloc(op->ptr, "filepath", 0, 0);
RNA_property_string_set(&fbo->ptr, fbo->prop, str);
RNA_property_update(C, &fbo->ptr, fbo->prop);
MEM_freeN(str);
@@ -126,7 +126,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
op->customdata= fbo;
str= RNA_property_string_get_alloc(&ptr, prop, 0, 0);
- RNA_string_set(op->ptr, "path", str);
+ RNA_string_set(op->ptr, "filepath", str);
MEM_freeN(str);
WM_event_add_fileselect(C, op);
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 97cee5c730f..e28fcf8c28a 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -293,8 +293,9 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
buttons_area_redraw(sa, BCONTEXT_CONSTRAINT);
buttons_area_redraw(sa, BCONTEXT_BONE_CONSTRAINT);
break;
- case ND_PARTICLE_DATA:
- buttons_area_redraw(sa, BCONTEXT_PARTICLE);
+ case ND_PARTICLE:
+ if (wmn->action == NA_EDITED)
+ buttons_area_redraw(sa, BCONTEXT_PARTICLE);
break;
case ND_DRAW:
buttons_area_redraw(sa, BCONTEXT_OBJECT);
@@ -357,8 +358,9 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn)
break;
case NC_ANIMATION:
switch(wmn->data) {
- case ND_KEYFRAME_EDIT:
- ED_area_tag_redraw(sa);
+ case ND_KEYFRAME:
+ if (wmn->action == NA_EDITED)
+ ED_area_tag_redraw(sa);
break;
}
}
diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c
index 035af229603..c04f8183bee 100644
--- a/source/blender/editors/space_console/space_console.c
+++ b/source/blender/editors/space_console/space_console.c
@@ -289,19 +289,19 @@ void console_keymap(struct wmKeyConfig *keyconf)
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", ENDKEY, KM_PRESS, 0, 0)->ptr, "type", LINE_END);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1);
RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_move", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "type", PREV_CHAR);
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index ccecbd61663..9028e5f15c6 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -576,7 +576,7 @@ int file_exec(bContext *C, wmOperator *exec_op)
if(RNA_boolean_get(op->ptr, "relative_path"))
BLI_path_rel(name, G.sce);
- RNA_string_set(op->ptr, "path", name);
+ RNA_string_set(op->ptr, "filepath", name);
/* some ops have multiple files to select */
{
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 637e56459d7..4a505bc022f 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -182,7 +182,7 @@ static void file_panel_operator(const bContext *C, Panel *pa)
if(flag & PROP_HIDDEN)
continue;
- if(strcmp(RNA_property_identifier(prop), "path") == 0)
+ if(strcmp(RNA_property_identifier(prop), "filepath") == 0)
continue;
if(strcmp(RNA_property_identifier(prop), "directory") == 0)
continue;
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index f971e18043c..abb3a6a7a35 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -127,8 +127,8 @@ short ED_fileselect_set_params(SpaceFile *sfile)
else
params->type = FILE_SPECIAL;
- if (RNA_property_is_set(op->ptr, "path")) {
- RNA_string_get(op->ptr, "path", name);
+ if (RNA_property_is_set(op->ptr, "filepath")) {
+ RNA_string_get(op->ptr, "filepath", name);
if (params->type == FILE_LOADLIB) {
BLI_strncpy(params->dir, name, sizeof(params->dir));
BLI_cleanup_dir(G.sce, params->dir);
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index c59b4783708..6834dfac58a 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -467,7 +467,7 @@ static int graphkeys_insertkey_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -531,7 +531,7 @@ static int graphkeys_click_insert_exec (bContext *C, wmOperator *op)
MEM_freeN(ale);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -682,7 +682,7 @@ static int graphkeys_paste_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -740,7 +740,7 @@ static int graphkeys_duplicate_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -820,7 +820,7 @@ static int graphkeys_delete_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -882,7 +882,7 @@ static int graphkeys_clean_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -965,7 +965,7 @@ static int graphkeys_bake_exec(bContext *C, wmOperator *op)
/* set notifier that keyframes have changed */
// NOTE: some distinction between order/number of keyframes and type should be made?
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1037,7 +1037,7 @@ static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op)
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
scene= ac.scene; /* current scene */
@@ -1085,7 +1085,7 @@ static int graphkeys_sound_bake_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that 'keyframes' have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1170,7 +1170,7 @@ static int graphkeys_sample_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1690,7 +1690,7 @@ static int graphkeys_snap_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1814,7 +1814,7 @@ static int graphkeys_mirror_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -1869,7 +1869,7 @@ static int graphkeys_smooth_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
@@ -2086,7 +2086,7 @@ static int graph_fmodifier_paste_exec(bContext *C, wmOperator *op)
ANIM_editkeyframes_refresh(&ac);
/* set notifier that keyframes have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index 17b0a87b0a8..6a9d8801e28 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -160,7 +160,7 @@ static int graphkeys_deselectall_exec(bContext *C, wmOperator *op)
deselect_graph_keys(&ac, 1, SELECT_ADD);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -329,7 +329,7 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op)
borderselect_graphkeys(&ac, rect, mode, selectmode, incl_handles);
/* send notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -520,7 +520,7 @@ static int graphkeys_columnselect_exec(bContext *C, wmOperator *op)
columnselect_graph_keys(&ac, mode);
/* set notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -578,7 +578,7 @@ static int graphkeys_select_linked_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -656,7 +656,7 @@ static int graphkeys_select_more_exec (bContext *C, wmOperator *op)
select_moreless_graph_keys(&ac, SELMAP_MORE);
/* set notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -690,7 +690,7 @@ static int graphkeys_select_less_exec (bContext *C, wmOperator *op)
select_moreless_graph_keys(&ac, SELMAP_LESS);
/* set notifier that keyframe selection has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -1260,7 +1260,7 @@ static int graphkeys_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *ev
}
/* set notifier that keyframe selection (and also channel selection in some cases) has changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_SELECT|ND_ANIMCHAN_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|ND_ANIMCHAN|NA_SELECTED, NULL);
/* for tweak grab to work */
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index e7cee30f374..1e006ca38ec 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -382,9 +382,12 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
case ND_OB_ACTIVE:
case ND_FRAME:
case ND_MARKERS:
- case ND_SEQUENCER_SELECT:
ED_region_tag_redraw(ar);
break;
+ case ND_SEQUENCER:
+ if (wmn->action == NA_SELECTED)
+ ED_region_tag_redraw(ar);
+ break;
}
break;
case NC_OBJECT:
@@ -401,13 +404,9 @@ static void graph_region_listener(ARegion *ar, wmNotifier *wmn)
}
break;
case NC_NODE:
- switch(wmn->data) {
- case ND_NODE_SELECT:
- ED_region_tag_redraw(ar);
- break;
- }
switch(wmn->action) {
case NA_EDITED:
+ case NA_SELECTED:
ED_region_tag_redraw(ar);
break;
}
@@ -432,7 +431,7 @@ static void graph_listener(ScrArea *sa, wmNotifier *wmn)
switch (wmn->category) {
case NC_ANIMATION:
/* for selection changes of animation data, we can just redraw... otherwise autocolor might need to be done again */
- if (ELEM(wmn->data, ND_KEYFRAME_SELECT, ND_ANIMCHAN_SELECT))
+ if (ELEM(wmn->data, ND_KEYFRAME, ND_ANIMCHAN) && (wmn->action == NA_SELECTED))
ED_area_tag_redraw(sa);
else
ED_area_tag_refresh(sa);
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index b08ea810a33..357aa9dacdf 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -841,6 +841,16 @@ void uiTemplateImage(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propn
if(ima->source != IMA_SRC_GENERATED) {
row= uiLayoutRow(layout, 1);
+ split = uiLayoutSplit(row, 0.0, 0);
+ if (ima->packedfile)
+ uiItemO(split, "", ICON_PACKAGE, "image.unpack");
+ else
+ uiItemO(split, "", ICON_UGLYPACKAGE, "image.pack");
+
+ split = uiLayoutSplit(row, 0.0, 0);
+ row= uiLayoutRow(split, 1);
+ uiLayoutSetEnabled(row, ima->packedfile==NULL);
+
uiItemR(row, &imaptr, "filepath", 0, "", 0);
uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
}
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 3eeeb865ae4..c4265c6e011 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -25,6 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#include <stddef.h>
#include <string.h>
#include <stdlib.h>
@@ -654,7 +655,7 @@ static const EnumPropertyItem image_file_type_items[] = {
static void image_filesel(bContext *C, wmOperator *op, const char *path)
{
- RNA_string_set(op->ptr, "path", path);
+ RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op);
}
@@ -685,7 +686,7 @@ static int open_exec(bContext *C, wmOperator *op)
Image *ima= NULL;
char str[FILE_MAX];
- RNA_string_get(op->ptr, "path", str);
+ RNA_string_get(op->ptr, "filepath", str);
/* default to frame 1 if there's no scene in context */
ima= BKE_add_image_file(str, scene ? scene->r.cfra : 1);
@@ -729,7 +730,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op);
open_init(C, op);
@@ -767,7 +768,7 @@ static int replace_exec(bContext *C, wmOperator *op)
if(!sima->image)
return OPERATOR_CANCELLED;
- RNA_string_get(op->ptr, "path", str);
+ RNA_string_get(op->ptr, "filepath", str);
BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)-1); /* we cant do much if the str is longer then 240 :/ */
BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_RELOAD);
@@ -784,7 +785,7 @@ static int replace_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!sima->image)
return OPERATOR_CANCELLED;
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return replace_exec(C, op);
image_filesel(C, op, path);
@@ -918,7 +919,7 @@ static int save_as_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
sima->imtypenr= RNA_enum_get(op->ptr, "file_type");
- RNA_string_get(op->ptr, "path", str);
+ RNA_string_get(op->ptr, "filepath", str);
save_image_doit(C, sima, scene, op, str);
@@ -936,7 +937,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return save_as_exec(C, op);
if(!ima)
@@ -1285,6 +1286,8 @@ static int pack_exec(bContext *C, wmOperator *op)
else
ima->packedfile= newPackedFile(op->reports, ima->name);
+ WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
+
return OPERATOR_FINISHED;
}
@@ -1315,12 +1318,12 @@ void IMAGE_OT_pack(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Pack";
+ ot->description= "Pack an image as embedded data into the .blend file";
ot->idname= "IMAGE_OT_pack";
/* api callbacks */
ot->exec= pack_exec;
ot->invoke= pack_invoke;
- ot->poll= space_image_buffer_exists_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -1331,12 +1334,14 @@ void IMAGE_OT_pack(wmOperatorType *ot)
/********************* unpack operator *********************/
-void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf)
+void unpack_menu(bContext *C, char *opname, Image *ima, char *folder, PackedFile *pf)
{
+ PointerRNA props_ptr;
uiPopupMenu *pup;
uiLayout *layout;
char line[FILE_MAXDIR + FILE_MAXFILE + 100];
char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX];
+ char *abs_name = ima->name;
strcpy(local_name, abs_name);
BLI_splitdirstring(local_name, fi);
@@ -1351,17 +1356,33 @@ void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, Packed
switch(checkPackedFile(local_name, pf)) {
case PF_NOFILE:
sprintf(line, "Create %s", local_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
+
break;
case PF_EQUAL:
sprintf(line, "Use %s (identical)", local_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
+ //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
+
break;
case PF_DIFFERS:
sprintf(line, "Use %s (differs)", local_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
+ //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_LOCAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_USE_LOCAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name);
+
sprintf(line, "Overwrite %s", local_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL);
+ //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_LOCAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_WRITE_LOCAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
+
+
break;
}
}
@@ -1369,17 +1390,30 @@ void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, Packed
switch(checkPackedFile(abs_name, pf)) {
case PF_NOFILE:
sprintf(line, "Create %s", abs_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
+ //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
break;
case PF_EQUAL:
sprintf(line, "Use %s (identical)", abs_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
+ //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
break;
case PF_DIFFERS:
sprintf(line, "Use %s (differs)", local_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
+ //uiItemEnumO(layout, opname, line, 0, "method", PF_USE_ORIGINAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_USE_ORIGINAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
+
sprintf(line, "Overwrite %s", local_name);
- uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
+ //uiItemEnumO(layout, opname, line, 0, "method", PF_WRITE_ORIGINAL);
+ props_ptr= uiItemFullO(layout, opname, line, 0, NULL, WM_OP_EXEC_DEFAULT, UI_ITEM_O_RETURN_PROPS);
+ RNA_enum_set(&props_ptr, "method", PF_WRITE_ORIGINAL);
+ RNA_string_set(&props_ptr, "image", ima->id.name+2);
break;
}
@@ -1391,6 +1425,14 @@ static int unpack_exec(bContext *C, wmOperator *op)
Image *ima= CTX_data_edit_image(C);
int method= RNA_enum_get(op->ptr, "method");
+ /* find the suppplied image by name */
+ if (RNA_property_is_set(op->ptr, "image")) {
+ char imaname[22];
+ RNA_string_get(op->ptr, "image", imaname);
+ ima = BLI_findstring(&CTX_data_main(C)->image, imaname, offsetof(ID, name) + 2);
+ if (!ima) ima = CTX_data_edit_image(C);
+ }
+
if(!ima || !ima->packedfile)
return OPERATOR_CANCELLED;
@@ -1401,8 +1443,10 @@ static int unpack_exec(bContext *C, wmOperator *op)
if(G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
-
+
unpackImage(op->reports, ima, method);
+
+ WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
return OPERATOR_FINISHED;
}
@@ -1411,6 +1455,9 @@ static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Image *ima= CTX_data_edit_image(C);
+ if(RNA_property_is_set(op->ptr, "image"))
+ return unpack_exec(C, op);
+
if(!ima || !ima->packedfile)
return OPERATOR_CANCELLED;
@@ -1422,7 +1469,7 @@ static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
- unpack_menu(C, "IMAGE_OT_unpack", ima->name, "textures", ima->packedfile);
+ unpack_menu(C, "IMAGE_OT_unpack", ima, "textures", ima->packedfile);
return OPERATOR_FINISHED;
}
@@ -1431,18 +1478,19 @@ void IMAGE_OT_unpack(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Unpack";
+ ot->description= "Save an image packed in the .blend file to disk";
ot->idname= "IMAGE_OT_unpack";
/* api callbacks */
ot->exec= unpack_exec;
ot->invoke= unpack_invoke;
- ot->poll= space_image_buffer_exists_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack.");
+ RNA_def_string(ot->srna, "image", "", 21, "Image Name", "Image datablock name to unpack.");
}
/******************** sample image operator ********************/
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 7e3cfcdb6bc..3eae1438517 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -540,7 +540,7 @@ static int image_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static void image_drop_copy(wmDrag *drag, wmDropBox *drop)
{
/* copy drag path to properties */
- RNA_string_set(drop->ptr, "path", drag->path);
+ RNA_string_set(drop->ptr, "filepath", drag->path);
}
/* area+region dropbox definition */
diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c
index 86d7d6bf014..2a1a20aa0d7 100644
--- a/source/blender/editors/space_info/info_ops.c
+++ b/source/blender/editors/space_info/info_ops.c
@@ -271,7 +271,7 @@ static int find_missing_files_exec(bContext *C, wmOperator *op)
{
char *path;
- path= RNA_string_get_alloc(op->ptr, "path", NULL, 0);
+ path= RNA_string_get_alloc(op->ptr, "filepath", NULL, 0);
findMissingFiles(path, G.sce);
MEM_freeN(path);
diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c
index 632331459cb..44cc4066b03 100644
--- a/source/blender/editors/space_logic/logic_ops.c
+++ b/source/blender/editors/space_logic/logic_ops.c
@@ -77,9 +77,6 @@ static int edit_actuator_poll(bContext *C)
return 1;
}
-/* this is the nice py-api-compatible way to do it, like modifiers,
- but not entirely working yet..
-
static void edit_sensor_properties(wmOperatorType *ot)
{
RNA_def_string(ot->srna, "sensor", "", 32, "Sensor", "Name of the sensor to edit");
@@ -105,24 +102,37 @@ static int edit_sensor_invoke_properties(bContext *C, wmOperator *op)
return 0;
}
-static bSensor *edit_sensor_property_get(bContext *C, wmOperator *op, Object *ob)
+static Object *edit_object_property_get(bContext *C, wmOperator *op)
{
- char sensor_name[32];
char ob_name[32];
+ Object *ob;
+
+ RNA_string_get(op->ptr, "object", ob_name);
+
+ /* if ob_name is valid try to find the object with this name
+ otherwise gets the active object */
+ if (BLI_strnlen(ob_name, 32) > 0)
+ ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2);
+ else
+ ob= ED_object_active_context(C);
+
+ return ob;
+}
+
+static bSensor *edit_sensor_property_get(bContext *C, wmOperator *op, Object **ob)
+{
+ char sensor_name[32];
bSensor *sens;
RNA_string_get(op->ptr, "sensor", sensor_name);
- RNA_string_get(op->ptr, "object", ob_name);
-
- ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2);
- if (!ob)
- return NULL;
+
+ *ob= edit_object_property_get(C, op);
+ if (!*ob) return NULL;
- sens = BLI_findstring(&(ob->sensors), sensor_name, offsetof(bSensor, name));
+ sens = BLI_findstring(&((*ob)->sensors), sensor_name, offsetof(bSensor, name));
return sens;
}
- */
-/*
+
static void edit_controller_properties(wmOperatorType *ot)
{
RNA_def_string(ot->srna, "controller", "", 32, "Controller", "Name of the controller to edit");
@@ -148,20 +158,17 @@ static int edit_controller_invoke_properties(bContext *C, wmOperator *op)
return 0;
}
-static bController *edit_controller_property_get(bContext *C, wmOperator *op, Object *ob)
+static bController *edit_controller_property_get(bContext *C, wmOperator *op, Object **ob)
{
char controller_name[32];
- char ob_name[32];
bController *cont;
RNA_string_get(op->ptr, "controller", controller_name);
- RNA_string_get(op->ptr, "object", ob_name);
-
- ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2);
- if (!ob)
- return NULL;
+
+ *ob= edit_object_property_get(C, op);
+ if (!*ob) return NULL;
- cont = BLI_findstring(&(ob->controllers), controller_name, offsetof(bController, name));
+ cont = BLI_findstring(&((*ob)->controllers), controller_name, offsetof(bController, name));
return cont;
}
@@ -190,33 +197,26 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op)
return 0;
}
-static bController *edit_actuator_property_get(bContext *C, wmOperator *op, Object *ob)
+static bActuator *edit_actuator_property_get(bContext *C, wmOperator *op, Object **ob)
{
char actuator_name[32];
- char ob_name[32];
bActuator *act;
RNA_string_get(op->ptr, "actuator", actuator_name);
- RNA_string_get(op->ptr, "object", ob_name);
-
- ob = BLI_findstring(&(CTX_data_main(C)->object), ob_name, offsetof(ID, name) + 2);
- if (!ob)
- return NULL;
+
+ *ob= edit_object_property_get(C, op);
+ if (!*ob) return NULL;
- cont = BLI_findstring(&(ob->actuators), actuator_name, offsetof(bActuator, name));
+ act = BLI_findstring(&((*ob)->actuators), actuator_name, offsetof(bActuator, name));
return act;
}
-*/
/* ************* Add/Remove Sensor Operator ************* */
static int sensor_remove_exec(bContext *C, wmOperator *op)
{
- /* Object *ob;
- bSensor *sens = edit_sensor_property_get(C, op, ob); */
- PointerRNA ptr = CTX_data_pointer_get_type(C, "sensor", &RNA_Sensor);
- Object *ob= ptr.id.data;
- bSensor *sens= ptr.data;
+ Object *ob=NULL;
+ bSensor *sens = edit_sensor_property_get(C, op, &ob);
if (!sens)
return OPERATOR_CANCELLED;
@@ -229,8 +229,6 @@ static int sensor_remove_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-
-/* commented along with above stuff
static int sensor_remove_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if (edit_sensor_invoke_properties(C, op))
@@ -238,7 +236,6 @@ static int sensor_remove_exec(bContext *C, wmOperator *op)
else
return OPERATOR_CANCELLED;
}
- */
void LOGIC_OT_sensor_remove(wmOperatorType *ot)
{
@@ -246,24 +243,28 @@ void LOGIC_OT_sensor_remove(wmOperatorType *ot)
ot->description= "Remove a sensor from the active object";
ot->idname= "LOGIC_OT_sensor_remove";
- //ot->invoke= sensor_remove_invoke;
+ ot->invoke= sensor_remove_invoke;
ot->exec= sensor_remove_exec;
ot->poll= edit_sensor_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- //edit_sensor_properties(ot);
+ edit_sensor_properties(ot);
}
static int sensor_add_exec(bContext *C, wmOperator *op)
{
- Object *ob = ED_object_active_context(C);
+ Object *ob;
bSensor *sens;
PointerRNA sens_ptr;
PropertyRNA *prop;
const char *sens_name;
- int type= RNA_enum_get(op->ptr, "type");
char name[32];
+ int type= RNA_enum_get(op->ptr, "type");
+
+ ob= edit_object_property_get(C, op);
+ if (!ob)
+ return OPERATOR_CANCELLED;
sens= new_sensor(type);
BLI_addtail(&(ob->sensors), sens);
@@ -308,18 +309,16 @@ void LOGIC_OT_sensor_add(wmOperatorType *ot)
/* properties */
prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, SENS_ALWAYS, "Type", "Type of sensor to add");
RNA_def_enum_funcs(prop, rna_Sensor_type_itemf);
- prop= RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Sensor to add");
+ RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Sensor to add");
+ RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Sensor to");
}
/* ************* Add/Remove Controller Operator ************* */
static int controller_remove_exec(bContext *C, wmOperator *op)
{
- /* Object *ob;
- bController *cont = edit_controller_property_get(C, op, ob); */
- PointerRNA ptr = CTX_data_pointer_get_type(C, "controller", &RNA_Controller);
- Object *ob= ptr.id.data;
- bController *cont= ptr.data;
+ Object *ob = NULL;
+ bController *cont = edit_controller_property_get(C, op, &ob);
if (!cont)
return OPERATOR_CANCELLED;
@@ -333,8 +332,6 @@ static int controller_remove_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-
-/* commented along with above stuff
static int controller_remove_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if (edit_controller_invoke_properties(C, op))
@@ -342,7 +339,6 @@ static int controller_remove_exec(bContext *C, wmOperator *op)
else
return OPERATOR_CANCELLED;
}
- */
void LOGIC_OT_controller_remove(wmOperatorType *ot)
{
@@ -350,25 +346,29 @@ void LOGIC_OT_controller_remove(wmOperatorType *ot)
ot->description= "Remove a controller from the active object";
ot->idname= "LOGIC_OT_controller_remove";
- //ot->invoke= controller_remove_invoke;
+ ot->invoke= controller_remove_invoke;
ot->exec= controller_remove_exec;
ot->poll= edit_controller_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- //edit_controller_properties(ot);
+ edit_controller_properties(ot);
}
static int controller_add_exec(bContext *C, wmOperator *op)
{
- Object *ob = ED_object_active_context(C);
+ Object *ob;
bController *cont;
PointerRNA cont_ptr;
PropertyRNA *prop;
const char *cont_name;
- int type= RNA_enum_get(op->ptr, "type");
int bit;
char name[32];
+ int type= RNA_enum_get(op->ptr, "type");
+
+ ob= edit_object_property_get(C, op);
+ if(!ob)
+ return OPERATOR_CANCELLED;
cont= new_controller(type);
BLI_addtail(&(ob->controllers), cont);
@@ -408,8 +408,6 @@ static int controller_add_exec(bContext *C, wmOperator *op)
void LOGIC_OT_controller_add(wmOperatorType *ot)
{
- PropertyRNA *prop;
-
/* identifiers */
ot->name= "Add Controller";
ot->description = "Add a controller to the active object";
@@ -424,19 +422,17 @@ void LOGIC_OT_controller_add(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- prop= RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
- prop= RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Controller to add");
+ RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
+ RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Controller to add");
+ RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Controller to");
}
/* ************* Add/Remove Actuator Operator ************* */
static int actuator_remove_exec(bContext *C, wmOperator *op)
{
- /* Object *ob;
- bActuator *cont = edit_actuator_property_get(C, op, ob); */
- PointerRNA ptr = CTX_data_pointer_get_type(C, "actuator", &RNA_Actuator);
- Object *ob= ptr.id.data;
- bActuator *act= ptr.data;
+ Object *ob=NULL;
+ bActuator *act = edit_actuator_property_get(C, op, &ob);
if (!act)
return OPERATOR_CANCELLED;
@@ -450,16 +446,13 @@ static int actuator_remove_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-
-/* commented along with above stuff
- static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int actuator_remove_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
if (edit_actuator_invoke_properties(C, op))
return actuator_remove_exec(C, op);
else
return OPERATOR_CANCELLED;
}
- */
void LOGIC_OT_actuator_remove(wmOperatorType *ot)
{
@@ -467,25 +460,28 @@ void LOGIC_OT_actuator_remove(wmOperatorType *ot)
ot->description= "Remove a actuator from the active object";
ot->idname= "LOGIC_OT_actuator_remove";
- //ot->invoke= actuator_remove_invoke;
+ ot->invoke= actuator_remove_invoke;
ot->exec= actuator_remove_exec;
ot->poll= edit_actuator_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
- //edit_controller_properties(ot);
+ edit_actuator_properties(ot);
}
static int actuator_add_exec(bContext *C, wmOperator *op)
{
- Object *ob = ED_object_active_context(C);
+ Object *ob;
bActuator *act;
PointerRNA act_ptr;
PropertyRNA *prop;
const char *act_name;
char name[32];
- //XXX RNA_string_get is not using maxlen, it's using UserPreferencesFilePaths_python_scripts_directory_get instead (what limits the string copy to 160 chars in this case and CRASHES Blender).
int type= RNA_enum_get(op->ptr, "type");
+
+ ob= edit_object_property_get(C, op);
+ if(!ob)
+ return OPERATOR_CANCELLED;
act= new_actuator(type);
BLI_addtail(&(ob->actuators), act);
@@ -530,7 +526,8 @@ void LOGIC_OT_actuator_add(wmOperatorType *ot)
/* properties */
prop= RNA_def_enum(ot->srna, "type", DummyRNA_NULL_items, CONT_LOGIC_AND, "Type", "Type of actuator to add");
RNA_def_enum_funcs(prop, rna_Actuator_type_itemf);
- prop= RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Actuator to add");
+ RNA_def_string(ot->srna, "name", "", 32, "Name", "Name of the Actuator to add");
+ RNA_def_string(ot->srna, "object", "", 32, "Object", "Name of the Object to add the Actuator to");
}
void ED_operatortypes_logic(void)
diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c
index a73902d6a2b..104bcc6286d 100644
--- a/source/blender/editors/space_logic/logic_window.c
+++ b/source/blender/editors/space_logic/logic_window.c
@@ -3507,6 +3507,7 @@ void draw_brick_sensor(uiLayout *layout, PointerRNA *ptr, bContext *C)
static void draw_controller_header(uiLayout *layout, PointerRNA *ptr)
{
uiLayout *box, *row;
+ char name[3]; //XXX provisorly for state number
box= uiLayoutBox(layout);
row= uiLayoutRow(box, 0);
@@ -3514,6 +3515,11 @@ static void draw_controller_header(uiLayout *layout, PointerRNA *ptr)
uiItemR(row, ptr, "expanded", UI_ITEM_R_NO_BG, "", 0);
uiItemR(row, ptr, "type", 0, "", 0);
uiItemR(row, ptr, "name", 0, "", 0);
+
+ /* XXX provisory: state number */
+ sprintf(name, "%d", RNA_int_get(ptr, "state_number"));
+ uiItemL(row, name, 0);
+
uiItemR(row, ptr, "priority", 0, "", 0);
uiItemO(row, "", ICON_X, "LOGIC_OT_controller_remove");
}
@@ -4393,38 +4399,6 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemR(row, &logic_ptr, "controllers_show_active_objects", 0, "Act", 0);
uiItemR(row, &logic_ptr, "controllers_show_linked_controller", 0, "Link", 0);
- RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
-
- split= uiLayoutSplit(layout, 0.05, 0);
- uiItemR(split, &settings_ptr, "show_state_panel", UI_ITEM_R_NO_BG, "", ICON_DISCLOSURE_TRI_RIGHT);
-
- row = uiLayoutRow(split, 1);
- uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide controllers");
- uiItemMenuEnumO(row, "LOGIC_OT_controller_add", "type", "Add Controller", 0);
-
- if (RNA_boolean_get(&settings_ptr, "show_state_panel")) {
-
- box= uiLayoutBox(layout);
- uiLayoutSetAlignment(box, UI_LAYOUT_ALIGN_CENTER); //XXX doesn't seem to work
- split= uiLayoutSplit(box, 0.2, 0);
-
- col= uiLayoutColumn(split, 0);
- uiItemL(col, "Visible", 0);
- uiItemL(col, "Initial", 0);
-
- subsplit= uiLayoutSplit(split, 0.85, 0);
- col= uiLayoutColumn(subsplit, 0);
- row= uiLayoutRow(col, 0);
- uiLayoutSetActive(row, RNA_boolean_get(&settings_ptr, "all_states")==0);
- uiTemplateLayers(row, &settings_ptr, "state", &settings_ptr, "used_state", 0);
- row= uiLayoutRow(col, 0);
- uiTemplateLayers(row, &settings_ptr, "initial_state", &settings_ptr, "used_state", 0);
-
- col= uiLayoutColumn(subsplit, 0);
- uiItemR(col, &settings_ptr, "all_states", UI_ITEM_R_TOGGLE, NULL, 0);
- uiItemR(col, &settings_ptr, "debug_state", 0, "", 0);
- }
-
for(a=0; a<count; a++) {
bController *cont;
PointerRNA ptr;
@@ -4432,9 +4406,45 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
int iact;
ob= (Object *)idar[a];
-
+
+ /* Drawing the Controller Header common to all Selected Objects */
+
+ RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
+
+ split= uiLayoutSplit(layout, 0.05, 0);
+ uiItemR(split, &settings_ptr, "show_state_panel", UI_ITEM_R_NO_BG, "", ICON_DISCLOSURE_TRI_RIGHT);
+
+ row = uiLayoutRow(split, 1);
+ uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide controllers");
+ uiItemMenuEnumO(row, "LOGIC_OT_controller_add", "type", "Add Controller", 0);
+
+ if (RNA_boolean_get(&settings_ptr, "show_state_panel")) {
+
+ box= uiLayoutBox(layout);
+ split= uiLayoutSplit(box, 0.2, 0);
+
+ col= uiLayoutColumn(split, 0);
+ uiItemL(col, "Visible", 0);
+ uiItemL(col, "Initial", 0);
+
+ subsplit= uiLayoutSplit(split, 0.85, 0);
+ col= uiLayoutColumn(subsplit, 0);
+ row= uiLayoutRow(col, 0);
+ uiLayoutSetActive(row, RNA_boolean_get(&settings_ptr, "all_states")==0);
+ uiTemplateLayers(row, &settings_ptr, "visible_state", &settings_ptr, "used_state", 0);
+ row= uiLayoutRow(col, 0);
+ uiTemplateLayers(row, &settings_ptr, "initial_state", &settings_ptr, "used_state", 0);
+
+ col= uiLayoutColumn(subsplit, 0);
+ uiItemR(col, &settings_ptr, "all_states", UI_ITEM_R_TOGGLE, NULL, 0);
+ uiItemR(col, &settings_ptr, "debug_state", 0, "", 0);
+ }
+
+ /* End of Drawing the Controller Header common to all Selected Objects */
+
if (!(ob->scavisflag & OB_VIS_CONT) || !(ob->scaflag & OB_SHOWCONT)) continue;
+
uiItemS(layout);
for(cont= ob->controllers.first; cont; cont=cont->next) {
@@ -4498,15 +4508,15 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemR(row, &logic_ptr, "sensors_show_linked_controller", 0, "Link", 0);
uiItemR(row, &logic_ptr, "sensors_show_active_states", 0, "State", 0);
- row = uiLayoutRow(layout, 1);
- uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
- uiItemMenuEnumO(row, "LOGIC_OT_sensor_add", "type", "Add Sensor", 0);
-
for(a=0; a<count; a++) {
bSensor *sens;
PointerRNA ptr;
ob= (Object *)idar[a];
+
+ row = uiLayoutRow(layout, 1);
+ uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors");
+ uiItemMenuEnumO(row, "LOGIC_OT_sensor_add", "type", "Add Sensor", 0);
if (!(ob->scavisflag & OB_VIS_SENS) || !(ob->scaflag & OB_SHOWSENS)) continue;
@@ -4557,16 +4567,16 @@ static void logic_buttons_new(bContext *C, ARegion *ar)
uiItemR(row, &logic_ptr, "actuators_show_linked_controller", 0, "Link", 0);
uiItemR(row, &logic_ptr, "actuators_show_active_states", 0, "State", 0);
- row = uiLayoutRow(layout, 1);
- uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
- uiItemMenuEnumO(row, "LOGIC_OT_actuator_add", "type", "Add Actuator", 0);
-
for(a=0; a<count; a++) {
bActuator *act;
PointerRNA ptr;
ob= (Object *)idar[a];
-
+
+ row = uiLayoutRow(layout, 1);
+ uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators");
+ uiItemMenuEnumO(row, "LOGIC_OT_actuator_add", "type", "Add Actuator", 0);
+
if (!(ob->scavisflag & OB_VIS_ACT) || !(ob->scaflag & OB_SHOWACT)) continue;
uiItemS(layout);
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 4deab9d82ab..cf98decb825 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -116,7 +116,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
if (adt) adt->flag |= ADT_UI_SELECTED;
}
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
case ANIMTYPE_OBJECT:
@@ -157,7 +157,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
adt->flag |= ADT_UI_ACTIVE;
/* notifiers - channel was selected */
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
}
break;
@@ -194,7 +194,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
ale->adt->flag |= ADT_UI_ACTIVE;
}
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
break;
@@ -220,21 +220,21 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
nlt->flag ^= NLATRACK_PROTECTED;
/* notifier flags - channel was edited */
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ notifierFlags |= (ND_ANIMCHAN|NA_EDITED);
}
else if (x >= (v2d->cur.xmax-2*NLACHANNEL_BUTTON_WIDTH)) {
/* toggle mute */
nlt->flag ^= NLATRACK_MUTED;
/* notifier flags - channel was edited */
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ notifierFlags |= (ND_ANIMCHAN|NA_EDITED);
}
else if (x <= ((NLACHANNEL_BUTTON_WIDTH*2)+offset)) {
/* toggle 'solo' */
BKE_nlatrack_solo_toggle(adt, nlt);
/* notifier flags - channel was edited */
- notifierFlags |= ND_ANIMCHAN_EDIT;
+ notifierFlags |= (ND_ANIMCHAN|NA_EDITED);
}
else if (nlaedit_is_tweakmode_on(ac) == 0) {
/* set selection */
@@ -253,7 +253,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK);
/* notifier flags - channel was selected */
- notifierFlags |= ND_ANIMCHAN_SELECT;
+ notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
}
}
break;
@@ -406,7 +406,7 @@ static int nlaedit_add_tracks_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -462,7 +462,7 @@ static int nlaedit_delete_tracks_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index b017a6102e9..38c6ecdca22 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -311,7 +311,7 @@ static int nlaedit_add_actionclip_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -430,7 +430,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -497,7 +497,7 @@ static int nlaedit_add_meta_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -549,7 +549,7 @@ static int nlaedit_remove_meta_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -639,7 +639,7 @@ static int nlaedit_duplicate_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -727,7 +727,7 @@ static int nlaedit_delete_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -872,7 +872,7 @@ static int nlaedit_split_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -925,7 +925,7 @@ static int nlaedit_bake_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -987,7 +987,7 @@ static int nlaedit_toggle_mute_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1061,7 +1061,7 @@ static int nlaedit_move_up_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1135,7 +1135,7 @@ static int nlaedit_move_down_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1211,7 +1211,7 @@ static int nlaedit_sync_actlen_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1312,7 +1312,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1375,7 +1375,7 @@ static int nlaedit_clear_scale_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1516,7 +1516,7 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op)
ED_nla_postop_refresh(&ac);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1631,7 +1631,7 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
BLI_freelistN(&anim_data);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
/* done */
return OPERATOR_FINISHED;
@@ -1753,7 +1753,7 @@ static int nla_fmodifier_paste_exec(bContext *C, wmOperator *op)
if (ok) {
/* set notifier that things have changed */
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
return OPERATOR_FINISHED;
}
else {
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index 1416e0afdc9..55463580115 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -176,7 +176,7 @@ static int nlaedit_deselectall_exec(bContext *C, wmOperator *op)
deselect_nla_strips(&ac, DESELECT_STRIPS_TEST, SELECT_ADD);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -313,7 +313,7 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op)
borderselect_nla_strips(&ac, rect, mode, selectmode);
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -570,7 +570,7 @@ static int nlaedit_clickselect_invoke(bContext *C, wmOperator *op, wmEvent *even
}
/* set notifier that things have changed */
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_SELECT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL);
/* for tweak grab to work */
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 63c1d9e486c..5eb6d9cf94a 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -626,13 +626,7 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
}
}
-// if(GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) { XXX
-// float zoomx= curarea->winx/(float)(G.v2d->cur.xmax-G.v2d->cur.xmin);
-// float zoomy= curarea->winy/(float)(G.v2d->cur.ymax-G.v2d->cur.ymin);
-// glPixelZoom(zoomx*xscale, zoomy*yscale);
-// }
-// else
- glPixelZoom(xscale, yscale);
+ glPixelZoom(xscale, yscale);
glEnable(GL_BLEND);
glBlendFunc( GL_ONE, GL_ONE_MINUS_SRC_ALPHA ); /* premul graphics */
@@ -661,6 +655,19 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
bNodeTree *ntree = snode->nodetree;
PointerRNA ptr;
+ /* hurmf... another candidate for callback, have to see how this works first */
+ if(node->id && node->block && snode->treetype==NTREE_SHADER)
+ nodeShaderSynchronizeID(node, 0);
+
+ /* skip if out of view */
+ if (node->totr.xmax < ar->v2d.cur.xmin || node->totr.xmin > ar->v2d.cur.xmax ||
+ node->totr.ymax < ar->v2d.cur.ymin || node->totr.ymin > ar->v2d.cur.ymax) {
+
+ uiEndBlock(C, node->block);
+ node->block= NULL;
+ return;
+ }
+
uiSetRoundBox(15-4);
ui_dropshadow(rct, BASIS_RAD, snode->aspect, node->flag & SELECT);
@@ -761,10 +768,6 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
node_draw_mute_line(v2d, snode, node);
- /* hurmf... another candidate for callback, have to see how this works first */
- if(node->id && node->block && snode->treetype==NTREE_SHADER)
- nodeShaderSynchronizeID(node, 0);
-
/* socket inputs, buttons */
for(sock= node->inputs.first; sock; sock= sock->next) {
if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) {
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 97e2eba7b64..dd838a67afa 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -2244,10 +2244,10 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
int ntype=0;
/* check input variables */
- if (RNA_property_is_set(op->ptr, "path"))
+ if (RNA_property_is_set(op->ptr, "filepath"))
{
char path[FILE_MAX];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
ima= BKE_add_image_file(path, scene ? scene->r.cfra : 1);
}
else if(RNA_property_is_set(op->ptr, "name"))
@@ -2291,7 +2291,7 @@ static int node_add_file_invoke(bContext *C, wmOperator *op, wmEvent *event)
UI_view2d_region_to_view(&ar->v2d, event->x - ar->winrct.xmin, event->y - ar->winrct.ymin,
&snode->mx, &snode->my);
- if (RNA_property_is_set(op->ptr, "path") || RNA_property_is_set(op->ptr, "name"))
+ if (RNA_property_is_set(op->ptr, "filepath") || RNA_property_is_set(op->ptr, "name"))
return node_add_file_exec(C, op);
else
return WM_operator_filesel(C, op, event);
diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c
index 32e57e29ab0..ccd1555e1a2 100644
--- a/source/blender/editors/space_node/node_select.c
+++ b/source/blender/editors/space_node/node_select.c
@@ -120,7 +120,7 @@ static int node_select_exec(bContext *C, wmOperator *op)
}
/* send notifiers */
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
/* allow tweak event to work too */
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
@@ -188,7 +188,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op)
}
}
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -264,7 +264,7 @@ static int node_select_all_exec(bContext *C, wmOperator *op)
node->flag |= NODE_SELECT;
}
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -304,7 +304,7 @@ static int node_select_linked_to_exec(bContext *C, wmOperator *op)
node->flag |= NODE_SELECT;
}
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -344,7 +344,7 @@ static int node_select_linked_from_exec(bContext *C, wmOperator *op)
node->flag |= NODE_SELECT;
}
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -370,7 +370,7 @@ static int node_select_same_type_exec(bContext *C, wmOperator *op)
SpaceNode *snode = CTX_wm_space_node(C);
node_select_same_type(snode);
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -396,7 +396,7 @@ static int node_select_same_type_next_exec(bContext *C, wmOperator *op)
SpaceNode *snode = CTX_wm_space_node(C);
node_select_same_type_np(snode, 0);
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
@@ -420,7 +420,7 @@ static int node_select_same_type_prev_exec(bContext *C, wmOperator *op)
SpaceNode *snode = CTX_wm_space_node(C);
node_select_same_type_np(snode, 1);
- WM_event_add_notifier(C, NC_NODE|ND_NODE_SELECT, NULL);
+ WM_event_add_notifier(C, NC_NODE|NA_SELECTED, NULL);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 6388e68a1f5..5b681958a3a 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -313,7 +313,7 @@ static void node_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
RNA_string_set(drop->ptr, "name", id->name+2);
}
if (drag->path[0]) {
- RNA_string_set(drop->ptr, "path", drag->path);
+ RNA_string_set(drop->ptr, "filepath", drag->path);
}
}
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index f6e516c65e7..3c6d7e055ba 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -2222,7 +2222,7 @@ static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te,
if(set) {
Object *ob= (Object *)tselem->id;
- WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob);
+ WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE|NA_EDITED, ob);
// XXX extern_set_butspace(F7KEY, 0);
}
diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c
index 90867712322..71b37e514d7 100644
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@ -58,7 +58,7 @@
static int run_pyfile_exec(bContext *C, wmOperator *op)
{
char path[512];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
#ifndef DISABLE_PYTHON
if(BPY_run_python_script(C, path, NULL, op->reports)) {
ARegion *ar= CTX_wm_region(C);
@@ -81,7 +81,7 @@ void SCRIPT_OT_python_file_run(wmOperatorType *ot)
ot->exec= run_pyfile_exec;
ot->poll= ED_operator_areaactive;
- RNA_def_string_file_path(ot->srna, "path", "", 512, "Path", "");
+ RNA_def_string_file_path(ot->srna, "filepath", "", 512, "Path", "");
}
diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c
index 61f7cf425d4..15140f080e7 100644
--- a/source/blender/editors/space_script/script_ops.c
+++ b/source/blender/editors/space_script/script_ops.c
@@ -63,6 +63,6 @@ void script_keymap(wmKeyConfig *keyconf)
wmKeyMap *keymap= WM_keymap_find(keyconf, "Script", SPACE_SCRIPT, 0);
/* TODO - this is just while we have no way to load a text datablock */
- RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "path", "test.py");
+ RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "filepath", "test.py");
}
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index 7bd00e6081f..06c7725984a 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -135,7 +135,7 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, wmOperator *op)
RNA_string_get(op->ptr, "name", seq_load->name+2);
- RNA_string_get(op->ptr, "path", seq_load->path); /* full path, file is set by the caller */
+ RNA_string_get(op->ptr, "filepath", seq_load->path); /* full path, file is set by the caller */
if (RNA_struct_find_property(op->ptr, "frame_end")) {
seq_load->end_frame = RNA_int_get(op->ptr, "frame_end");
@@ -545,7 +545,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op)
if (seq->type==SEQ_PLUGIN) {
char path[FILE_MAX];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
sh.init_plugin(seq, path);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 9deb0ba4a0a..dedde7e10c3 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2218,6 +2218,43 @@ void SEQUENCER_OT_view_all_preview(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER;
}
+
+static int sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op)
+{
+ RenderData *r= &CTX_data_scene(C)->r;
+ View2D *v2d= UI_view2d_fromcontext(C);
+
+ float ratio= RNA_float_get(op->ptr, "ratio");
+
+ float winx= (int)(r->size * r->xsch)/100;
+ float winy= (int)(r->size * r->ysch)/100;
+
+ float facx= (v2d->mask.xmax - v2d->mask.xmin) / winx;
+ float facy= (v2d->mask.ymax - v2d->mask.ymin) / winy;
+
+ BLI_resize_rctf(&v2d->cur, winx*facx*ratio, winy*facy*ratio);
+
+ ED_region_tag_redraw(CTX_wm_region(C));
+
+ return OPERATOR_FINISHED;
+}
+
+void SEQUENCER_OT_view_zoom_ratio(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Sequencer View Zoom Ratio";
+ ot->idname= "SEQUENCER_OT_view_zoom_ratio";
+
+ /* api callbacks */
+ ot->exec= sequencer_view_zoom_ratio_exec;
+ ot->poll= ED_operator_sequencer_active;
+
+ /* properties */
+ RNA_def_float(ot->srna, "ratio", 1.0f, 0.0f, FLT_MAX,
+ "Ratio", "Zoom ratio, 1.0 is 1:1, higher is zoomed in, lower is zoomed out.", -FLT_MAX, FLT_MAX);
+}
+
+
#if 0
static EnumPropertyItem view_type_items[] = {
{SEQ_VIEW_SEQUENCE, "SEQUENCER", ICON_SEQ_SEQUENCER, "Sequencer", ""},
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index dc2d89293ee..fd4ee70e258 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -100,6 +100,7 @@ void SEQUENCER_OT_rendersize(struct wmOperatorType *ot);
void SEQUENCER_OT_view_toggle(struct wmOperatorType *ot);
void SEQUENCER_OT_view_all(struct wmOperatorType *ot);
void SEQUENCER_OT_view_selected(struct wmOperatorType *ot);
+void SEQUENCER_OT_view_zoom_ratio(struct wmOperatorType *ot);
void SEQUENCER_OT_copy(struct wmOperatorType *ot);
void SEQUENCER_OT_paste(struct wmOperatorType *ot);
diff --git a/source/blender/editors/space_sequencer/sequencer_ops.c b/source/blender/editors/space_sequencer/sequencer_ops.c
index f1ca2490095..559a090a2ee 100644
--- a/source/blender/editors/space_sequencer/sequencer_ops.c
+++ b/source/blender/editors/space_sequencer/sequencer_ops.c
@@ -79,6 +79,7 @@ void sequencer_operatortypes(void)
WM_operatortype_append(SEQUENCER_OT_view_selected);
WM_operatortype_append(SEQUENCER_OT_view_all_preview);
WM_operatortype_append(SEQUENCER_OT_view_toggle);
+ WM_operatortype_append(SEQUENCER_OT_view_zoom_ratio);
/* sequencer_select.c */
WM_operatortype_append(SEQUENCER_OT_select_all_toggle);
@@ -224,5 +225,17 @@ void sequencer_keymap(wmKeyConfig *keyconf)
keymap= WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_view_all_preview", HOMEKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "SEQUENCER_OT_properties", NKEY, KM_PRESS, 0, 0);
+
+
+ keymap= WM_keymap_find(keyconf, "SequencerPreview", SPACE_SEQ, 0);
+
+ /* would prefer to use numpad keys for job */
+ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD8, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 8.0f);
+ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD4, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 4.0f);
+ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD2, KM_PRESS, KM_SHIFT, 0)->ptr, "ratio", 2.0f);
+ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD1, KM_PRESS, 0, 0)->ptr, "ratio", 1.0f);
+ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD2, KM_PRESS, 0, 0)->ptr, "ratio", 0.5f);
+ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD4, KM_PRESS, 0, 0)->ptr, "ratio", 0.25f);
+ RNA_float_set(WM_keymap_add_item(keymap, "SEQUENCER_OT_view_zoom_ratio", PAD8, KM_PRESS, 0, 0)->ptr, "ratio", 0.125f);
}
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 6681fa98747..170b9fbda80 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -239,7 +239,7 @@ static int sequencer_deselect_exec(bContext *C, wmOperator *op)
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -277,7 +277,7 @@ static int sequencer_select_inverse_exec(bContext *C, wmOperator *op)
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -505,7 +505,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
}
#endif
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
/* allowing tweaks */
return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH;
@@ -595,7 +595,7 @@ static int sequencer_select_more_exec(bContext *C, wmOperator *op)
if(!select_more_less_seq__internal(scene, 0, 0))
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -626,7 +626,7 @@ static int sequencer_select_less_exec(bContext *C, wmOperator *op)
if(!select_more_less_seq__internal(scene, 1, 0))
return OPERATOR_CANCELLED;
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -681,7 +681,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEv
selected = select_more_less_seq__internal(scene, 1, 1);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -716,7 +716,7 @@ static int sequencer_select_linked_exec(bContext *C, wmOperator *op)
selected = select_more_less_seq__internal(scene, 1, 1);
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -766,7 +766,7 @@ static int sequencer_select_handles_exec(bContext *C, wmOperator *op)
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -803,7 +803,7 @@ static int sequencer_select_active_side_exec(bContext *C, wmOperator *op)
select_active_side(ed->seqbasep, RNA_enum_get(op->ptr, "side"), seq_act->machine, seq_act->startdisp);
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
@@ -865,7 +865,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op)
}
}
- WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER_SELECT, scene);
+ WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER|NA_SELECTED, scene);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index b19e8652f7f..49c2049c66c 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -322,7 +322,7 @@ static int sound_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop)
{
/* copy drag path to properties */
- RNA_string_set(drop->ptr, "path", drag->path);
+ RNA_string_set(drop->ptr, "filepath", drag->path);
}
/* this region dropbox definition */
@@ -357,7 +357,6 @@ static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_FRAME:
case ND_MARKERS:
case ND_SEQUENCER:
- case ND_SEQUENCER_SELECT:
ED_region_tag_redraw(ar);
break;
}
@@ -408,7 +407,6 @@ static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_FRAME:
case ND_MARKERS:
case ND_SEQUENCER:
- case ND_SEQUENCER_SELECT:
ED_region_tag_redraw(ar);
break;
}
@@ -450,7 +448,6 @@ static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
switch(wmn->data) {
case ND_FRAME:
case ND_SEQUENCER:
- case ND_SEQUENCER_SELECT:
ED_region_tag_redraw(ar);
break;
}
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 96b38f2e78d..7f3741e8e17 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -215,19 +215,19 @@ static void text_keymap(struct wmKeyConfig *keyconf)
#endif
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELUPMOUSE, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", WHEELDOWNMOUSE, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 0);
kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_int", PADMINUS, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.font_size");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.font_size");
RNA_boolean_set(kmi->ptr, "reverse", 1);
WM_keymap_add_item(keymap, "TEXT_OT_new", NKEY, KM_PRESS, KM_ALT, 0);
@@ -389,7 +389,7 @@ static int text_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static void text_drop_copy(wmDrag *drag, wmDropBox *drop)
{
/* copy drag path to properties */
- RNA_string_set(drop->ptr, "path", drag->path);
+ RNA_string_set(drop->ptr, "filepath", drag->path);
}
/* this region dropbox definition */
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 3a891a66107..873deb30511 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -233,6 +233,9 @@ static int find_bool(char *string)
/* Check for "True" */
else if(string[0]=='T' && string[1]=='r' && string[2]=='u' && string[3]=='e')
i = 4;
+ /* Check for "None" */
+ else if(string[0]=='N' && string[1]=='o' && string[2]=='n' && string[3]=='e')
+ i = 4;
/* If next source char is an identifier (eg. 'i' in "definate") no match */
if(i==0 || text_check_identifier(string[i]))
return -1;
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index d3c197506b9..c90d257ee43 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -220,7 +220,7 @@ static int open_exec(bContext *C, wmOperator *op)
char str[FILE_MAX];
short internal = RNA_int_get(op->ptr, "internal");
- RNA_string_get(op->ptr, "path", str);
+ RNA_string_get(op->ptr, "filepath", str);
text= add_text(str, G.sce);
@@ -268,11 +268,11 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event)
Text *text= CTX_data_edit_text(C);
char *path= (text && text->name)? text->name: G.sce;
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return open_exec(C, op);
open_init(C, op);
- RNA_string_set(op->ptr, "path", path);
+ RNA_string_set(op->ptr, "filepath", path);
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
@@ -494,7 +494,7 @@ static int save_as_exec(bContext *C, wmOperator *op)
if(!text)
return OPERATOR_CANCELLED;
- RNA_string_get(op->ptr, "path", str);
+ RNA_string_get(op->ptr, "filepath", str);
if(text->name) MEM_freeN(text->name);
text->name= BLI_strdup(str);
@@ -513,7 +513,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event)
Text *text= CTX_data_edit_text(C);
char *str;
- if(RNA_property_is_set(op->ptr, "path"))
+ if(RNA_property_is_set(op->ptr, "filepath"))
return save_as_exec(C, op);
if(text->name)
@@ -523,7 +523,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event)
else
str= G.sce;
- RNA_string_set(op->ptr, "path", str);
+ RNA_string_set(op->ptr, "filepath", str);
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt
index 20a45e34d84..a6945bbe9bb 100644
--- a/source/blender/editors/space_view3d/CMakeLists.txt
+++ b/source/blender/editors/space_view3d/CMakeLists.txt
@@ -45,4 +45,6 @@ IF(WIN32)
SET(INC ${INC} ${PTHREADS_INC})
ENDIF(WIN32)
+ADD_DEFINITIONS(-DGLEW_STATIC)
+
BLENDERLIB(bf_editor_space_view3d "${SRC}" "${INC}")
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 7172da55744..45bab2ed16e 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -2725,7 +2725,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
}
if((v3d->flag2 & V3D_RENDER_OVERRIDE && v3d->drawtype >= OB_SOLID)==0)
- dm->drawEdges(dm, (dt==OB_WIRE || totface==0), 0);
+ dm->drawEdges(dm, (dt==OB_WIRE || totface==0), me->drawflag & ME_ALLEDGES);
if (dt!=OB_WIRE && draw_wire==2) {
glDepthMask(1);
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 78ae13d255e..472379ec6e1 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -454,7 +454,7 @@ static void view3d_id_path_drop_copy(wmDrag *drag, wmDropBox *drop)
if(id)
RNA_string_set(drop->ptr, "name", id->name+2);
if(drag->path[0])
- RNA_string_set(drop->ptr, "path", drag->path);
+ RNA_string_set(drop->ptr, "filepath", drag->path);
}
@@ -523,13 +523,19 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
switch(wmn->category) {
case NC_ANIMATION:
switch(wmn->data) {
- case ND_KEYFRAME_EDIT:
case ND_KEYFRAME_PROP:
- case ND_NLA_EDIT:
case ND_NLA_ACTCHANGE:
- case ND_ANIMCHAN_SELECT:
ED_region_tag_redraw(ar);
break;
+ case ND_NLA:
+ case ND_KEYFRAME:
+ if (wmn->action == NA_EDITED)
+ ED_region_tag_redraw(ar);
+ break;
+ case ND_ANIMCHAN:
+ if (wmn->action == NA_SELECTED)
+ ED_region_tag_redraw(ar);
+ break;
}
break;
case NC_SCENE:
@@ -557,8 +563,7 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn)
case ND_MODIFIER:
case ND_CONSTRAINT:
case ND_KEYS:
- case ND_PARTICLE_SELECT:
- case ND_PARTICLE_DATA:
+ case ND_PARTICLE:
ED_region_tag_redraw(ar);
break;
}
@@ -709,12 +714,15 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
switch(wmn->category) {
case NC_ANIMATION:
switch(wmn->data) {
- case ND_KEYFRAME_EDIT:
case ND_KEYFRAME_PROP:
- case ND_NLA_EDIT:
case ND_NLA_ACTCHANGE:
ED_region_tag_redraw(ar);
break;
+ case ND_NLA:
+ case ND_KEYFRAME:
+ if (wmn->action == NA_EDITED)
+ ED_region_tag_redraw(ar);
+ break;
}
break;
case NC_SCENE:
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 8396f880357..1944628c244 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -1111,7 +1111,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
else {
if(rv3d->persp==RV3D_CAMOB) {
rv3d->camzoom+= 10;
- if(rv3d->camzoom>300) rv3d->camzoom= 300;
+ if(rv3d->camzoom>600) rv3d->camzoom= 600;
}
else if(rv3d->dist> 0.001*v3d->grid) {
view_zoom_mouseloc(CTX_wm_region(C), .83333f, mx, my);
diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c
index da4395e2309..08658cd752d 100644
--- a/source/blender/editors/space_view3d/view3d_ops.c
+++ b/source/blender/editors/space_view3d/view3d_ops.c
@@ -220,12 +220,12 @@ void view3d_keymap(wmKeyConfig *keyconf)
/* drawtype */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", ZKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.viewport_shading");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.viewport_shading");
RNA_string_set(kmi->ptr, "value_1", "SOLID");
RNA_string_set(kmi->ptr, "value_2", "WIREFRAME");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", ZKEY, KM_PRESS, KM_ALT, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.viewport_shading");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.viewport_shading");
RNA_string_set(kmi->ptr, "value_1", "TEXTURED");
RNA_string_set(kmi->ptr, "value_2", "SOLID");
@@ -266,29 +266,29 @@ void view3d_keymap(wmKeyConfig *keyconf)
/* context ops */
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.pivot_point");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "BOUNDING_BOX_CENTER");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, KM_CTRL, 0); /* 2.4x allowed Comma+Shift too, rather not use both */
- RNA_string_set(kmi->ptr, "path", "space_data.pivot_point");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "MEDIAN_POINT");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", COMMAKEY, KM_PRESS, KM_ALT, 0); /* new in 2.5 */
- RNA_string_set(kmi->ptr, "path", "space_data.pivot_point_align");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point_align");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* new in 2.5 */
- RNA_string_set(kmi->ptr, "path", "space_data.manipulator");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.manipulator");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.pivot_point");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "CURSOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, KM_CTRL, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.pivot_point");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "INDIVIDUAL_ORIGINS");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, KM_ALT, 0);
- RNA_string_set(kmi->ptr, "path", "space_data.pivot_point");
+ RNA_string_set(kmi->ptr, "data_path", "space_data.pivot_point");
RNA_string_set(kmi->ptr, "value", "ACTIVE_ELEMENT");
transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 84fe927f4ab..585e3c03e58 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -2005,7 +2005,7 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
fly->axis= 2;
fly->pan_view= FALSE;
fly->xlock= FALSE;
- fly->zlock= TRUE;
+ fly->zlock= FALSE;
fly->xlock_momentum=0.0f;
fly->zlock_momentum=0.0f;
fly->grid= 1.0f;
@@ -2277,6 +2277,11 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
static int flyApply(bContext *C, FlyInfo *fly)
{
+
+#define FLY_ROTATE_FAC 2.5f /* more is faster */
+#define FLY_ZUP_CORRECT_FAC 0.1f /* ammount to correct per step */
+#define FLY_ZUP_CORRECT_ACCEL 0.05f /* increase upright momentum each step */
+
/*
fly mode - Shift+F
a fly loop where the user can move move the view as if they are flying
@@ -2392,7 +2397,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
upvec[1]=0;
upvec[2]=0;
mul_m3_v3(mat, upvec);
- axis_angle_to_quat( tmp_quat, upvec, (float)moffset[1]*-time_redraw*20); /* Rotate about the relative up vec */
+ axis_angle_to_quat( tmp_quat, upvec, (float)moffset[1] * time_redraw * -FLY_ROTATE_FAC); /* Rotate about the relative up vec */
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
if (fly->xlock) fly->xlock = 2; /*check for rotation*/
@@ -2424,7 +2429,7 @@ static int flyApply(bContext *C, FlyInfo *fly)
mul_m3_v3(mat, upvec);
}
- axis_angle_to_quat( tmp_quat, upvec, (float)moffset[0]*time_redraw*20); /* Rotate about the relative up vec */
+ axis_angle_to_quat( tmp_quat, upvec, (float)moffset[0] * time_redraw * FLY_ROTATE_FAC); /* Rotate about the relative up vec */
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
if (fly->xlock) fly->xlock = 2;/*check for rotation*/
@@ -2445,10 +2450,10 @@ static int flyApply(bContext *C, FlyInfo *fly)
upvec[2]=1;
mul_m3_v3(mat, upvec);
- axis_angle_to_quat( tmp_quat, upvec, roll*time_redraw_clamped*fly->zlock_momentum*0.1); /* Rotate about the relative up vec */
+ axis_angle_to_quat( tmp_quat, upvec, roll*time_redraw_clamped*fly->zlock_momentum * FLY_ZUP_CORRECT_FAC); /* Rotate about the relative up vec */
mul_qt_qtqt(rv3d->viewquat, rv3d->viewquat, tmp_quat);
- fly->zlock_momentum += 0.05f;
+ fly->zlock_momentum += FLY_ZUP_CORRECT_ACCEL;
} else {
fly->zlock=1; /* dont check until the view rotates again */
fly->zlock_momentum= 0.0f;
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index aab9f0d5d62..45ebbe63b15 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -311,14 +311,14 @@ static void viewRedrawForce(const bContext *C, TransInfo *t)
}
else if (t->spacetype == SPACE_ACTION) {
//SpaceAction *saction= (SpaceAction *)t->sa->spacedata.first;
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
else if (t->spacetype == SPACE_IPO) {
//SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
- WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
else if (t->spacetype == SPACE_NLA) {
- WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL);
}
else if(t->spacetype == SPACE_NODE)
{
@@ -344,7 +344,7 @@ static void viewRedrawPost(TransInfo *t)
if(t->spacetype == SPACE_VIEW3D) {
/* if autokeying is enabled, send notifiers that keyframes were added */
if (IS_AUTOKEY_ON(t->scene))
- WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
#if 0 // TRANSFORM_FIX_ME
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 499631ff755..d8e56331e19 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2896,7 +2896,7 @@ static void posttrans_fcurve_clean (FCurve *fcu)
* (if any keyframes were found, or the whole curve wasn't affected)
*/
if ((len) && (len != fcu->totvert)) {
- for (i = 0; i < fcu->totvert; i++) {
+ for (i= fcu->totvert-1; i >= 0; i--) {
BezTriple *bezt= &fcu->bezt[i];
if (BEZSELECTED(bezt) == 0) {
@@ -2906,7 +2906,7 @@ static void posttrans_fcurve_clean (FCurve *fcu)
delete_fcurve_key(fcu, i, 0);
break;
}
- else if (bezt->vec[1][0] > selcache[index])
+ else if (bezt->vec[1][0] < selcache[index])
break;
}
}
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 9f21662398a..85e13879367 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -848,7 +848,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
km = WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0);
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(km->ptr, "path", "tool_settings.snap");
+ RNA_string_set(km->ptr, "data_path", "tool_settings.snap");
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
@@ -926,7 +926,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac
km = WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0);
km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(km->ptr, "path", "tool_settings.snap");
+ RNA_string_set(km->ptr, "data_path", "tool_settings.snap");
break;
default:
break;
diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index 3b16a16c2b5..3a9c7b22cde 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -51,14 +51,10 @@ typedef struct Camera {
float lens, ortho_scale, drawsize;
float shiftx, shifty;
- float pad;
-
/* yafray: dof params */
/* qdn: yafray var 'YF_dofdist' now enabled for defocus composit node as well.
The name was not changed so that no other files need to be modified */
- float YF_dofdist, YF_aperture;
- short YF_bkhtype, YF_bkhbias;
- float YF_bkhrot;
+ float YF_dofdist;
struct Ipo *ipo; // XXX depreceated... old animation system
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index 1cf6b25c58f..5231108a756 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -93,20 +93,14 @@ typedef struct Lamp {
float atm_distance_factor;
float skyblendfac;
float sky_exposure;
- short sky_colorspace, pad4;
-
- /* yafray: photonlight params */
- int YF_numphotons, YF_numsearch;
- short YF_phdepth, YF_useqmc, YF_bufsize, YF_pad;
- float YF_causticblur, YF_ltradius;
- /* yafray: glow params */
- float YF_glowint, YF_glowofs;
- short YF_glowtype, YF_pad2;
-
+ short sky_colorspace;
+ char pad4[6];
+
struct Ipo *ipo; // XXX depreceated... old animation system
struct MTex *mtex[18]; /* MAX_MTEX */
- short pr_texture, pad[3];
-
+ short pr_texture;
+ char pad6[6];
+
/* preview */
struct PreviewImage *preview;
} Lamp;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 51f23ef210f..528f06882a2 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -703,6 +703,7 @@ typedef struct SolidifyModifierData {
#define MOD_SOLIDIFY_EVEN (1<<1)
#define MOD_SOLIDIFY_NORMAL_CALC (1<<2)
#define MOD_SOLIDIFY_VGROUP_INV (1<<3)
+#define MOD_SOLIDIFY_RIM_MATERIAL (1<<4)
typedef struct ScrewModifierData {
ModifierData modifier;
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index d148717b363..62e8727e1d4 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -349,16 +349,6 @@ typedef struct RenderData {
short bake_osa, bake_filter, bake_mode, bake_flag;
short bake_normal_space, bake_quad_split;
float bake_maxdist, bake_biasdist, bake_pad;
-
- /* yafray: global panel params. TODO: move elsewhere */
- short GIquality, GIcache, GImethod, GIphotons, GIdirect;
- short YF_AA, YFexportxml, YF_nobump, YF_clamprgb, yfpad1;
- int GIdepth, GIcausdepth, GIpixelspersample;
- int GIphotoncount, GImixphotons;
- float GIphotonradius;
- int YF_raydepth, YF_AApasses, YF_AAsamples, yfpad2;
- float GIshadowquality, GIrefinement, GIpower, GIindirpower;
- float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
/* paths to backbufffer, output, ftype */
char backbuf[160], pic[160];
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index c8bc7ccd527..82f9fcad788 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -662,6 +662,7 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value);
int RNA_enum_identifier(EnumPropertyItem *item, const int value, const char **identifier);
int RNA_enum_bitflag_identifiers(EnumPropertyItem *item, const int value, const char **identifier);
int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name);
+int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description);
void RNA_property_enum_items(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *totitem, int *free);
int RNA_property_enum_value(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *value);
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 452d8d80dbc..2d99be4461e 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -960,7 +960,8 @@ int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
}
}
-/* this is the max length including \0 terminator */
+/* this is the max length including \0 terminator.
+ * '0' used when their is no maximum */
int RNA_property_string_maxlength(PropertyRNA *prop)
{
StringPropertyRNA *sprop= (StringPropertyRNA*)rna_ensure_property(prop);
@@ -1085,6 +1086,17 @@ int RNA_enum_name(EnumPropertyItem *item, const int value, const char **name)
return 0;
}
+int RNA_enum_description(EnumPropertyItem *item, const int value, const char **description)
+{
+ for (; item->identifier; item++) {
+ if(item->identifier[0] && item->value==value) {
+ *description = item->description;
+ return 1;
+ }
+ }
+ return 0;
+}
+
int RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **identifier)
{
EnumPropertyItem *item= NULL;
@@ -1829,18 +1841,15 @@ void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *val
IDProperty *idprop;
if((idprop=rna_idproperty_check(&prop, ptr)))
- IDP_AssignString(idprop, (char*)value);
+ IDP_AssignString(idprop, (char*)value, RNA_property_string_maxlength(prop) - 1);
else if(sprop->set)
- sprop->set(ptr, value);
+ sprop->set(ptr, value); /* set function needs to clamp its self */
else if(prop->flag & PROP_EDITABLE) {
- IDPropertyTemplate val = {0};
IDProperty *group;
- val.str= (char*)value;
-
group= RNA_struct_idproperties(ptr, 1);
if(group)
- IDP_AddToGroup(group, IDP_New(IDP_STRING, val, (char*)prop->identifier));
+ IDP_AddToGroup(group, IDP_NewString((char*)value, (char*)prop->identifier, RNA_property_string_maxlength(prop) - 1));
}
}
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 4f37195068a..bc83af7a279 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -169,39 +169,39 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYSEL);
RNA_def_property_ui_text(prop, "Only Selected", "Only include channels relating to selected objects and data");
RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Object Group Filtering Settings */
prop= RNA_def_property(srna, "only_group_objects", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP);
RNA_def_property_ui_text(prop, "Only Objects in Group", "Only include channels from Objects in the specified Group");
RNA_def_property_ui_icon(prop, ICON_GROUP, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "filtering_group", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "filter_grp");
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Filtering Group", "Group that included Object should be a member of");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* NLA Specific Settings */
prop= RNA_def_property(srna, "include_missing_nla", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NLA_NOACT);
RNA_def_property_ui_text(prop, "Include Missing NLA", "Include Animation Data blocks with no NLA data. (NLA Editor only)");
RNA_def_property_ui_icon(prop, ICON_ACTION, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* Summary Settings (DopeSheet editors only) */
prop= RNA_def_property(srna, "display_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_SUMMARY);
RNA_def_property_ui_text(prop, "Display Summary", "Display an additional 'summary' line. (DopeSheet Editors only)");
RNA_def_property_ui_icon(prop, ICON_BORDERMOVE, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "collapse_summary", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ADS_FLAG_SUMMARY_COLLAPSED);
RNA_def_property_ui_text(prop, "Collapse Summary", "Collapse summary when shown, so all other channels get hidden. (DopeSheet Editors Only)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* General DataType Filtering Settings */
@@ -209,85 +209,85 @@ static void rna_def_dopesheet(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOOBJ);
RNA_def_property_ui_text(prop, "Display Transforms", "Include visualization of Object-level Animation data (mostly Transforms)");
RNA_def_property_ui_icon(prop, ICON_MANIPUL, 0); // XXX?
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_shapekeys", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSHAPEKEYS);
RNA_def_property_ui_text(prop, "Display Shapekeys", "Include visualization of ShapeKey related Animation data");
RNA_def_property_ui_icon(prop, ICON_SHAPEKEY_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_mesh", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMESH);
RNA_def_property_ui_text(prop, "Display Meshes", "Include visualization of Mesh related Animation data");
RNA_def_property_ui_icon(prop, ICON_MESH_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_camera", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCAM);
RNA_def_property_ui_text(prop, "Display Camera", "Include visualization of Camera related Animation data");
RNA_def_property_ui_icon(prop, ICON_CAMERA_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_material", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMAT);
RNA_def_property_ui_text(prop, "Display Material", "Include visualization of Material related Animation data");
RNA_def_property_ui_icon(prop, ICON_MATERIAL_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_lamp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLAM);
RNA_def_property_ui_text(prop, "Display Lamp", "Include visualization of Lamp related Animation data");
RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);
RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data");
RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_curve", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOCUR);
RNA_def_property_ui_text(prop, "Display Curve", "Include visualization of Curve related Animation data");
RNA_def_property_ui_icon(prop, ICON_CURVE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_world", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOWOR);
RNA_def_property_ui_text(prop, "Display World", "Include visualization of World related Animation data");
RNA_def_property_ui_icon(prop, ICON_WORLD_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_scene", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOSCE);
RNA_def_property_ui_text(prop, "Display Scene", "Include visualization of Scene related Animation data");
RNA_def_property_ui_icon(prop, ICON_SCENE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_particle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOPART);
RNA_def_property_ui_text(prop, "Display Particle", "Include visualization of Particle related Animation data");
RNA_def_property_ui_icon(prop, ICON_PARTICLE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_metaball", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOMBA);
RNA_def_property_ui_text(prop, "Display Metaball", "Include visualization of Metaball related Animation data");
RNA_def_property_ui_icon(prop, ICON_META_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_armature", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOARM);
RNA_def_property_ui_text(prop, "Display Armature", "Include visualization of Armature related Animation data");
RNA_def_property_ui_icon(prop, ICON_ARMATURE_DATA, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "display_node", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NONTREE);
RNA_def_property_ui_text(prop, "Display Node", "Include visualization of Node related Animation data");
RNA_def_property_ui_icon(prop, ICON_NODETREE, 0);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
static void rna_def_action_group(BlenderRNA *brna)
@@ -302,7 +302,7 @@ static void rna_def_action_group(BlenderRNA *brna)
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_ui_text(prop, "Name", "");
RNA_def_struct_name_property(srna, prop);
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
/* WARNING: be very careful when working with this list, since the endpoint is not
* defined like a standard ListBase. Adding/removing channels from this list needs
@@ -323,22 +323,22 @@ static void rna_def_action_group(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "Action Group is selected");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "Action Group is locked");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED);
RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "customCol");
RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
}
/* fcurve.keyframe_points */
diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c
index 223d7a1c206..7e52032687c 100644
--- a/source/blender/makesrna/intern/rna_boid.c
+++ b/source/blender/makesrna/intern/rna_boid.c
@@ -83,7 +83,7 @@ static void rna_Boids_reset(Main *bmain, Scene *scene, PointerRNA *ptr)
else
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -99,7 +99,7 @@ static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr)
DAG_scene_sort(scene);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr)
diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c
index dd174c668f2..d9523344414 100644
--- a/source/blender/makesrna/intern/rna_controller.c
+++ b/source/blender/makesrna/intern/rna_controller.c
@@ -28,7 +28,7 @@
#include "RNA_define.h"
#include "rna_internal.h"
-
+#include "DNA_object_types.h"
#include "DNA_controller_types.h"
EnumPropertyItem controller_type_items[] ={
@@ -82,6 +82,60 @@ static void rna_Controller_type_set(struct PointerRNA *ptr, int value)
}
}
+static int rna_Controller_state_number_get(struct PointerRNA *ptr)
+{
+ bController *cont= (bController *)ptr->data;
+ int bit;
+
+ for (bit=0; bit<32; bit++) {
+ if (cont->state_mask & (1<<bit))
+ return bit+1;
+ }
+ return 0;
+}
+
+static void rna_Controller_state_number_set(struct PointerRNA *ptr, const int value)
+{
+ bController *cont= (bController *)ptr->data;
+ if (value < 1 || value > OB_MAX_STATES)
+ return;
+
+ cont->state_mask = (1 << (value - 1));
+}
+
+static void rna_Controller_state_get(PointerRNA *ptr, int *values)
+{
+ bController *cont= (bController *)ptr->data;
+ int i;
+
+ memset(values, 0, sizeof(int)*OB_MAX_STATES);
+ for(i=0; i<OB_MAX_STATES; i++)
+ values[i] = (cont->state_mask & (1<<i));
+}
+
+static void rna_Controller_state_set(PointerRNA *ptr, const int *values)
+{
+ bController *cont= (bController *)ptr->data;
+ int i, tot= 0;
+
+ /* ensure we always have some state selected */
+ for(i=0; i<OB_MAX_STATES; i++)
+ if(values[i])
+ tot++;
+
+ if(tot==0)
+ return;
+
+ /* only works for one state at once */
+ if(tot>1)
+ return;
+
+ for(i=0; i<OB_MAX_STATES; i++) {
+ if(values[i]) cont->state_mask |= (1<<i);
+ else cont->state_mask &= ~(1<<i);
+ }
+}
+
#else
void RNA_def_controller(BlenderRNA *brna)
@@ -124,6 +178,24 @@ void RNA_def_controller(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1);
RNA_def_property_update(prop, NC_LOGIC, NULL);
+ /* State */
+
+ // array of OB_MAX_STATES
+ prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ RNA_def_property_array(prop, OB_MAX_STATES);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
+ RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set");
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
+ // number of the state
+ prop= RNA_def_property(srna, "state_number", PROP_INT, PROP_UNSIGNED);
+ RNA_def_property_int_sdna(prop, NULL, "state_mask");
+ RNA_def_property_range(prop, 1, OB_MAX_STATES);
+ RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)");
+ RNA_def_property_int_funcs(prop, "rna_Controller_state_number_get", "rna_Controller_state_number_set", NULL);
+ RNA_def_property_update(prop, NC_LOGIC, NULL);
+
/* Expression Controller */
srna= RNA_def_struct(brna, "ExpressionController", "Controller");
RNA_def_struct_sdna_from(srna, "bExpressionCont", "data");
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index f7404d2656b..3ecc844250b 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -693,9 +693,9 @@ static void rna_def_nurbs(BlenderRNA *brna, StructRNA *srna)
PropertyRNA *prop;
/* flags */
- prop= RNA_def_property(srna, "uv_orco", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "map_along_length", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
- RNA_def_property_ui_text(prop, "UV Orco", "Forces to use UV coordinates for texture mapping 'orco'");
+ RNA_def_property_ui_text(prop, "Map Along Length", "Generate texture mapping coordinates following the curve direction, rather than the local bounding box");
RNA_def_property_update(prop, 0, "rna_Curve_update_data");
prop= RNA_def_property(srna, "vertex_normal_flip", PROP_BOOLEAN, PROP_NONE);
@@ -1200,6 +1200,11 @@ static void rna_def_curve(BlenderRNA *brna)
RNA_def_property_editable_func(prop, texspace_editable);
RNA_def_property_update(prop, 0, "rna_Curve_update_data");*/
+ prop= RNA_def_property(srna, "map_along_length", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_UV_ORCO);
+ RNA_def_property_ui_text(prop, "Map Along Length", "Generate texture mapping coordinates following the curve direction, rather than the local bounding box");
+ RNA_def_property_update(prop, 0, "rna_Curve_update_data");
+
/* materials */
prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "mat", "totcol");
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c
index 10b9a5ecc96..d798753d123 100644
--- a/source/blender/makesrna/intern/rna_fcurve.c
+++ b/source/blender/makesrna/intern/rna_fcurve.c
@@ -571,20 +571,20 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna)
prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
// XXX this has a special validation func
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, generator_mode_items);
RNA_def_property_ui_text(prop, "Mode", "Type of generator to use");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* order of the polynomial */
// XXX this has a special validation func
prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* coefficients array */
prop= RNA_def_property(srna, "coefficients", PROP_FLOAT, PROP_NONE);
@@ -618,31 +618,31 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna)
/* coefficients */
prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* flags */
prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE);
RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type");
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -663,18 +663,18 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna)
prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* Frame */
prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME);
RNA_def_property_float_sdna(prop, NULL, "time");
RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
// TODO:
// - selection flags (not implemented in UI yet though)
@@ -699,17 +699,17 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna)
prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "midval");
RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "default_minimum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min");
RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "default_maximum", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "max");
RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -734,21 +734,21 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna)
prop= RNA_def_property(srna, "before_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "before_cycles", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe. (0 = infinite)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
/* after */
prop= RNA_def_property(srna, "after_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_type_items);
RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "after_cycles", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe. (0 = infinite)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -777,46 +777,46 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna)
prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN);
RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN);
RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX);
RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX);
RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_minx_range");
RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymin");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_miny_range");
RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.xmax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxx_range");
RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "rect.ymax");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierLimits_maxy_range");
RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -840,27 +840,27 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna)
prop= RNA_def_property(srna, "modification", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, prop_modification_items);
RNA_def_property_ui_text(prop, "Modification", "Method of modifying the existing F-Curve");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "size");
RNA_def_property_ui_text(prop, "Size", "Scaling (in time) of the noise");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "strength");
RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "phase");
RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "depth", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "depth");
RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
@@ -878,34 +878,34 @@ static void rna_def_fmodifier_stepped(BlenderRNA *brna)
/* properties */
prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE);
RNA_def_property_ui_text(prop, "Step Size", "Number of frames to hold each value");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Offset", "Reference number of frames before frames get held. Use to get hold for '1-3' vs '5-7' holding patterns");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_frame_start", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_BEFORE);
RNA_def_property_ui_text(prop, "Use Start Frame", "Restrict modifier to only act after its 'start' frame");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "use_frame_end", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_STEPPED_NO_AFTER);
RNA_def_property_ui_text(prop, "Use End Frame", "Restrict modifier to only act before its 'end' frame");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "start_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_start_frame_range");
RNA_def_property_ui_text(prop, "Start Frame", "Frame that modifier's influence starts (if applicable)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "frame_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "end_frame");
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_FModifierStepped_end_frame_range");
RNA_def_property_ui_text(prop, "End Frame", "Frame that modifier's influence ends (if applicable)");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
/* --------- */
@@ -1159,14 +1159,14 @@ static void rna_def_fpoint(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", 1);
RNA_def_property_ui_text(prop, "Selected", "Selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
/* Vector value */
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ);
RNA_def_property_float_sdna(prop, NULL, "vec");
RNA_def_property_array(prop, 2);
RNA_def_property_ui_text(prop, "Point", "Point coordinates");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
@@ -1186,17 +1186,17 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected_handle1", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f1", 0);
RNA_def_property_ui_text(prop, "Handle 1 selected", "Handle 1 selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "selected_handle2", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f3", 0);
RNA_def_property_ui_text(prop, "Handle 2 selected", "Handle 2 selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "f2", 0);
RNA_def_property_ui_text(prop, "Selected", "Control point selection status");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
/* Enums */
prop= RNA_def_property(srna, "handle1_type", PROP_ENUM, PROP_NONE);
@@ -1228,19 +1228,19 @@ static void rna_def_fkeyframe(BlenderRNA *brna)
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle1_get", "rna_FKeyframe_handle1_set", NULL);
RNA_def_property_ui_text(prop, "Handle 1", "Coordinates of the first handle");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_ctrlpoint_get", "rna_FKeyframe_ctrlpoint_set", NULL);
RNA_def_property_ui_text(prop, "Control Point", "Coordinates of the control point");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
prop= RNA_def_property(srna, "handle2", PROP_FLOAT, PROP_TRANSLATION);
RNA_def_property_array(prop, 2);
RNA_def_property_float_funcs(prop, "rna_FKeyframe_handle2_get", "rna_FKeyframe_handle2_set", NULL);
RNA_def_property_ui_text(prop, "Handle 2", "Coordinates of the second handle");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL);
}
static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop)
@@ -1387,17 +1387,17 @@ static void rna_def_fcurve(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_SELECTED);
RNA_def_property_ui_text(prop, "Selected", "F-Curve is selected for editing");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_SELECT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_PROTECTED);
RNA_def_property_ui_text(prop, "Locked", "F-Curve's settings cannot be edited");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "muted", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_MUTED);
RNA_def_property_ui_text(prop, "Muted", "F-Curve is not evaluated");
- RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL);
+ RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
prop= RNA_def_property(srna, "auto_clamped_handles", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", FCURVE_AUTO_HANDLES);
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index e5fb130a7b7..289530d4f32 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -186,7 +186,7 @@ void RNA_api_image(StructRNA *srna)
func= RNA_def_function(srna, "save_render", "rna_Image_save_render");
RNA_def_function_ui_description(func, "Save image to a specific path using a scenes render settings");
RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS);
- parm= RNA_def_string(func, "path", "", 0, "", "Save path.");
+ parm= RNA_def_string(func, "filepath", "", 0, "", "Save path.");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "scene", "Scene", "", "Scene to take image parameters from");
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c
index b4b02737af0..769d73d9f79 100644
--- a/source/blender/makesrna/intern/rna_lamp.c
+++ b/source/blender/makesrna/intern/rna_lamp.c
@@ -275,6 +275,7 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna)
prop= RNA_def_property(srna, "atmosphere_turbidity", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "atm_turbidity");
RNA_def_property_range(prop, 1.0f, 30.0f);
+ RNA_def_property_ui_range(prop, 2.0f, 10.0f, 1, 2);
RNA_def_property_ui_text(prop, "Atmosphere Turbidity", "Sky turbidity");
RNA_def_property_update(prop, 0, "rna_Lamp_sky_update");
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index c9e17a562af..0dbaaa87a99 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -929,7 +929,7 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
func= RNA_def_function(srna, "load", "rna_Main_texts_load");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
- parm= RNA_def_string(func, "path", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
+ parm= RNA_def_string(func, "filepath", "Path", FILE_MAXDIR + FILE_MAXFILE, "", "path for the datablock.");
RNA_def_property_flag(parm, PROP_REQUIRED);
/* return type */
parm= RNA_def_pointer(func, "text", "Text", "", "New text datablock.");
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 28c7f7eeb58..b289373f349 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -33,6 +33,8 @@
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
+#include "WM_types.h"
+
#ifdef RNA_RUNTIME
#include "DNA_scene_types.h"
@@ -1806,6 +1808,7 @@ static void rna_def_mesh(BlenderRNA *brna)
prop= RNA_def_property(srna, "all_edges", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_ALLEDGES);
RNA_def_property_ui_text(prop, "All Edges", "Displays all edges for wireframe in all view modes in the 3D view");
+ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL);
prop= RNA_def_property(srna, "draw_faces", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index c30cbadaf2a..2d973d9a32d 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1605,7 +1605,7 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Children", "Create instances from child particles");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
- prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_path", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path);
RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
@@ -2104,6 +2104,11 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_RIM);
RNA_def_property_ui_text(prop, "Fill Rim", "Create edge loops between the inner and outer surfaces on face edges (slow, disable when not needed)");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+ prop= RNA_def_property(srna, "use_rim_material", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_RIM_MATERIAL);
+ RNA_def_property_ui_text(prop, "Rim Material", "Use in the next material for rim faces");
+ RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "use_even_offset", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_EVEN);
@@ -2119,6 +2124,8 @@ static void rna_def_modifier_solidify(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SOLIDIFY_VGROUP_INV);
RNA_def_property_ui_text(prop, "Vertex Group Invert", "Invert the vertex group influence");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+
}
static void rna_def_modifier_screw(BlenderRNA *brna)
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index f77e984cd37..6606da2f3bf 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1264,7 +1264,7 @@ static void rna_def_object_game_settings(BlenderRNA *brna)
/* state */
- prop= RNA_def_property(srna, "state", PROP_BOOLEAN, PROP_LAYER_MEMBER);
+ prop= RNA_def_property(srna, "visible_state", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "state", 1);
RNA_def_property_array(prop, OB_MAX_STATES);
RNA_def_property_ui_text(prop, "State", "State determining which controllers are displayed");
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 7b8d4830d5c..e43f494c189 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -205,7 +205,7 @@ static void particle_recalc(Main *bmain, Scene *scene, PointerRNA *ptr, short fl
else
DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|flag);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static void rna_Particle_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
{
@@ -269,7 +269,7 @@ static void rna_Particle_target_reset(Main *bmain, Scene *scene, PointerRNA *ptr
DAG_scene_sort(scene);
}
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static void rna_Particle_target_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
@@ -281,7 +281,7 @@ static void rna_Particle_target_redo(Main *bmain, Scene *scene, PointerRNA *ptr)
psys->recalc = PSYS_RECALC_REDO;
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
}
@@ -297,7 +297,7 @@ static void rna_Particle_hair_dynamics(Main *bmain, Scene *scene, PointerRNA *pt
rna_Particle_redo(bmain, scene, ptr);
}
else
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
static PointerRNA rna_particle_settings_get(PointerRNA *ptr)
{
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 1da85842551..56fd8de2250 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2606,7 +2606,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
+ RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_COMP_FREE);
RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index d7dfd6fba9a..ecf2206c25c 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -161,12 +161,12 @@ static void rna_def_region(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Region Type", "Type of this region");
- prop= RNA_def_property(srna, "width", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winx");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Width", "Region width");
- prop= RNA_def_property(srna, "height", PROP_INT, PROP_NONE);
+ prop= RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_sdna(prop, NULL, "winy");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Height", "Region height");
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index dc157ce15bb..3a7e7a02837 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -137,7 +137,7 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value)
Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL;
if(ob) {
DAG_id_flush_update(&ob->id, OB_RECALC_DATA);
- WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL);
+ WM_main_add_notifier(NC_OBJECT|ND_PARTICLE|NA_EDITED, NULL);
}
}
diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c
index b4d7b5559a4..c52fd7f5cba 100644
--- a/source/blender/makesrna/intern/rna_sequencer.c
+++ b/source/blender/makesrna/intern/rna_sequencer.c
@@ -690,17 +690,17 @@ static void rna_def_sequence(BlenderRNA *brna)
prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);
RNA_def_property_ui_text(prop, "Selected", "");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "left_handle_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LEFTSEL);
RNA_def_property_ui_text(prop, "Left Handle Selected", "");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "right_handle_selected", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_RIGHTSEL);
RNA_def_property_ui_text(prop, "Right Handle Selected", "");
- RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER_SELECT, NULL);
+ RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER|NA_SELECTED, NULL);
prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 2d582d54bbd..3058fe62e0f 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1609,7 +1609,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL);
RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space");
- RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, "rna_SpaceDopeSheetEditor_action_update");
+ RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update");
/* mode */
prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c
index 6ca5e3ee83c..6715e2b78c0 100644
--- a/source/blender/modifiers/intern/MOD_hook.c
+++ b/source/blender/modifiers/intern/MOD_hook.c
@@ -214,25 +214,26 @@ static void deformVerts(
if(defgrp_index >= 0 && use_dverts) {
MDeformVert *dvert = me->dvert;
- int i, j;
+ int i;
+ float fac;
for(i = 0; i < maxVerts; i++, dvert++) {
if(dm) dvert = dm->getVertData(dm, i, CD_MDEFORMVERT);
- for(j = 0; j < dvert->totweight; j++) {
- if(dvert->dw[j].def_nr == defgrp_index) {
- float fac = hmd->force*dvert->dw[j].weight;
- float *co = vertexCos[i];
-
- if(hmd->falloff != 0.0) {
- float len = len_v3v3(co, hmd->cent);
- if(len > hmd->falloff) fac = 0.0;
- else if(len > 0.0)
- fac *= sqrt(1.0 - len / hmd->falloff);
- }
- mul_v3_m4v3(vec, mat, co);
- interp_v3_v3v3(co, co, vec, fac);
+ fac= defvert_find_weight(dvert, defgrp_index);
+
+ if(fac > 0.0f) {
+ float *co = vertexCos[i];
+
+ if(hmd->falloff != 0.0) {
+ float len = len_v3v3(co, hmd->cent);
+ if(len > hmd->falloff) fac = 0.0;
+ else if(len > 0.0)
+ fac *= sqrt(1.0 - len / hmd->falloff);
}
+
+ mul_v3_m4v3(vec, mat, co);
+ interp_v3_v3v3(co, co, vec, fac);
}
}
}
diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c
index 72907f5a2ee..1eb8f288006 100644
--- a/source/blender/modifiers/intern/MOD_solidify.c
+++ b/source/blender/modifiers/intern/MOD_solidify.c
@@ -514,6 +514,8 @@ static DerivedMesh *applyModifier(ModifierData *md,
float (*edge_vert_nos)[3]= MEM_callocN(sizeof(float) * numVerts * 3, "solidify_edge_nos");
float nor[3];
#endif
+ /* maximum value -1, so we have room to increase */
+ const short mat_nr_shift= (smd->flag & MOD_SOLIDIFY_RIM_MATERIAL) ? ob->totcol-1 : -1;
const unsigned char crease_rim= smd->crease_rim * 255.0f;
const unsigned char crease_outer= smd->crease_outer * 255.0f;
@@ -572,6 +574,10 @@ static DerivedMesh *applyModifier(ModifierData *md,
mf->v3= ed->v1 + numVerts;
mf->v4= ed->v2 + numVerts;
}
+
+ /* use the next material index if option enabled */
+ if(mf->mat_nr < mat_nr_shift)
+ mf->mat_nr++;
if(crease_outer)
ed->crease= crease_outer;
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 2e4194cd1dd..fda3e1c75ef 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -176,51 +176,42 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
projectors[i].uci= NULL;
if(projectors[i].ob->type == OB_CAMERA) {
+
cam = (Camera *)projectors[i].ob->data;
-
if(cam->flag & CAM_PANORAMA) {
projectors[i].uci= project_camera_info(projectors[i].ob, NULL, aspx, aspy);
+ project_camera_info_scale(projectors[i].uci, scax, scay);
free_uci= 1;
}
- else if(cam->type == CAM_PERSP) {
- float perspmat[4][4];
- float xmax;
- float xmin;
- float ymax;
- float ymin;
- float pixsize = cam->clipsta * 32.0 / cam->lens;
+ else {
+ float scale= (cam->type == CAM_PERSP) ? cam->clipsta * 32.0 / cam->lens : cam->ortho_scale;
+ float xmax, xmin, ymax, ymin;
if(aspect > 1.0f) {
- xmax = 0.5f * pixsize;
+ xmax = 0.5f * scale;
ymax = xmax / aspect;
} else {
- ymax = 0.5f * pixsize;
- xmax = ymax * aspect;
+ ymax = 0.5f * scale;
+ xmax = ymax * aspect;
}
xmin = -xmax;
ymin = -ymax;
- perspective_m4( perspmat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
- mul_m4_m4m4(tmpmat, projectors[i].projmat, perspmat);
- } else if(cam->type == CAM_ORTHO) {
- float orthomat[4][4];
- float xmax;
- float xmin;
- float ymax;
- float ymin;
-
- if(aspect > 1.0f) {
- xmax = 0.5f * cam->ortho_scale;
- ymax = xmax / aspect;
- } else {
- ymax = 0.5f * cam->ortho_scale;
- xmax = ymax * aspect;
+ /* scale the matrix */
+ xmin *= scax;
+ xmax *= scax;
+ ymin *= scay;
+ ymax *= scay;
+
+ if(cam->type == CAM_PERSP) {
+ float perspmat[4][4];
+ perspective_m4( perspmat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
+ mul_m4_m4m4(tmpmat, projectors[i].projmat, perspmat);
+ } else { /* if(cam->type == CAM_ORTHO) */
+ float orthomat[4][4];
+ orthographic_m4( orthomat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
+ mul_m4_m4m4(tmpmat, projectors[i].projmat, orthomat);
}
- xmin = -xmax;
- ymin = -ymax;
-
- orthographic_m4( orthomat,xmin, xmax, ymin, ymax, cam->clipsta, cam->clipend);
- mul_m4_m4m4(tmpmat, projectors[i].projmat, orthomat);
}
} else {
copy_m4_m4(tmpmat, projectors[i].projmat);
@@ -278,42 +269,26 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
/* apply coords as UVs, and apply image if tfaces are new */
for(i = 0, mf = mface; i < numFaces; ++i, ++mf, ++tface) {
if(override_image || !image || tface->tpage == image) {
- if(num_projectors == 1) {
- if(projectors[0].uci) {
- project_from_camera(tface->uv[0], coords[mf->v1], projectors[0].uci);
- project_from_camera(tface->uv[1], coords[mf->v2], projectors[0].uci);
- project_from_camera(tface->uv[2], coords[mf->v3], projectors[0].uci);
- if(mf->v3)
- project_from_camera(tface->uv[3], coords[mf->v4], projectors[0].uci);
-
- if(scax != 1.0f) {
- tface->uv[0][0] = ((tface->uv[0][0] - 0.5f) * scax) + 0.5f;
- tface->uv[1][0] = ((tface->uv[1][0] - 0.5f) * scax) + 0.5f;
- tface->uv[2][0] = ((tface->uv[2][0] - 0.5f) * scax) + 0.5f;
- if(mf->v3)
- tface->uv[3][0] = ((tface->uv[3][0] - 0.5f) * scax) + 0.5f;
- }
-
- if(scay != 1.0f) {
- tface->uv[0][1] = ((tface->uv[0][1] - 0.5f) * scay) + 0.5f;
- tface->uv[1][1] = ((tface->uv[1][1] - 0.5f) * scay) + 0.5f;
- tface->uv[2][1] = ((tface->uv[2][1] - 0.5f) * scay) + 0.5f;
- if(mf->v3)
- tface->uv[3][1] = ((tface->uv[3][1] - 0.5f) * scay) + 0.5f;
- }
+ if(num_projectors == 1) {
+ if(projectors[0].uci) {
+ project_from_camera(tface->uv[0], coords[mf->v1], projectors[0].uci);
+ project_from_camera(tface->uv[1], coords[mf->v2], projectors[0].uci);
+ project_from_camera(tface->uv[2], coords[mf->v3], projectors[0].uci);
+ if(mf->v3)
+ project_from_camera(tface->uv[3], coords[mf->v4], projectors[0].uci);
+ }
+ else {
+ /* apply transformed coords as UVs */
+ tface->uv[0][0] = coords[mf->v1][0];
+ tface->uv[0][1] = coords[mf->v1][1];
+ tface->uv[1][0] = coords[mf->v2][0];
+ tface->uv[1][1] = coords[mf->v2][1];
+ tface->uv[2][0] = coords[mf->v3][0];
+ tface->uv[2][1] = coords[mf->v3][1];
+ if(mf->v4) {
+ tface->uv[3][0] = coords[mf->v4][0];
+ tface->uv[3][1] = coords[mf->v4][1];
}
- else {
- /* apply transformed coords as UVs */
- tface->uv[0][0] = coords[mf->v1][0];
- tface->uv[0][1] = coords[mf->v1][1];
- tface->uv[1][0] = coords[mf->v2][0];
- tface->uv[1][1] = coords[mf->v2][1];
- tface->uv[2][0] = coords[mf->v3][0];
- tface->uv[2][1] = coords[mf->v3][1];
- if(mf->v4) {
- tface->uv[3][0] = coords[mf->v4][0];
- tface->uv[3][1] = coords[mf->v4][1];
- }
}
} else {
/* multiple projectors, select the closest to face normal
@@ -351,7 +326,7 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd,
best_projector = &projectors[j];
}
}
-
+
if(best_projector->uci) {
project_from_camera(tface->uv[0], coords[mf->v1], best_projector->uci);
project_from_camera(tface->uv[1], coords[mf->v2], best_projector->uci);
diff --git a/source/blender/python/doc/sphinx_doc_gen.py b/source/blender/python/doc/sphinx_doc_gen.py
index f01bcaa9352..758e495e7ed 100644
--- a/source/blender/python/doc/sphinx_doc_gen.py
+++ b/source/blender/python/doc/sphinx_doc_gen.py
@@ -24,7 +24,7 @@ run this script from blenders root path once you have compiled blender
./blender.bin -b -P /b/source/blender/python/doc/sphinx_doc_gen.py
This will generate python files in "./source/blender/python/doc/sphinx-in"
-Generate html docs by running...
+Generate html docs by running...
sphinx-build source/blender/python/doc/sphinx-in source/blender/python/doc/sphinx-out
@@ -55,7 +55,19 @@ EXAMPLE_SET_USED = set()
_BPY_STRUCT_FAKE = "bpy_struct"
_BPY_FULL_REBUILD = False
+def undocumented_message(module_name, type_name, identifier):
+ message = "Undocumented (`contribute " \
+ "<http://wiki.blender.org/index.php/Dev:2.5/Py/API/Documentation/Contribute" \
+ "?action=edit&section=new&preload=Dev:2.5/Py/API/Documentation/Contribute/Howto-message" \
+ "&preloadtitle=%s.%s.%s>`_)\n\n" % (module_name, type_name, identifier)
+ return message
+
+
def range_str(val):
+ '''
+ Converts values to strings for the range directive.
+ (unused function it seems)
+ '''
if val < -10000000: return '-inf'
if val > 10000000: return 'inf'
if type(val)==float:
@@ -64,9 +76,9 @@ def range_str(val):
return str(val)
-def write_example_ref(ident, fw, example_id, ext=".py"):
+def write_example_ref(ident, fw, example_id, ext="py"):
if example_id in EXAMPLE_SET:
- fw("%s.. literalinclude:: ../examples/%s%s\n\n" % (ident, example_id, ext))
+ fw("%s.. literalinclude:: ../examples/%s.%s\n\n" % (ident, example_id, ext))
EXAMPLE_SET_USED.add(example_id)
else:
if bpy.app.debug:
@@ -74,6 +86,9 @@ def write_example_ref(ident, fw, example_id, ext=".py"):
def write_indented_lines(ident, fn, text, strip=True):
+ '''
+ Apply same indentation to all lines in a multilines text.
+ '''
if text is None:
return
for l in text.split("\n"):
@@ -129,14 +144,15 @@ def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
+
doc = descr.__doc__
if not doc:
- doc = "Undocumented"
+ doc = undocumented_message(module_name, type_name, identifier)
if type(descr) == GetSetDescriptorType:
fw(ident + ".. attribute:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, doc, False)
- elif type(descr) == MethodDescriptorType: # GetSetDescriptorType, GetSetDescriptorType's are not documented yet
+ elif type(descr) == MethodDescriptorType: # GetSetDescriptorType's are not documented yet
write_indented_lines(ident, fw, doc, False)
else:
raise TypeError("type was not GetSetDescriptorType or MethodDescriptorType")
@@ -144,7 +160,8 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
write_example_ref(ident, fw, module_name + "." + type_name + "." + identifier)
fw("\n")
-def py_c_func2sphinx(ident, fw, identifier, py_func, is_class=True):
+
+def py_c_func2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_class=True):
'''
c defined function to sphinx.
'''
@@ -155,7 +172,7 @@ def py_c_func2sphinx(ident, fw, identifier, py_func, is_class=True):
fw("\n")
else:
fw(ident + ".. function:: %s()\n\n" % identifier)
- fw(ident + " Undocumented function.\n\n")
+ fw(ident + " " + undocumented_message(module_name, type_name, identifier))
def pyprop2sphinx(ident, fw, identifier, py_prop):
@@ -220,7 +237,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType): # both the same at the moment but to be future proof
# note: can't get args from these, so dump the string as is
# this means any module used like this must have fully formatted docstrings.
- py_c_func2sphinx("", fw, attribute, value, is_class=False)
+ py_c_func2sphinx("", fw, module_name, module, attribute, value, is_class=False)
elif value_type == type:
classes.append((attribute, value))
elif value_type in (bool, int, float, str, tuple):
@@ -248,7 +265,7 @@ def pymodule2sphinx(BASEPATH, module_name, module, title):
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")]
for key, descr in descr_items:
- if type(descr) == MethodDescriptorType: # GetSetDescriptorType, GetSetDescriptorType's are not documented yet
+ if type(descr) == MethodDescriptorType: # GetSetDescriptorType's are not documented yet
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
for key, descr in descr_items:
@@ -321,6 +338,7 @@ def rna2sphinx(BASEPATH):
fw(" \n")
fw(" The following areas are subject to change.\n")
fw(" * operator names and arguments\n")
+ fw(" * render api\n")
fw(" * function calls with the data api (any function calls with values accessed from bpy.data), including functions for importing and exporting meshes\n")
fw(" * class registration (Operator, Panels, Menus, Headers)\n")
fw(" * modules: bpy.props, blf)\n")
@@ -653,10 +671,10 @@ def rna2sphinx(BASEPATH):
if subclass_ids:
fw("subclasses --- \n" + ", ".join([(":class:`%s`" % s) for s in sorted(subclass_ids)]) + "\n\n")
- fw(".. class:: %s\n" % _BPY_STRUCT_FAKE)
- fw("\n")
- fw(" built-in base class for all classes in bpy.types, note that bpy.types.%s is not actually available from within blender, it only exists for the purpose of documentation.\n" % _BPY_STRUCT_FAKE)
- fw("\n")
+ fw(".. class:: %s\n\n" % _BPY_STRUCT_FAKE)
+ fw(" built-in base class for all classes in bpy.types.\n\n")
+ fw(" .. note::\n\n")
+ fw(" Note that bpy.types.%s is not actually available from within blender, it only exists for the purpose of documentation.\n\n" % _BPY_STRUCT_FAKE)
descr_items = [(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items()) if not key.startswith("__")]
@@ -691,8 +709,15 @@ def rna2sphinx(BASEPATH):
args_str = ", ".join([prop.get_arg_default(force=True) for prop in op.args])
fw(".. function:: %s(%s)\n\n" % (op.func_name, args_str))
- if op.description:
- fw(" %s\n\n" % op.description)
+
+ # if the description isn't valid, we output the standard warning
+ # with a link to the wiki so that people can help
+ if not op.description or op.description == "(undocumented operator)":
+ operator_description = undocumented_message('bpy.ops',op.module_name,op.func_name)
+ else:
+ operator_description = op.description
+
+ fw(" %s\n\n" % operator_description)
for prop in op.args:
write_param(" ", fw, prop)
if op.args:
diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c
index f17311f4a6a..95be795dd4e 100644
--- a/source/blender/python/generic/mathutils.c
+++ b/source/blender/python/generic/mathutils.c
@@ -649,7 +649,8 @@ int _BaseMathObject_ReadCallback(BaseMathObject *self)
if(cb->get(self, self->cb_subtype))
return 1;
- PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
+ if(!PyErr_Occurred())
+ PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
return 0;
}
@@ -659,7 +660,8 @@ int _BaseMathObject_WriteCallback(BaseMathObject *self)
if(cb->set(self, self->cb_subtype))
return 1;
- PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
+ if(!PyErr_Occurred())
+ PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
return 0;
}
@@ -669,7 +671,8 @@ int _BaseMathObject_ReadIndexCallback(BaseMathObject *self, int index)
if(cb->get_index(self, self->cb_subtype, index))
return 1;
- PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
+ if(!PyErr_Occurred())
+ PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
return 0;
}
@@ -679,7 +682,8 @@ int _BaseMathObject_WriteIndexCallback(BaseMathObject *self, int index)
if(cb->set_index(self, self->cb_subtype, index))
return 1;
- PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
+ if(!PyErr_Occurred())
+ PyErr_Format(PyExc_SystemError, "%s user has become invalid", Py_TYPE(self)->tp_name);
return 0;
}
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 4cb88ec9f68..e94f9b517a8 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -77,7 +77,7 @@ PyObject *bpy_home_paths(PyObject *self, PyObject *args)
static char bpy_blend_paths_doc[] =
".. function:: blend_paths(absolute=False)\n"
"\n"
-" Returns a list of paths assosiated with this blend file.\n"
+" Returns a list of paths associated with this blend file.\n"
"\n"
" :arg absolute: When true the paths returned are made absolute.\n"
" :type absolute: boolean\n"
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 841cb75bc98..fbb806f6436 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -925,11 +925,12 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, v
case PROP_STRING:
{
char *param = _PyUnicode_AsString(value);
-
+
if (param==NULL) {
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a string type", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop));
return -1;
- } else {
+ }
+ else {
if(data) *((char**)data)= param;
else RNA_property_string_set(ptr, prop, param);
}
@@ -1853,7 +1854,7 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefi
static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix,
char **path_full, int *index, float *cfra, char **group_name) /* return values */
{
- static char *kwlist[] = {"path", "index", "frame", "group", NULL};
+ static char *kwlist[] = {"data_path", "index", "frame", "group", NULL};
char *path;
/* note, parse_str MUST start with 's|ifs' */
@@ -1870,12 +1871,12 @@ static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject
}
static char pyrna_struct_keyframe_insert_doc[] =
-".. method:: keyframe_insert(path, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n"
+".. method:: keyframe_insert(data_path, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n"
"\n"
" Insert a keyframe on the property given, adding fcurves and animation data when necessary.\n"
"\n"
-" :arg path: path to the property to key, analogous to the fcurve's data path.\n"
-" :type path: string\n"
+" :arg data_path: path to the property to key, analogous to the fcurve's data path.\n"
+" :type data_path: string\n"
" :arg index: array index of the property to key. Defaults to -1 which will key all indicies or a single channel if the property is not an array.\n"
" :type index: int\n"
" :arg frame: The frame on which the keyframe is inserted, defaulting to the current frame.\n"
@@ -1904,12 +1905,12 @@ static PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *arg
}
static char pyrna_struct_keyframe_delete_doc[] =
-".. method:: keyframe_delete(path, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n"
+".. method:: keyframe_delete(data_path, index=-1, frame=bpy.context.scene.frame_current, group=\"\")\n"
"\n"
" Remove a keyframe from this properties fcurve.\n"
"\n"
-" :arg path: path to the property to remove a key, analogous to the fcurve's data path.\n"
-" :type path: string\n"
+" :arg data_path: path to the property to remove a key, analogous to the fcurve's data path.\n"
+" :type data_path: string\n"
" :arg index: array index of the property to remove a key. Defaults to -1 removing all indicies or a single channel if the property is not an array.\n"
" :type index: int\n"
" :arg frame: The frame on which the keyframe is deleted, defaulting to the current frame.\n"
@@ -2298,7 +2299,7 @@ static PyObject *pyrna_struct_getattro( BPy_StructRNA *self, PyObject *pyname )
}
else if ((prop = RNA_struct_find_property(&self->ptr, name))) {
ret = pyrna_prop_to_py(&self->ptr, prop);
- }
+ }
/* RNA function only if callback is declared (no optional functions) */
else if ((func = RNA_struct_find_function(&self->ptr, name)) && RNA_function_defined(func)) {
ret = pyrna_func_to_py((BPy_DummyPointerRNA *)self, func);
@@ -2392,17 +2393,43 @@ static int pyrna_struct_pydict_contains(PyObject *self, PyObject *pyname)
static int pyrna_struct_setattro( BPy_StructRNA *self, PyObject *pyname, PyObject *value )
{
char *name = _PyUnicode_AsString(pyname);
- PropertyRNA *prop = RNA_struct_find_property(&self->ptr, name);
-
- if (prop==NULL) {
- return PyObject_GenericSetAttr((PyObject *)self, pyname, value);
- } else if (!RNA_property_editable_flag(&self->ptr, prop)) {
- PyErr_Format( PyExc_AttributeError, "bpy_struct: attribute \"%.200s\" from \"%.200s\" is read-only", RNA_property_identifier(prop), RNA_struct_identifier(self->ptr.type) );
- return -1;
+ PropertyRNA *prop= NULL;
+
+ if (name[0] != '_' && (prop= RNA_struct_find_property(&self->ptr, name))) {
+ if (!RNA_property_editable_flag(&self->ptr, prop)) {
+ PyErr_Format( PyExc_AttributeError, "bpy_struct: attribute \"%.200s\" from \"%.200s\" is read-only", RNA_property_identifier(prop), RNA_struct_identifier(self->ptr.type) );
+ return -1;
+ }
}
-
+ else if (self->ptr.type == &RNA_Context) {
+ /* code just raises correct error, context prop's cant be set, unless its apart of the py class */
+ bContext *C = self->ptr.data;
+ if(C==NULL) {
+ PyErr_Format(PyExc_AttributeError, "bpy_struct: Context is 'NULL', can't set \"%.200s\" from context", name);
+ return -1;
+ }
+ else {
+ PointerRNA newptr;
+ ListBase newlb;
+ short newtype;
+
+ int done= CTX_data_get(C, name, &newptr, &newlb, &newtype);
+
+ if(done==1) {
+ PyErr_Format(PyExc_AttributeError, "bpy_struct: Context property \"%.200s\" is read-only", name);
+ BLI_freelistN(&newlb);
+ return -1;
+ }
+
+ BLI_freelistN(&newlb);
+ }
+ }
+
/* pyrna_py_to_prop sets its own exceptions */
- return pyrna_py_to_prop(&self->ptr, prop, NULL, NULL, value, "bpy_struct: item.attr = val:");
+ if(prop)
+ return pyrna_py_to_prop(&self->ptr, prop, NULL, NULL, value, "bpy_struct: item.attr = val:");
+ else
+ return PyObject_GenericSetAttr((PyObject *)self, pyname, value);
}
static PyObject *pyrna_prop_dir(BPy_PropertyRNA *self)
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index 4e2f33fa587..c24bd37defd 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -566,13 +566,6 @@ typedef struct LampRen {
/* passes & node shader support: all shadow info for a pixel */
LampShadowSample *shadsamp;
-
- /* yafray: photonlight params */
- int YF_numphotons, YF_numsearch;
- short YF_phdepth, YF_useqmc, YF_bufsize;
- float YF_causticblur, YF_ltradius;
- float YF_glowint, YF_glowofs;
- short YF_glowtype;
/* ray optim */
struct RayObject *last_hit[BLENDER_MAX_THREADS];
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 8d1caf2b8b9..f08529b3f2c 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -236,8 +236,6 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, TexResult *texre
}
}
- BRICONTRGB;
-
if(texres->talpha) texres->tin= texres->ta;
else if(tex->imaflag & TEX_CALCALPHA) {
texres->ta= texres->tin= MAX3(texres->tr, texres->tg, texres->tb);
@@ -254,6 +252,8 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, TexResult *texre
texres->tb*= fx;
}
+ BRICONTRGB;
+
return retval;
}
@@ -1318,8 +1318,6 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec,
}
}
- BRICONTRGB;
-
if (tex->imaflag & TEX_CALCALPHA)
texres->ta = texres->tin = texres->ta * MAX3(texres->tr, texres->tg, texres->tb);
else
@@ -1348,6 +1346,8 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec,
texres->tb *= fx;
}
+ BRICONTRGB;
+
return retval;
}
@@ -1705,8 +1705,6 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f
boxsample(ibuf, fx-minx, fy-miny, fx+minx, fy+miny, texres, imaprepeat, imapextend, 0);
}
- BRICONTRGB;
-
if(tex->imaflag & TEX_CALCALPHA) {
texres->ta= texres->tin= texres->ta*MAX3(texres->tr, texres->tg, texres->tb);
}
@@ -1733,6 +1731,8 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, float *texvec, float *DXT, f
texres->tb*= fx;
}
+ BRICONTRGB;
+
return retval;
}
diff --git a/source/blender/render/intern/source/rayobject_instance.c b/source/blender/render/intern/source/rayobject_instance.c
index c36ab454f3d..25765c4763a 100644
--- a/source/blender/render/intern/source/rayobject_instance.c
+++ b/source/blender/render/intern/source/rayobject_instance.c
@@ -143,6 +143,13 @@ static int RE_rayobject_instance_intersect(RayObject *o, Isect *isec)
{
isec->labda *= dist / isec->dist;
isec->hit.ob = obj->ob;
+
+#ifdef RT_USE_LAST_HIT
+ // TODO support for last hit optimization in instances that can jump
+ // directly to the last hit face.
+ // For now it jumps directly to the last-hit instance root node.
+ isec->last_hit = RE_rayobject_unalignRayAPI((RayObject*) obj);
+#endif
}
isec->dist = dist;
VECCOPY( isec->start, start );
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 6668cbf5dd8..dbbe1312f0a 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -184,7 +184,7 @@ int WM_menu_invoke (struct bContext *C, struct wmOperator *op, struct wmEven
int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, struct wmEvent *event);
/* invoke callback, confirm menu + exec */
int WM_operator_confirm (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
- /* invoke callback, file selector "path" unset + exec */
+ /* invoke callback, file selector "filepath" unset + exec */
int WM_operator_filesel (struct bContext *C, struct wmOperator *op, struct wmEvent *event);
/* poll callback, context checks */
int WM_operator_winactive (struct bContext *C);
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 2769f550f9a..199b17b9810 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -183,7 +183,6 @@ typedef struct wmNotifier {
#define ND_KEYINGSET (12<<16)
#define ND_TOOLSETTINGS (13<<16)
#define ND_LAYER (14<<16)
-#define ND_SEQUENCER_SELECT (15<<16)
/* NC_OBJECT Object */
#define ND_TRANSFORM (16<<16)
@@ -192,11 +191,10 @@ typedef struct wmNotifier {
#define ND_BONE_ACTIVE (19<<16)
#define ND_BONE_SELECT (20<<16)
#define ND_DRAW (21<<16)
-#define ND_MODIFIER (22<<16) /* modifiers edited */
+#define ND_MODIFIER (22<<16)
#define ND_KEYS (23<<16)
-#define ND_CONSTRAINT (24<<16) /* constraints edited */
-#define ND_PARTICLE_DATA (25<<16) /* particles edited */
-#define ND_PARTICLE_SELECT (26<<16) /* particles selecting change */
+#define ND_CONSTRAINT (24<<16)
+#define ND_PARTICLE (25<<16)
/* NC_MATERIAL Material */
#define ND_SHADING (30<<16)
@@ -215,15 +213,12 @@ typedef struct wmNotifier {
#define ND_DISPLAY (51<<16)
/* NC_ANIMATION Animato */
-#define ND_KEYFRAME_SELECT (70<<16)
-#define ND_KEYFRAME_EDIT (71<<16)
-#define ND_KEYFRAME_PROP (72<<16)
-#define ND_ANIMCHAN_SELECT (73<<16)
-#define ND_ANIMCHAN_EDIT (74<<16)
-#define ND_NLA_SELECT (75<<16)
-#define ND_NLA_EDIT (76<<16)
-#define ND_NLA_ACTCHANGE (77<<16)
-#define ND_FCURVES_ORDER (78<<16)
+#define ND_KEYFRAME (70<<16)
+#define ND_KEYFRAME_PROP (71<<16)
+#define ND_ANIMCHAN (72<<16)
+#define ND_NLA (73<<16)
+#define ND_NLA_ACTCHANGE (74<<16)
+#define ND_FCURVES_ORDER (75<<16)
/* NC_GEOM Geometry */
/* Mesh, Curve, MetaBall, Armature, .. */
@@ -231,7 +226,6 @@ typedef struct wmNotifier {
#define ND_DATA (91<<16)
/* NC_NODE Nodes */
-#define ND_NODE_SELECT (1<<16)
/* NC_SPACE */
#define ND_SPACE_CONSOLE (1<<16) /* general redraw */
@@ -279,6 +273,7 @@ typedef struct wmNotifier {
#define NA_ADDED 3
#define NA_REMOVED 4
#define NA_RENAME 5
+#define NA_SELECTED 6
/* ************** Gesture Manager data ************** */
@@ -498,7 +493,7 @@ typedef struct wmDropBox {
typedef struct RecentFile {
struct RecentFile *next, *prev;
- char *filename;
+ char *filepath;
} RecentFile;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index dc81dc39488..70e804758b2 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -234,8 +234,15 @@ void wm_event_do_notifiers(bContext *C)
}
}
if(do_anim) {
- /* depsgraph gets called, might send more notifiers */
- ED_update_for_newframe(C, 1);
+
+ /* XXX, quick frame changes can cause a crash if framechange and rendering
+ * collide (happens on slow scenes), scene_update_for_newframe can be called
+ * twice which can depgraph update the same object at once */
+ if(!G.rendering) {
+
+ /* depsgraph gets called, might send more notifiers */
+ ED_update_for_newframe(C, 1);
+ }
}
}
@@ -1212,7 +1219,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa
{
/* XXX validate area and region? */
bScreen *screen= CTX_wm_screen(C);
- char *path= RNA_string_get_alloc(handler->op->ptr, "path", NULL, 0);
+ char *path= RNA_string_get_alloc(handler->op->ptr, "filepath", NULL, 0);
if(screen != handler->filescreen)
ED_screen_full_prevspace(C, CTX_wm_area(C));
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 44768116c7c..17a04cab7be 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -407,10 +407,10 @@ void read_Blog(void)
recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
BLI_addtail(&(G.recent_files), recent);
- recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file");
- recent->filename[0] = '\0';
+ recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file");
+ recent->filepath[0] = '\0';
- strcpy(recent->filename, line);
+ strcpy(recent->filepath, line);
num++;
}
}
@@ -433,29 +433,29 @@ static void writeBlog(void)
recent = G.recent_files.first;
/* refresh .Blog of recent opened files, when current file was changed */
- if(!(recent) || (strcmp(recent->filename, G.sce)!=0)) {
+ if(!(recent) || (strcmp(recent->filepath, G.sce)!=0)) {
fp= fopen(name, "w");
if (fp) {
/* add current file to the beginning of list */
recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
- recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(G.sce)+1), "name of file");
- recent->filename[0] = '\0';
- strcpy(recent->filename, G.sce);
+ recent->filepath = (char*)MEM_mallocN(sizeof(char)*(strlen(G.sce)+1), "name of file");
+ recent->filepath[0] = '\0';
+ strcpy(recent->filepath, G.sce);
BLI_addhead(&(G.recent_files), recent);
/* write current file to .Blog */
- fprintf(fp, "%s\n", recent->filename);
+ fprintf(fp, "%s\n", recent->filepath);
recent = recent->next;
i=1;
/* write rest of recent opened files to .Blog */
while((i<U.recent_files) && (recent)){
/* this prevents to have duplicities in list */
- if (strcmp(recent->filename, G.sce)!=0) {
- fprintf(fp, "%s\n", recent->filename);
+ if (strcmp(recent->filepath, G.sce)!=0) {
+ fprintf(fp, "%s\n", recent->filepath);
recent = recent->next;
}
else {
next_recent = recent->next;
- MEM_freeN(recent->filename);
+ MEM_freeN(recent->filepath);
BLI_freelinkN(&(G.recent_files), recent);
recent = next_recent;
}
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index ed2ba460e9d..02e645ef635 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -202,7 +202,7 @@ static void free_openrecent(void)
struct RecentFile *recent;
for(recent = G.recent_files.first; recent; recent=recent->next)
- MEM_freeN(recent->filename);
+ MEM_freeN(recent->filepath);
BLI_freelistN(&(G.recent_files));
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index c43f362ceaa..c38ba67a648 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -774,7 +774,7 @@ int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *event)
/* op->invoke, opens fileselect if path property not set, otherwise executes */
int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *event)
{
- if (RNA_property_is_set(op->ptr, "path")) {
+ if (RNA_property_is_set(op->ptr, "filepath")) {
return WM_operator_call(C, op);
}
else {
@@ -788,7 +788,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
{
PropertyRNA *prop;
- RNA_def_string_file_path(ot->srna, "path", "", FILE_MAX, "File Path", "Path to file");
+ RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "File Path", "Path to file");
RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file");
RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file");
@@ -1215,7 +1215,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *arg_unuse
col = uiLayoutColumn(split, 0);
uiItemL(col, "Recent", 0);
for(recent = G.recent_files.first, i=0; (i<5) && (recent); recent = recent->next, i++) {
- uiItemStringO(col, BLI_path_basename(recent->filename), ICON_FILE_BLEND, "WM_OT_open_mainfile", "path", recent->filename);
+ uiItemStringO(col, BLI_path_basename(recent->filepath), ICON_FILE_BLEND, "WM_OT_open_mainfile", "filepath", recent->filepath);
}
uiItemS(col);
uiItemO(col, NULL, ICON_RECOVER_LAST, "WM_OT_recover_last_session");
@@ -1429,7 +1429,7 @@ static void open_set_use_scripts(wmOperator *op)
static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- RNA_string_set(op->ptr, "path", G.sce);
+ RNA_string_set(op->ptr, "filepath", G.sce);
open_set_load_ui(op);
open_set_use_scripts(op);
@@ -1442,7 +1442,7 @@ static int wm_open_mainfile_exec(bContext *C, wmOperator *op)
{
char path[FILE_MAX];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
open_set_load_ui(op);
open_set_use_scripts(op);
@@ -1488,12 +1488,12 @@ static int wm_link_append_invoke(bContext *C, wmOperator *op, wmEvent *event)
if(!RNA_property_is_set(op->ptr, "relative_path"))
RNA_boolean_set(op->ptr, "relative_path", U.flag & USER_RELPATHS);
- if(RNA_property_is_set(op->ptr, "path")) {
+ if(RNA_property_is_set(op->ptr, "filepath")) {
return WM_operator_call(C, op);
}
else {
/* XXX TODO solve where to get last linked library from */
- RNA_string_set(op->ptr, "path", G.lib);
+ RNA_string_set(op->ptr, "filepath", G.lib);
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
}
@@ -1693,7 +1693,7 @@ static int wm_recover_auto_save_exec(bContext *C, wmOperator *op)
{
char path[FILE_MAX];
- RNA_string_get(op->ptr, "path", path);
+ RNA_string_get(op->ptr, "filepath", path);
G.fileflags |= G_FILE_RECOVER;
@@ -1714,7 +1714,7 @@ static int wm_recover_auto_save_invoke(bContext *C, wmOperator *op, wmEvent *eve
char filename[FILE_MAX];
wm_autosave_location(filename);
- RNA_string_set(op->ptr, "path", filename);
+ RNA_string_set(op->ptr, "filepath", filename);
WM_event_add_fileselect(C, op);
return OPERATOR_RUNNING_MODAL;
@@ -1765,7 +1765,7 @@ static int wm_save_as_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *even
BLI_strncpy(name, G.sce, FILE_MAX);
untitled(name);
- RNA_string_set(op->ptr, "path", name);
+ RNA_string_set(op->ptr, "filepath", name);
WM_event_add_fileselect(C, op);
@@ -1780,8 +1780,8 @@ static int wm_save_as_mainfile_exec(bContext *C, wmOperator *op)
save_set_compress(op);
- if(RNA_property_is_set(op->ptr, "path"))
- RNA_string_get(op->ptr, "path", path);
+ if(RNA_property_is_set(op->ptr, "filepath"))
+ RNA_string_get(op->ptr, "filepath", path);
else {
BLI_strncpy(path, G.sce, FILE_MAX);
untitled(path);
@@ -1833,7 +1833,7 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event)
BLI_strncpy(name, G.sce, FILE_MAX);
untitled(name);
- RNA_string_set(op->ptr, "path", name);
+ RNA_string_set(op->ptr, "filepath", name);
if (RNA_struct_find_property(op->ptr, "check_existing"))
if (RNA_boolean_get(op->ptr, "check_existing")==0)
@@ -1875,9 +1875,9 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
static int wm_collada_export_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if(!RNA_property_is_set(op->ptr, "path")) {
+ if(!RNA_property_is_set(op->ptr, "filepath")) {
char *path = BLI_replacestr(G.sce, ".blend", ".dae");
- RNA_string_set(op->ptr, "path", path);
+ RNA_string_set(op->ptr, "filepath", path);
MEM_freeN(path);
}
@@ -1891,12 +1891,12 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
{
char filename[FILE_MAX];
- if(!RNA_property_is_set(op->ptr, "path")) {
+ if(!RNA_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED;
}
- RNA_string_get(op->ptr, "path", filename);
+ RNA_string_get(op->ptr, "filepath", filename);
collada_export(CTX_data_scene(C), filename);
return OPERATOR_FINISHED;
@@ -1919,12 +1919,12 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
{
char filename[FILE_MAX];
- if(!RNA_property_is_set(op->ptr, "path")) {
+ if(!RNA_property_is_set(op->ptr, "filepath")) {
BKE_report(op->reports, RPT_ERROR, "No filename given");
return OPERATOR_CANCELLED;
}
- RNA_string_get(op->ptr, "path", filename);
+ RNA_string_get(op->ptr, "filepath", filename);
collada_import(C, filename);
return OPERATOR_FINISHED;
@@ -2818,6 +2818,28 @@ void WM_OT_radial_control_partial(wmOperatorType *ot)
/* uses no type defines, fully local testing function anyway... ;) */
+static void redraw_timer_window_swap(bContext *C)
+{
+ wmWindow *win= CTX_wm_window(C);
+ ScrArea *sa;
+
+ for(sa= CTX_wm_screen(C)->areabase.first; sa; sa= sa->next)
+ ED_area_tag_redraw(sa);
+ wm_draw_update(C);
+
+ CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
+}
+
+static EnumPropertyItem redraw_timer_type_items[] = {
+ {0, "DRAW", 0, "Draw Region", "Draw Region"},
+ {1, "DRAW_SWAP", 0, "Draw Region + Swap", "Draw Region and Swap"},
+ {2, "DRAW_WIN", 0, "Draw Window", "Draw Window"},
+ {3, "DRAW_WIN_SWAP", 0, "Draw Window + Swap", "Draw Window and Swap"},
+ {4, "ANIM_STEP", 0, "Anim Step", "Animation Steps"},
+ {5, "ANIM_PLAY", 0, "Anim Play", "Animation Playback"},
+ {6, "UNDO", 0, "Undo/Redo", "Undo/Redo"},
+ {0, NULL, 0, NULL, NULL}};
+
static int redraw_timer_exec(bContext *C, wmOperator *op)
{
ARegion *ar= CTX_wm_region(C);
@@ -2826,7 +2848,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
int iter = RNA_int_get(op->ptr, "iterations");
int a;
float time;
- char *infostr= "";
+ const char *infostr= "";
WM_cursor_wait(1);
@@ -2867,14 +2889,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
CTX_wm_region_set(C, ar_back);
}
else if (type==3) {
- wmWindow *win= CTX_wm_window(C);
- ScrArea *sa;
-
- for(sa= CTX_wm_screen(C)->areabase.first; sa; sa= sa->next)
- ED_area_tag_redraw(sa);
- wm_draw_update(C);
-
- CTX_wm_window_set(C, win); /* XXX context manipulation warning! */
+ redraw_timer_window_swap(C);
}
else if (type==4) {
Scene *scene= CTX_data_scene(C);
@@ -2883,23 +2898,34 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
else scene->r.cfra++;
scene_update_for_newframe(scene, scene->lay);
}
- else {
+ else if (type==5) {
+
+ /* play anim, return on same frame as started with */
+ Scene *scene= CTX_data_scene(C);
+ int tot= (scene->r.efra - scene->r.sfra) + 1;
+
+ while(tot--) {
+ /* todo, ability to escape! */
+ scene->r.cfra++;
+ if(scene->r.cfra > scene->r.efra)
+ scene->r.cfra= scene->r.sfra;
+
+ scene_update_for_newframe(scene, scene->lay);
+ redraw_timer_window_swap(C);
+ }
+ }
+ else { /* 6 */
ED_undo_pop(C);
ED_undo_redo(C);
}
}
time= ((PIL_check_seconds_timer()-stime)*1000);
-
- if(type==0) infostr= "Draw Region";
- if(type==1) infostr= "Draw Region and Swap";
- if(type==2) infostr= "Draw Window";
- if(type==3) infostr= "Draw Window and Swap";
- if(type==4) infostr= "Animation Steps";
- if(type==5) infostr= "Undo/Redo";
-
+
+ RNA_enum_description(redraw_timer_type_items, type, &infostr);
+
WM_cursor_wait(0);
-
+
BKE_reportf(op->reports, RPT_WARNING, "%d x %s: %.2f ms, average: %.4f", iter, infostr, time, time/iter);
return OPERATOR_FINISHED;
@@ -2907,24 +2933,15 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
static void WM_OT_redraw_timer(wmOperatorType *ot)
{
- static EnumPropertyItem prop_type_items[] = {
- {0, "DRAW", 0, "Draw Region", ""},
- {1, "DRAW_SWAP", 0, "Draw Region + Swap", ""},
- {2, "DRAW_WIN", 0, "Draw Window", ""},
- {3, "DRAW_WIN_SWAP", 0, "Draw Window + Swap", ""},
- {4, "ANIM_STEP", 0, "Anim Step", ""},
- {5, "UNDO", 0, "Undo/Redo", ""},
- {0, NULL, 0, NULL, NULL}};
-
ot->name= "Redraw Timer";
ot->idname= "WM_OT_redraw_timer";
ot->description="Simple redraw timer to test the speed of updating the interface";
-
+
ot->invoke= WM_menu_invoke;
ot->exec= redraw_timer_exec;
ot->poll= WM_operator_winactive;
-
- ot->prop= RNA_def_enum(ot->srna, "type", prop_type_items, 0, "Type", "");
+
+ ot->prop= RNA_def_enum(ot->srna, "type", redraw_timer_type_items, 0, "Type", "");
RNA_def_int(ot->srna, "iterations", 10, 1,INT_MAX, "Iterations", "Number of times to redraw", 1,1000);
}
@@ -3201,47 +3218,47 @@ void wm_window_keymap(wmKeyConfig *keyconf)
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F2KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was DXF export */
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "LOGIC_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F3KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "NODE_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F4KEY, KM_PRESS, KM_SHIFT, 0); /* new in 2.5x, was data browser */
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "CONSOLE");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F5KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "VIEW_3D");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F6KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "GRAPH_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F7KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "PROPERTIES");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F8KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "SEQUENCE_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F9KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "OUTLINER");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F10KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "IMAGE_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F11KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "TEXT_EDITOR");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", F12KEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "path", "area.type");
+ RNA_string_set(kmi->ptr, "data_path", "area.type");
RNA_string_set(kmi->ptr, "value", "DOPESHEET_EDITOR");
gesture_circle_modal_keymap(keyconf);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index b730d1a6483..6d01620dae8 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -729,7 +729,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private)
CTX_wm_window_set(C, win);
WM_operator_properties_create(&props_ptr, "WM_OT_open_mainfile");
- RNA_string_set(&props_ptr, "path", path);
+ RNA_string_set(&props_ptr, "filepath", path);
WM_operator_name_call(C, "WM_OT_open_mainfile", WM_OP_EXEC_DEFAULT, &props_ptr);
WM_operator_properties_free(&props_ptr);
diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h
index 400c355bd0a..c2d4245b77f 100644
--- a/source/gameengine/Ketsji/BL_BlenderShader.h
+++ b/source/gameengine/Ketsji/BL_BlenderShader.h
@@ -56,6 +56,13 @@ public:
void ReloadMaterial();
int GetBlendMode();
+ void SetScene(KX_Scene *scene)
+ {
+ mScene = scene;
+ mBlenderScene = scene->GetBlenderScene();
+ ReloadMaterial();
+ }
+
bool Equals(BL_BlenderShader *blshader);
diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h
index c5f5e23c6e7..e28c43d1a23 100644
--- a/source/gameengine/Ketsji/KX_BlenderMaterial.h
+++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h
@@ -89,6 +89,7 @@ public:
virtual void Replace_IScene(SCA_IScene *val)
{
mScene= static_cast<KX_Scene *>(val);
+ mBlenderShader->SetScene(mScene);
};
#ifndef DISABLE_PYTHON
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index abc597a9eae..ecfacb8f9bb 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1329,7 +1329,8 @@ static int mathutils_kxgameob_vector_set(BaseMathObject *bmo, int subtype)
self->NodeUpdateGS(0.f);
break;
case MATHUTILS_VEC_CB_SCALE_GLOBAL:
- break;
+ PyErr_SetString(PyExc_AttributeError, "KX_GameObject.worldScale is read-only");
+ return 0;
case MATHUTILS_VEC_CB_INERTIA_LOCAL:
/* read only */
break;
@@ -1370,9 +1371,7 @@ static int mathutils_kxgameob_vector_set_index(BaseMathObject *bmo, int subtype,
return 0;
bmo->data[index]= f;
- mathutils_kxgameob_vector_set(bmo, subtype);
-
- return 1;
+ return mathutils_kxgameob_vector_set(bmo, subtype);
}
Mathutils_Callback mathutils_kxgameob_vector_cb = {
diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
index dff95551d70..df071d50aa2 100644
--- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp
@@ -445,9 +445,7 @@ static int mathutils_obactu_vector_set_index(BaseMathObject *bmo, int subtype, i
return 0;
bmo->data[index]= f;
- mathutils_obactu_vector_set(bmo, subtype);
-
- return 1;
+ return mathutils_obactu_vector_set(bmo, subtype);
}
Mathutils_Callback mathutils_obactu_vector_cb = {
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index d72fef166e6..99bec8159b4 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1754,7 +1754,7 @@ bool KX_Scene::MergeScene(KX_Scene *other)
}
- GetBucketManager()->MergeBucketManager(other->GetBucketManager());
+ GetBucketManager()->MergeBucketManager(other->GetBucketManager(), this);
/* move materials across, assume they both use the same scene-converters */
GetSceneConverter()->MergeScene(this, other);
diff --git a/source/gameengine/PyDoc/bge.types.rst b/source/gameengine/PyDoc/bge.types.rst
index 1800ea0db2d..935d3e7e00e 100644
--- a/source/gameengine/PyDoc/bge.types.rst
+++ b/source/gameengine/PyDoc/bge.types.rst
@@ -2309,7 +2309,7 @@ Game Engine bge.types Module
:return: mesh proxy
:rtype: :class:`MeshProxy`
-.. class:: KX_PolygonMaterial
+.. class:: KX_PolygonMaterial(PyObjectPlus)
This is the interface to materials in the game engine.
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index 4c22f4dcfc7..32fb1e31780 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -346,13 +346,21 @@ void RAS_BucketManager::RemoveMaterial(RAS_IPolyMaterial * mat)
//#include <stdio.h>
-void RAS_BucketManager::MergeBucketManager(RAS_BucketManager *other)
+void RAS_BucketManager::MergeBucketManager(RAS_BucketManager *other, SCA_IScene *scene)
{
/* concatinate lists */
// printf("BEFORE %d %d\n", GetSolidBuckets().size(), GetAlphaBuckets().size());
+ BucketList::iterator it;
+
+ for (it = other->GetSolidBuckets().begin(); it != other->GetSolidBuckets().end(); ++it)
+ (*it)->GetPolyMaterial()->Replace_IScene(scene);
+
GetSolidBuckets().insert( GetSolidBuckets().end(), other->GetSolidBuckets().begin(), other->GetSolidBuckets().end() );
other->GetSolidBuckets().clear();
+ for (it = other->GetAlphaBuckets().begin(); it != other->GetAlphaBuckets().end(); ++it)
+ (*it)->GetPolyMaterial()->Replace_IScene(scene);
+
GetAlphaBuckets().insert( GetAlphaBuckets().end(), other->GetAlphaBuckets().begin(), other->GetAlphaBuckets().end() );
other->GetAlphaBuckets().clear();
//printf("AFTER %d %d\n", GetSolidBuckets().size(), GetAlphaBuckets().size());
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h
index 9edac8dcdc8..487df50802c 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.h
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.h
@@ -63,7 +63,7 @@ public:
void RemoveMaterial(RAS_IPolyMaterial * mat); // freeing scenes only
/* for merging */
- void MergeBucketManager(RAS_BucketManager *other);
+ void MergeBucketManager(RAS_BucketManager *other, SCA_IScene *scene);
BucketList & GetSolidBuckets() {return m_SolidBuckets;};
BucketList & GetAlphaBuckets() {return m_AlphaBuckets;};
diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp
index 01e783edc10..5cb50900c89 100644
--- a/source/gameengine/VideoTexture/blendVideoTex.cpp
+++ b/source/gameengine/VideoTexture/blendVideoTex.cpp
@@ -206,7 +206,7 @@ PyObject* initVideoTexture(void)
PyModule_AddObject(m, (char*)"Texture", (PyObject*)&TextureType);
// init last error description
- Exception::m_lastError[0] = '\0';
+ Exception::m_lastError = "";
return m;
}