Merged changes in the trunk up to revision 54171.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Tue, 29 Jan 2013 03:42:19 +0000 (03:42 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Tue, 29 Jan 2013 03:42:19 +0000 (03:42 +0000)
84 files changed:
SConstruct
doc/python_api/rst/bge.events.rst
doc/python_api/rst/bge.types.rst
intern/cycles/blender/addon/__init__.py
intern/cycles/blender/addon/engine.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_python.cpp
intern/cycles/blender/blender_session.cpp
intern/guardedalloc/intern/mallocn.c
release/datafiles/preview_cycles.blend [new file with mode: 0644]
release/scripts/modules/bl_i18n_utils/spell_check_utils.py
release/scripts/startup/bl_operators/object_align.py
release/scripts/startup/bl_operators/rigidbody.py
release/scripts/startup/bl_operators/wm.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_info.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/avi/intern/avi.c
source/blender/blenkernel/BKE_packedFile.h
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/bmesh/intern/bmesh_log.c
source/blender/compositor/operations/COM_DilateErodeOperation.cpp
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/keyframing.c
source/blender/editors/datafiles/CMakeLists.txt
source/blender/editors/datafiles/SConscript
source/blender/editors/include/ED_datafiles.h
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/mask/mask_add.c
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_ops.c
source/blender/editors/object/object_relations.c
source/blender/editors/physics/rigidbody_object.c
source/blender/editors/render/render_preview.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_info/info_intern.h
source/blender/editors/space_info/info_ops.c
source/blender/editors/space_info/info_report.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_buttons.c
source/blender/editors/space_logic/logic_ops.c
source/blender/editors/space_node/node_add.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_relationships.c
source/blender/editors/space_script/script_edit.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/sequencer_select.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/transform/transform.c
source/blender/gpu/intern/gpu_draw.c
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/rna_rigidbody.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_scene_api.c
source/blender/makesrna/intern/rna_ui.c
source/blender/python/intern/bpy_rna.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/quicktime/apple/quicktime_export.c
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_operators.c
source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
source/gameengine/BlenderRoutines/KX_BlenderGL.h
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/GamePlayer/common/GPC_RenderTools.h
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Rasterizer/RAS_IRenderTools.h

index e3e58270cdda2fa8677d9d2f0298f136fb2d3fd7..70ada74cfa98b15d0ba824f59b60afe8dd8e42e5 100644 (file)
@@ -524,6 +524,7 @@ data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
 
 data_to_c_simple("release/datafiles/startup.blend")
 data_to_c_simple("release/datafiles/preview.blend")
+data_to_c_simple("release/datafiles/preview_cycles.blend")
 
 # --- glsl ---
 data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
index 074e928f0d86d4cb5ecb06603ce6ff6170f2de0f..2238faea24221adc3cae6fd1d3901f4f2516cafb 100644 (file)
@@ -69,7 +69,7 @@ Functions
 
    Return the string name of a key event. Will raise a ValueError error if its invalid.
 
-   :arg event: key event from bge.keys or the keyboard sensor.
+   :arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
    :type event: int
    :rtype: string
    
@@ -78,7 +78,7 @@ Functions
    Return the string name of a key event. Returns an empty string if the event cant be represented as a character.
    
    :type event: int
-   :arg event: key event from :mod:`bge.keys` or the keyboard sensor.
+   :arg event: key event constant from :mod:`bge.events` or the keyboard sensor.
    :type shift: bool
    :arg shift: set to true if shift is held.
    :rtype: string
index a86272ddf5cddb842c8817f52e06a06aa80b7df7..1e2632b9ada7f3a2b65b27fbd121a78739ec4592 100644 (file)
@@ -4215,25 +4215,25 @@ Types
 
    A keyboard sensor detects player key presses.
 
-   See module :mod:`bge.keys` for keycode values.
+   See module :mod:`bge.events` for keycode values.
 
    .. attribute:: key
 
       The key code this sensor is looking for.
 
-      :type: keycode from :mod:`bge.keys` module
+      :type: keycode from :mod:`bge.events` module
 
    .. attribute:: hold1
 
       The key code for the first modifier this sensor is looking for.
 
-      :type: keycode from :mod:`bge.keys` module
+      :type: keycode from :mod:`bge.events` module
 
    .. attribute:: hold2
 
       The key code for the second modifier this sensor is looking for.
 
-      :type: keycode from :mod:`bge.keys` module
+      :type: keycode from :mod:`bge.events` module
 
    .. attribute:: toggleProperty
 
index 36fb5c0418d461ad96ba9a5863396b225a2a7a69..16cfdca8977c744fb0bb338c11a4598792da8657 100644 (file)
@@ -39,6 +39,7 @@ class CyclesRender(bpy.types.RenderEngine):
     bl_idname = 'CYCLES'
     bl_label = "Cycles Render"
     bl_use_shading_nodes = True
+    bl_use_preview = True
 
     def __init__(self):
         self.session = None
@@ -48,23 +49,23 @@ class CyclesRender(bpy.types.RenderEngine):
 
     # final render
     def update(self, data, scene):
-        if not self.session:
-            engine.create(self, data, scene)
+        if self.is_preview:
+            if not self.session:
+                use_osl = bpy.context.scene.cycles.shading_system
+
+                engine.create(self, data, scene,
+                              None, None, None, use_osl)
         else:
-            engine.reset(self, data, scene)
+            if not self.session:
+                engine.create(self, data, scene)
+            else:
+                engine.reset(self, data, scene)
 
         engine.update(self, data, scene)
 
     def render(self, scene):
         engine.render(self)
 
-    # preview render
-    # def preview_update(self, context, id):
-    #    pass
-    #
-    # def preview_render(self):
-    #    pass
-
     # viewport render
     def view_update(self, context):
         if not self.session:
index ef700ba26f1f806c5031685fdd2c3a787f957b0a..8958ca3e42e28a6b19274fab12d50aaed9a4ac88 100644 (file)
@@ -30,7 +30,7 @@ def init():
     _cycles.init(path, user_path)
 
 
-def create(engine, data, scene, region=0, v3d=0, rv3d=0):
+def create(engine, data, scene, region=0, v3d=0, rv3d=0, preview_osl=False):
     import bpy
     import _cycles
 
@@ -44,7 +44,7 @@ def create(engine, data, scene, region=0, v3d=0, rv3d=0):
     if rv3d:
         rv3d = rv3d.as_pointer()
 
-    engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d)
+    engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d, preview_osl)
 
 
 def free(engine):
index c4fee6f2de77fb7f4985de03fd71c846efe8f6e5..9d0b6d96f47351c97d14834979bf889046fac526 100644 (file)
@@ -1205,6 +1205,9 @@ def get_panels():
         types.PARTICLE_PT_force_fields,
         types.PARTICLE_PT_vertexgroups,
         types.PARTICLE_PT_custom_props,
+        types.MATERIAL_PT_preview,
+        types.DATA_PT_preview,
+        types.WORLD_PT_preview,
         )
 
 
index d164920cefffbd3bfc3fbdcc3096eef2f68e54f8..676fba76ddfc7173afc4620d7b7b76f51b5540af 100644 (file)
@@ -52,8 +52,9 @@ static PyObject *init_func(PyObject *self, PyObject *args)
 static PyObject *create_func(PyObject *self, PyObject *args)
 {
        PyObject *pyengine, *pyuserpref, *pydata, *pyscene, *pyregion, *pyv3d, *pyrv3d;
+       int preview_osl;
 
-       if(!PyArg_ParseTuple(args, "OOOOOOO", &pyengine, &pyuserpref, &pydata, &pyscene, &pyregion, &pyv3d, &pyrv3d))
+       if(!PyArg_ParseTuple(args, "OOOOOOOp", &pyengine, &pyuserpref, &pydata, &pyscene, &pyregion, &pyv3d, &pyrv3d, &preview_osl))
                return NULL;
 
        /* RNA */
@@ -91,14 +92,22 @@ static PyObject *create_func(PyObject *self, PyObject *args)
        Py_BEGIN_ALLOW_THREADS
 
        if(rv3d) {
-               /* interactive session */
+               /* interactive viewport session */
                int width = region.width();
                int height = region.height();
 
                session = new BlenderSession(engine, userpref, data, scene, v3d, rv3d, width, height);
        }
        else {
-               /* offline session */
+               /* override some settings for preview */
+               if(engine.is_preview()) {
+                       PointerRNA cscene = RNA_pointer_get(&sceneptr, "cycles");
+
+                       RNA_boolean_set(&cscene, "shading_system", preview_osl);
+                       RNA_boolean_set(&cscene, "use_progressive_refine", true);
+               }
+
+               /* offline session or preview render */
                session = new BlenderSession(engine, userpref, data, scene);
        }
 
index 3913323c21c1a02fdd98cbfd2f650530c0e21e8a..650d3d387eebb1df68fc93dbae8b7d965ccb255f 100644 (file)
@@ -288,7 +288,14 @@ void BlenderSession::write_render_tile(RenderTile& rtile)
 
 void BlenderSession::update_render_tile(RenderTile& rtile)
 {
-       do_write_update_render_tile(rtile, true);
+       /* use final write for preview renders, otherwise render result wouldn't be
+        * be updated in blender side
+        * would need to be investigated a bit further, but for now shall be fine
+        */
+       if (!b_engine.is_preview())
+               do_write_update_render_tile(rtile, true);
+       else
+               do_write_update_render_tile(rtile, false);
 }
 
 void BlenderSession::render()
index 559d1138ffbd6c048a6081e4323c372d376304b3..93cb2f6d4d1bd40ad930be245ab86e212c54f11e 100644 (file)
 #  include <sys/mman.h>
 #endif
 
+#if defined(_MSC_VER)
+#  define __func__ __FUNCTION__
+#endif
+
 #include "MEM_guardedalloc.h"
 
 /* Only for debugging:
@@ -360,6 +364,9 @@ void *MEM_reallocN(void *vmemh, size_t len)
 
                MEM_freeN(vmemh);
        }
+       else {
+               newp = MEM_mallocN(len, __func__);
+       }
 
        return newp;
 }
@@ -391,6 +398,9 @@ void *MEM_recallocN(void *vmemh, size_t len)
 
                MEM_freeN(vmemh);
        }
+       else {
+               newp = MEM_callocN(len, __func__);
+       }
 
        return newp;
 }
diff --git a/release/datafiles/preview_cycles.blend b/release/datafiles/preview_cycles.blend
new file mode 100644 (file)
index 0000000..0405516
Binary files /dev/null and b/release/datafiles/preview_cycles.blend differ
index 1dcba6a62d152e2fdd9bd681b2ec204b45b8fb59..2aa3598e4a1e306458153a465846277f90f377f6 100644 (file)
@@ -246,6 +246,7 @@ dict_uimsgs = {
     "tri", "tris",
     "uv", "uvs", "uvw", "uw", "uvmap",
     "vec",
+    "vel",  # velocity!
     "vert", "verts",
     "vis",
     "xyz", "xzy", "yxz", "yzx", "zxy", "zyx",
@@ -311,6 +312,7 @@ dict_uimsgs = {
     "inpaint",
     "lightmap",
     "lossless", "lossy",
+    "matcap",
     "midtones",
     "mipmap", "mipmaps", "mip",
     "ngon", "ngons",
index dd647733850ed2cc8e65c02e8b7e53aee75fd670..e843209da3cd76d5a707ea7364632b9a724e26ac 100644 (file)
@@ -129,17 +129,17 @@ def align_objects(context,
 
     flag_first = True
 
-    objs = []
+    objects = []
 
     for obj in context.selected_objects:
         matrix_world = obj.matrix_world.copy()
         bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
-        objs.append((obj, bb_world))
+        objects.append((obj, bb_world))
 
-    if not objs:
+    if not objects:
         return False
 
-    for obj, bb_world in objs:
+    for obj, bb_world in objects:
 
         if bb_quality and obj.type == 'MESH':
             GBB = GlobalBB_HQ(obj)
@@ -201,7 +201,7 @@ def align_objects(context,
 
     # Main Loop
 
-    for obj, bb_world in objs:
+    for obj, bb_world in objects:
         matrix_world = obj.matrix_world.copy()
         bb_world = [matrix_world * Vector(v[:]) for v in obj.bound_box]
 
index bad861639323bcbcfb737119aeb8e7b526521056..94465fa6561d86d73c412c1ae39bc6f5c33c730f 100644 (file)
@@ -27,7 +27,7 @@ from bpy.props import EnumProperty
 class CopyRigidbodySettings(Operator):
     '''Copy Rigid Body settings from active object to selected'''
     bl_idname = "rigidbody.object_settings_copy"
-    bl_label = "Copy Rigidbody Settings"
+    bl_label = "Copy Rigid Body Settings"
     bl_options = {'REGISTER', 'UNDO'}
 
     @classmethod
@@ -37,21 +37,21 @@ class CopyRigidbodySettings(Operator):
 
     def execute(self, context):
         obj = context.object
-        scn = context.scene
+        scene = context.scene
 
         # deselect all but mesh objects
         for o in context.selected_objects:
             if o.type != 'MESH':
                 o.select = False
 
-        sel = context.selected_objects
-        if sel:
+        objects = context.selected_objects
+        if objects:
             # add selected objects to active one groups and recalculate
             bpy.ops.group.objects_add_active()
-            scn.frame_set(scn.frame_current)
+            scene.frame_set(scene.frame_current)
 
             # copy settings
-            for o in sel:
+            for o in objects:
                 if o.rigid_body is None:
                     continue
                 
@@ -106,7 +106,7 @@ class BakeToKeyframes(Operator):
 
     def execute(self, context):
         bake = []
-        objs = []
+        objects = []
         scene = context.scene
         frame_orig = scene.frame_current
         frames = list(range(self.frame_start, self.frame_end + 1, self.step))
@@ -116,23 +116,23 @@ class BakeToKeyframes(Operator):
             if not obj.rigid_body or obj.rigid_body.type != 'ACTIVE':
                 obj.select = False
 
-        objs = context.selected_objects
+        objects = context.selected_objects
 
-        if objs:
+        if objects:
             # store transformation data
             for f in list(range(self.frame_start, self.frame_end + 1)):
                 scene.frame_set(f)
                 if f in frames:
                     mat = {}
-                    for i, obj in enumerate(objs):
+                    for i, obj in enumerate(objects):
                         mat[i] = obj.matrix_world.copy()
                     bake.append(mat)
 
             # apply transformations as keyframes
             for i, f in enumerate(frames):
                 scene.frame_set(f)
-                obj_prev = objs[0]
-                for j, obj in enumerate(objs):
+                obj_prev = objects[0]
+                for j, obj in enumerate(objects):
                     mat = bake[i][j]
 
                     obj.location = mat.to_translation()
@@ -156,7 +156,7 @@ class BakeToKeyframes(Operator):
             bpy.ops.rigidbody.objects_remove()
 
             # clean up keyframes
-            for obj in objs:
+            for obj in objects:
                 action = obj.animation_data.action
                 for fcu in action.fcurves:
                     keyframe_points = fcu.keyframe_points
@@ -190,23 +190,17 @@ class BakeToKeyframes(Operator):
 
 
 class ConnectRigidBodies(Operator):
-
-
-    '''Connect selected rigid bodies to active'''
+    '''Create rigid body constraints between selected and active rigid bodies'''
     bl_idname = "rigidbody.connect"
-    bl_label = "ConnectRigidBodies"
+    bl_label = "Connect Rigid Bodies"
     bl_options = {'REGISTER', 'UNDO'}
 
     con_type = EnumProperty(
         name="Type",
-        description="Type of generated contraint",
-        items=(('FIXED', "Fixed", "Glues ridig bodies together"),
-               ('POINT', "Point", "Constrains rigid bodies to move aound common pivot point"),
-               ('HINGE', "Hinge", "Restricts rigid body rotation to one axis"),
-               ('SLIDER', "Slider", "Restricts rigid boddy translation to one axis"),
-               ('PISTON', "Piston", "Restricts rigid boddy translation and rotation to one axis"),
-               ('GENERIC', "Generic", "Restricts translation and rotation to specified axes"),
-               ('GENERIC_SPRING', "Generic Spring", "Restricts translation and rotation to specified axes with springs")),
+        description="Type of generated constraint",
+        # XXX Would be nice to get icons too, but currently not possible ;)
+        items=tuple((e.identifier, e.name, e.description, e. value)
+                    for e in bpy.types.RigidBodyConstraint.bl_rna.properties["type"].enum_items),
         default='FIXED',)
 
     pivot_type = EnumProperty(
@@ -214,21 +208,22 @@ class ConnectRigidBodies(Operator):
         description="Constraint pivot location",
         items=(('CENTER', "Center", "Pivot location is between the constrained rigid bodies"),
                ('ACTIVE', "Active", "Pivot location is at the active object position"),
-               ('SELECTED', "Selected", "Pivot location is at the slected object position")),
+               ('SELECTED', "Selected", "Pivot location is at the selected object position")),
         default='CENTER',)
 
     @classmethod
     def poll(cls, context):
         obj = context.object
-        objs = context.selected_objects
-        return (obj and obj.rigid_body and (len(objs) > 1))
+        return (obj and obj.rigid_body)
 
     def execute(self, context):
 
-        objs = context.selected_objects
+        scene = context.scene
+        objects = context.selected_objects
         obj_act = context.active_object
+        change = False
 
-        for obj in objs:
+        for obj in objects:
             if obj == obj_act:
                 continue
             if self.pivot_type == 'ACTIVE':
@@ -243,9 +238,15 @@ class ConnectRigidBodies(Operator):
             con.type = self.con_type
             con.object1 = obj_act
             con.object2 = obj
-
-        return {'FINISHED'}
-
-    def invoke(self, context, event):
-        wm = context.window_manager
-        return wm.invoke_props_dialog(self)
+            change = True
+        
+        if change:
+            # restore selection
+            bpy.ops.object.select_all(action='DESELECT')
+            for obj in objects:
+                obj.select = True;
+            scene.objects.active = obj_act
+            return {'FINISHED'}
+        else:
+            self.report({'WARNING'}, "No other objects selected")
+            return {'CANCELLED'}
index fa2cb5d5356b5c99ed751bf5629cbd3fececa67e..902cfdd418ba8965a8d263eabeb87fbbcf58ae04 100644 (file)
@@ -35,6 +35,7 @@ class MESH_OT_delete_edgeloop(Operator):
     """to a single face loop"""
     bl_idname = "mesh.delete_edgeloop"
     bl_label = "Delete Edge Loop"
+    bl_options = {'UNDO', 'REGISTER'}
 
     @classmethod
     def poll(cls, context):
index a896855b217e23cb0c6b741a4ae0318e621559a5..1f05c8eea5aac98af7b463d55b2c1f56c8572270 100644 (file)
@@ -621,7 +621,9 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
 
         layout.prop(gs, "physics_engine")
         if gs.physics_engine != 'NONE':
-            layout.prop(gs, "physics_gravity", text="Gravity")
+            col = layout.column()
+            col.prop(gs, "physics_gravity", text="Gravity")
+            col.prop(gs, "occlusion_culling_resolution", text="Culling Resolution")
 
             split = layout.split()
 
@@ -644,12 +646,6 @@ class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
             sub = col.row()
             sub.prop(gs, "deactivation_time", text="Time")
 
-            col = layout.column()
-            col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
-            sub = col.column()
-            sub.active = gs.use_occlusion_culling
-            sub.prop(gs, "occlusion_culling_resolution", text="Resolution")
-
         else:
             split = layout.split()
 
index cfedc5e1e003268b004a8380dbaed589e36d516d..179c41ace0830ddd5b7d9bb39429bdedffe276ce 100644 (file)
@@ -146,9 +146,7 @@ class IMAGE_MT_image(Menu):
             if not show_render:
                 layout.separator()
 
-                if ima.packed_file:
-                    layout.operator("image.unpack")
-                else:
+                if not ima.packed_file:
                     layout.operator("image.pack")
 
                 # only for dirty && specific image types, perhaps
index c0d1f725ab63819840301883a9f72d0667386de9..47e8844742a77aa2cd8144dfac3ae6c2504aaec8 100644 (file)
@@ -362,6 +362,12 @@ class INFO_MT_window(Menu):
 
         layout.operator("wm.window_duplicate")
         layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
+
+        layout.separator()
+
+        layout.operator("screen.screenshot").full = True
+        layout.operator("screen.screencast").full = True
+
         if sys.platform[:3] == "win":
             layout.separator()
             layout.operator("wm.console_toggle", icon='CONSOLE')
index 6c5cc93947b5c049632d395ded1873d469cfa23b..9753a368f545a017aaa1972b50346d7b46b96037 100644 (file)
@@ -2702,6 +2702,8 @@ class VIEW3D_PT_etch_a_ton(Panel):
         col.prop(toolsettings, "use_etch_quick")
         col.prop(toolsettings, "use_etch_overdraw")
 
+        col.separator()
+
         col.prop(toolsettings, "etch_convert_mode")
 
         if toolsettings.etch_convert_mode == 'LENGTH':
@@ -2713,11 +2715,20 @@ class VIEW3D_PT_etch_a_ton(Panel):
         elif toolsettings.etch_convert_mode == 'RETARGET':
             col.prop(toolsettings, "etch_template")
             col.prop(toolsettings, "etch_roll_mode")
-            col.prop(toolsettings, "use_etch_autoname")
-            col.prop(toolsettings, "etch_number")
-            col.prop(toolsettings, "etch_side")
 
-        col.operator("sketch.convert", text="Convert")
+            col.separator()
+
+            colsub = col.column(align=True)
+            colsub.prop(toolsettings, "use_etch_autoname")
+            sub = colsub.column() 
+            sub.enabled = not toolsettings.use_etch_autoname
+            sub.prop(toolsettings, "etch_number")
+            sub.prop(toolsettings, "etch_side")
+
+        col.separator()
+
+        col.operator("sketch.convert", text="Convert to Bones")
+        col.operator("sketch.delete", text="Delete Strokes")
 
 
 class VIEW3D_PT_context_properties(Panel):
index ca79c6cb7fa25bfd58a31bb7d8e96005dbbaf50b..0faac7cce3ff451cb04944c54ee6d9f29b79827c 100644 (file)
@@ -113,7 +113,7 @@ class VIEW3D_PT_tools_objectmode(View3DPanel, Panel):
 
 class VIEW3D_PT_tools_rigidbody(View3DPanel, Panel):
     bl_context = "objectmode"
-    bl_label = "Rigidbody Tools"
+    bl_label = "Rigid Body Tools"
     bl_options = {'DEFAULT_CLOSED'}
 
     def draw(self, context):
index d6301b723a79813c85aeb5997e85bd12c376bd0c..fcc9526b58a0746efa6a727a71d0a62add16ab5f 100644 (file)
@@ -950,7 +950,6 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
 {
        AviList list;
        AviChunk chunk;
-       AviIndexEntry *temp;
        va_list ap;
        int stream;
        int64_t rec_off;
@@ -965,15 +964,7 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
 
        if (frame_num + 1 > movie->index_entries) {
                const size_t entry_size = (movie->header->Streams + 1) * sizeof(AviIndexEntry);
-
-               if (movie->entries != NULL) {
-                       temp = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
-               }
-               else {
-                       temp = (AviIndexEntry *) MEM_callocN((frame_num + 1) * entry_size, "newidxentry");
-               }
-
-               movie->entries = temp;
+               movie->entries = (AviIndexEntry *)MEM_recallocN(movie->entries, (frame_num + 1) * entry_size);
                movie->index_entries = frame_num + 1;
        }
 
index 9dcbb41c7dc6a8e33b0029556aafe89658e4da96..b19a2092206a631660218daa6a5808b851a9bd58 100644 (file)
@@ -35,6 +35,7 @@
 #define RET_OK      0
 #define RET_ERROR   1
 
+struct ID;
 struct bSound;
 struct Image;
 struct Main;
@@ -72,5 +73,10 @@ int seekPackedFile(struct PackedFile *pf, int offset, int whence);
 void rewindPackedFile(struct PackedFile *pf);
 int readPackedFile(struct PackedFile *pf, void *data, int size);
 
+/* ID should be not NULL, return 1 if there's a packed file */
+int BKE_pack_check(struct ID *id);
+/* ID should be not NULL, throws error when ID is Library */
+void BKE_unpack_id(struct Main *bmain, struct ID *id, struct ReportList *reports, int how);
+
 #endif
 
index dab54756c8264fcc6de8c47b0d1fb797004dc0fc..bc9c8a7ad50538a0a6e65956a397299e3c9ca524 100644 (file)
@@ -312,7 +312,7 @@ static void motionpaths_calc_optimise_depsgraph(Scene *scene, ListBase *targets)
                                BLI_addhead(&scene->base, base);
                                
                                mpt->ob->flag |= BA_TEMP_TAG;
-
+                               
                                /* we really don't need to continue anymore once this happens, but this line might really 'break' */
                                break;
                        }
index aecf6e5e437db8d3765dbce5f007d998328413b7..c8fd8aa93e53fcbb57e9b170128b99d9de357bdc 100644 (file)
@@ -507,7 +507,7 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
                else if (dstAdt->action == srcAdt->action) {
                        printf("Argh! Source and Destination share animation! ('%s' and '%s' both use '%s') Making new empty action\n",
                               srcID->name, dstID->name, srcAdt->action->id.name);
-
+                       
                        /* TODO: review this... */
                        id_us_min(&dstAdt->action->id);
                        dstAdt->action = add_empty_action(dstAdt->action->id.name + 2);
@@ -536,9 +536,9 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
                                        /* just need to change lists */
                                        BLI_remlink(&srcAdt->drivers, fcu);
                                        BLI_addtail(&dstAdt->drivers, fcu);
-
+                                       
                                        /* TODO: add depsgraph flushing calls? */
-
+                                       
                                        /* can stop now, as moved already */
                                        break;
                                }
index ad14dee168ac8dad27fb66e1e662ffd05e21e786..3a705a07e2277bb66a49fe3f93c9be38828052a1 100644 (file)
@@ -2258,7 +2258,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha
 {
        bActionModifier *amod;
        bActionStrip *strip, *strip2;
-       float scene_cfra = (float)scene->r.cfra;
+       float scene_cfra = BKE_scene_frame_get(scene);
        int do_modif;
 
        for (strip = armob->nlastrips.first; strip; strip = strip->next) {
index 803b1e68915c1a41d5132bd71ad5c644afe58ff6..cb0a11a16e0ec9599a60a18ec6616f542555b3a5 100644 (file)
@@ -1065,7 +1065,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
        if (key->slurph && key->type != KEY_RELATIVE) {
                const float ctime_scaled = key->ctime / 100.0f;
                float delta = (float)key->slurph / tot;
-               float cfra = (float)scene->r.cfra + scene->r.subframe;
+               float cfra = BKE_scene_frame_get(scene);
                int step, a;
 
                if (tot > 100 && slurph_opt) {
@@ -1163,7 +1163,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
        if (key->slurph && key->type != KEY_RELATIVE) {
                const float ctime_scaled = key->ctime / 100.0f;
                float delta = (float)key->slurph / tot;
-               float cfra = (float)scene->r.cfra + scene->r.subframe;
+               float cfra = BKE_scene_frame_get(scene);
                Nurb *nu;
                int i = 0, remain = 0;
                int step, a;
@@ -1245,7 +1245,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
        if (key->slurph && key->type != KEY_RELATIVE) {
                const float ctime_scaled = key->ctime / 100.0f;
                float delta = (float)key->slurph / tot;
-               float cfra = (float)scene->r.cfra + scene->r.subframe;
+               float cfra = BKE_scene_frame_get(scene);
                int a;
 
                for (a = 0; a < tot; a++, cfra += delta) {
@@ -1360,7 +1360,7 @@ float *BKE_key_evaluate_object(Scene *scene, Object *ob, int *r_totelem)
        }
        else {
                /* do shapekey local drivers */
-               float ctime = (float)scene->r.cfra + scene->r.subframe;
+               float ctime = BKE_scene_frame_get(scene);
 
                BKE_animsys_evaluate_animdata(scene, &key->id, key->adt, ctime, ADT_RECALC_DRIVERS);
                
index 8a6309593f19702a221e5dfc31273ae4cd0c9dc7..a46196f38d8e7557bc35e8185b9fb1a1cb08372f 100644 (file)
@@ -1822,7 +1822,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[4][4])
                CLAMP(ctime, 0.0f, 1.0f);
        }
        else {
-               ctime = scene->r.cfra;
+               ctime = BKE_scene_frame_get(scene);
                if (IS_EQF(cu->pathlen, 0.0f) == 0)
                        ctime /= cu->pathlen;
                
@@ -2201,7 +2201,7 @@ void BKE_object_where_is_calc_mat4(Scene *scene, Object *ob, float obmat[4][4])
 
 void BKE_object_where_is_calc(struct Scene *scene, Object *ob)
 {
-       BKE_object_where_is_calc_time(scene, ob, (float)scene->r.cfra);
+       BKE_object_where_is_calc_time(scene, ob, BKE_scene_frame_get(scene));
 }
 
 void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
@@ -2240,7 +2240,7 @@ void BKE_object_where_is_calc_simul(Scene *scene, Object *ob)
                bConstraintOb *cob;
                
                cob = BKE_constraints_make_evalob(scene, ob, NULL, CONSTRAINT_OBTYPE_OBJECT);
-               BKE_solve_constraints(&ob->constraints, cob, (float)scene->r.cfra);
+               BKE_solve_constraints(&ob->constraints, cob, BKE_scene_frame_get(scene));
                BKE_constraints_clear_evalob(cob);
        }
 }
@@ -2684,7 +2684,7 @@ void BKE_object_handle_update(Scene *scene, Object *ob)
                if (ob->recalc & OB_RECALC_DATA) {
                        ID *data_id = (ID *)ob->data;
                        AnimData *adt = BKE_animdata_from_id(data_id);
-                       float ctime = (float)scene->r.cfra;  /* XXX this is bad... */
+                       float ctime = BKE_scene_frame_get(scene);
                        
                        if (G.debug & G_DEBUG)
                                printf("recalcdata %s\n", ob->id.name + 2);
index 9fab052f80c005343f61c1c0d8c67b98663aa407..288e4ccde5d444d4f00eb23bdf660a5b514474a7 100644 (file)
@@ -44,9 +44,9 @@
 
 #include "DNA_image_types.h"
 #include "DNA_ID.h"
+#include "DNA_packedFile_types.h"
 #include "DNA_sound_types.h"
 #include "DNA_vfont_types.h"
-#include "DNA_packedFile_types.h"
 
 #include "BLI_blenlib.h"
 #include "BLI_utildefines.h"
@@ -233,11 +233,13 @@ void packAll(Main *bmain, ReportList *reports)
        Image *ima;
        VFont *vfont;
        bSound *sound;
+       int tot = 0;
        
        for (ima = bmain->image.first; ima; ima = ima->id.next) {
                if (ima->packedfile == NULL && ima->id.lib == NULL) {
                        if (ima->source == IMA_SRC_FILE) {
                                ima->packedfile = newPackedFile(reports, ima->name, ID_BLEND_PATH(bmain, &ima->id));
+                               tot ++;
                        }
                        else if (ELEM(ima->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) {
                                BKE_reportf(reports, RPT_WARNING, "Image '%s' skipped, movies and image sequences not supported",
@@ -246,13 +248,26 @@ void packAll(Main *bmain, ReportList *reports)
                }
        }
 
-       for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next)
-               if (vfont->packedfile == NULL && vfont->id.lib == NULL && BKE_vfont_is_builtin(vfont) == FALSE)
+       for (vfont = bmain->vfont.first; vfont; vfont = vfont->id.next) {
+               if (vfont->packedfile == NULL && vfont->id.lib == NULL && BKE_vfont_is_builtin(vfont) == FALSE) {
                        vfont->packedfile = newPackedFile(reports, vfont->name, bmain->name);
+                       tot ++;
+               }
+       }
 
-       for (sound = bmain->sound.first; sound; sound = sound->id.next)
-               if (sound->packedfile == NULL && sound->id.lib == NULL)
+       for (sound = bmain->sound.first; sound; sound = sound->id.next) {
+               if (sound->packedfile == NULL && sound->id.lib == NULL) {
                        sound->packedfile = newPackedFile(reports, sound->name, bmain->name);
+                       tot++;
+               }
+       }
+       
+       if (tot == 0)
+               BKE_report(reports, RPT_INFO, "No files have been packed");
+       else
+               BKE_reportf(reports, RPT_INFO, "Packed %d files", tot);
+
+
 }
 
 
@@ -316,6 +331,9 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
                        BKE_reportf(reports, RPT_ERROR, "Error writing file '%s'", name);
                        ret_value = RET_ERROR;
                }
+               else
+                       BKE_reportf(reports, RPT_INFO, "Saved packed file to: %s", name);
+               
                close(file);
        }
        else {
@@ -439,6 +457,7 @@ char *unpackFile(ReportList *reports, const char *abs_name, const char *local_na
                        case PF_USE_ORIGINAL:
                                /* if file exists use it */
                                if (BLI_exists(abs_name)) {
+                                       BKE_reportf(reports, RPT_INFO, "Use existing file (instead of packed): %s", abs_name);
                                        temp = abs_name;
                                        break;
                                }
@@ -604,3 +623,48 @@ void unpackAll(Main *bmain, ReportList *reports, int how)
                        unpackSound(bmain, reports, sound, how);
 }
 
+/* ID should be not NULL, return 1 if there's a packed file */
+int BKE_pack_check(ID *id)
+{
+       if (GS(id->name) == ID_IM) {
+               Image *ima = (Image *)id;
+               return ima->packedfile != NULL;
+       }
+       if (GS(id->name) == ID_VF) {
+               VFont *vf = (VFont *)id;
+               return vf->packedfile != NULL;
+       }
+       if (GS(id->name) == ID_SO) {
+               bSound *snd = (bSound *)id;
+               return snd->packedfile != NULL;
+       }
+       if (GS(id->name) == ID_LI) {
+               Library *li = (Library *)id;
+               return li->packedfile != NULL;
+       }
+       return 0;
+}
+
+/* ID should be not NULL */
+void BKE_unpack_id(Main *bmain, ID *id, ReportList *reports, int how)
+{
+       if (GS(id->name) == ID_IM) {
+               Image *ima = (Image *)id;
+               if (ima->packedfile)
+                       unpackImage(reports, ima, how);
+       }
+       if (GS(id->name) == ID_VF) {
+               VFont *vf = (VFont *)id;
+               if (vf->packedfile)
+                       unpackVFont(reports, vf, how);
+       }
+       if (GS(id->name) == ID_SO) {
+               bSound *snd = (bSound *)id;
+               if (snd->packedfile)
+                       unpackSound(bmain, reports, snd, how);
+       }
+       if (GS(id->name) == ID_LI) {
+               Library *li = (Library *)id;
+               BKE_reportf(reports, RPT_ERROR, "Cannot unpack individual Library file, '%s'", li->name);
+       }
+}
index ce6e158b6d978cdb268ed8cb382e069ea56bc83f..0d0944d6ea76cfb9d88b219440ba75c0d39a90e5 100644 (file)
@@ -1720,7 +1720,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
        if (ccgdm->pbvh && ccgdm->multires.mmd && !fast) {
                if (dm->numTessFaceData) {
                        BKE_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL,
-                                                 setMaterial, FALSE);
+                                     setMaterial, FALSE);
                        glShadeModel(GL_FLAT);
                }
 
index 68f8f38fb26d909288f641680e87c868964bfed7..1337cb7c8eb8797a16b20557312316b9ffc03574 100644 (file)
@@ -165,13 +165,13 @@ static BMFace *bm_log_face_from_id(BMLog *log, unsigned int id)
  * Returns zero if no paint-mask layer is present */
 static float vert_mask_get(BMesh *bm, BMVert *v)
 {
-       CustomData *cd = &bm->vdata;
-       if (CustomData_has_layer(&bm->vdata, CD_PAINT_MASK)) {
-               float *mask = CustomData_bmesh_get(cd, v->head.data, CD_PAINT_MASK);
+       float *mask = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_PAINT_MASK);
+       BLI_assert((CustomData_has_layer(&bm->vdata, CD_PAINT_MASK) == 0) == (mask == NULL));
+       if (mask) {
                return *mask;
        }
        else {
-               return 0;
+               return 0.0f;
        }
 }
 
@@ -180,10 +180,10 @@ static float vert_mask_get(BMesh *bm, BMVert *v)
  * Has no effect is no paint-mask layer is present */
 static void vert_mask_set(BMesh *bm, BMVert *v, float new_mask)
 {
-       CustomData *cd = &bm->vdata;
-       if (CustomData_has_layer(cd, CD_PAINT_MASK)) {
-               float *mask = CustomData_bmesh_get(cd, v->head.data, CD_PAINT_MASK);
-               (*mask) = new_mask;
+       float *mask = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_PAINT_MASK);
+       BLI_assert((CustomData_has_layer(&bm->vdata, CD_PAINT_MASK) == 0) == (mask == NULL));
+       if (*mask) {
+               *mask = new_mask;
        }
 }
 
@@ -452,7 +452,8 @@ BMLog *BM_log_from_existing_entries_create(BMesh *bm, BMLogEntry *entry)
 
        /* Let BMLog manage the entry list again */
        log->entries.first = log->entries.last = entry;
-       if (entry) {
+
+       {
                while (entry->prev) {
                        entry = entry->prev;
                        log->entries.first = entry;
index 07b958cc3357612265cab05a75e038c2a8d55634..ecc618a5346c5ce579a63d5357bc0dc0dbd801b9 100644 (file)
@@ -345,8 +345,8 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
                 */
                int half_window = this->m_iterations;
                int window = half_window * 2 + 1;
-               float *temp = (float *)MEM_mallocN((2*window - 1) * sizeof(float), "dilate erode temp");
-               float *buf = (float *)MEM_mallocN((max(bwidth, bheight) + 5*half_window) * sizeof(float), "dilate erode buf");
+               float *temp = (float *)MEM_mallocN((2 * window - 1) * sizeof(float), "dilate erode temp");
+               float *buf = (float *)MEM_mallocN((max(bwidth, bheight) + 5 * half_window) * sizeof(float), "dilate erode buf");
 
                for (y = 0; y < bheight; y++) {
                        for (x = 0; x < window - 1; x++) {
@@ -355,11 +355,11 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
                        for (x = 0; x < bwidth; x++) {
                                buf[x + window - 1] = rectf[bwidth * y + x];
                        }
-                       for (x = bwidth + window - 1; x < bwidth + 5*half_window; x++) {
+                       for (x = bwidth + window - 1; x < bwidth + 5 * half_window; x++) {
                                buf[x] = -MAXFLOAT;
                        }
 
-                       for(i = 0; i < (bwidth + 3*half_window) / window; i++) {
+                       for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
                                int start = (i + 1) * window - 1;
 
                                temp[window - 1] = buf[start];
@@ -368,8 +368,8 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
                                        temp[window - 1 + x] = max(temp[window + x - 2], buf[start + x]);
                                }
 
-                               start = half_window + (i-1) * window + 1;
-                               for (x = -min(0, start); x < window - max(0, start+window - bwidth); x++) {
+                               start = half_window + (i - 1) * window + 1;
+                               for (x = -min(0, start); x < window - max(0, start + window - bwidth); x++) {
                                        rectf[bwidth * y + (start + x)] = max(temp[x], temp[x + window - 1]);
                                }
                        }
@@ -382,11 +382,11 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
                        for (y = 0; y < bheight; y++) {
                                buf[y + window - 1] = rectf[bwidth * y + x];
                        }
-                       for (y = bheight + window - 1; y < bheight + 5*half_window; y++) {
+                       for (y = bheight + window - 1; y < bheight + 5 * half_window; y++) {
                                buf[y] = -MAXFLOAT;
                        }
 
-                       for(i = 0; i < (bheight + 3*half_window) / window; i++) {
+                       for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
                                int start = (i + 1) * window - 1;
 
                                temp[window - 1] = buf[start];
@@ -395,8 +395,8 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
                                        temp[window - 1 + y] = max(temp[window + y - 2], buf[start + y]);
                                }
 
-                               start = half_window + (i-1) * window + 1;
-                               for (y = -min(0, start); y < window - max(0, start+window - bheight); y++) {
+                               start = half_window + (i - 1) * window + 1;
+                               for (y = -min(0, start); y < window - max(0, start + window - bheight); y++) {
                                        rectf[bwidth * (y + start) + x] = max(temp[y], temp[y + window - 1]);
                                }
                        }
@@ -464,8 +464,8 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
 
                int half_window = this->m_iterations;
                int window = half_window * 2 + 1;
-               float *temp = (float *)MEM_mallocN((2*window - 1) * sizeof(float), "dilate erode temp");
-               float *buf = (float *)MEM_mallocN((max(bwidth, bheight) + 5*half_window) * sizeof(float), "dilate erode buf");
+               float *temp = (float *)MEM_mallocN((2 * window - 1) * sizeof(float), "dilate erode temp");
+               float *buf = (float *)MEM_mallocN((max(bwidth, bheight) + 5 * half_window) * sizeof(float), "dilate erode buf");
 
                for (y = 0; y < bheight; y++) {
                        for (x = 0; x < window - 1; x++) {
@@ -474,11 +474,11 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
                        for (x = 0; x < bwidth; x++) {
                                buf[x + window - 1] = rectf[bwidth * y + x];
                        }
-                       for (x = bwidth + window - 1; x < bwidth + 5*half_window; x++) {
+                       for (x = bwidth + window - 1; x < bwidth + 5 * half_window; x++) {
                                buf[x] = MAXFLOAT;
                        }
 
-                       for(i = 0; i < (bwidth + 3*half_window) / window; i++) {
+                       for (i = 0; i < (bwidth + 3 * half_window) / window; i++) {
                                int start = (i + 1) * window - 1;
 
                                temp[window - 1] = buf[start];
@@ -487,8 +487,8 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
                                        temp[window - 1 + x] = min(temp[window + x - 2], buf[start + x]);
                                }
 
-                               start = half_window + (i-1) * window + 1;
-                               for (x = -min(0, start); x < window - max(0, start+window - bwidth); x++) {
+                               start = half_window + (i - 1) * window + 1;
+                               for (x = -min(0, start); x < window - max(0, start + window - bwidth); x++) {
                                        rectf[bwidth * y + (start + x)] = min(temp[x], temp[x + window - 1]);
                                }
                        }
@@ -501,11 +501,11 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
                        for (y = 0; y < bheight; y++) {
                                buf[y + window - 1] = rectf[bwidth * y + x];
                        }
-                       for (y = bheight + window - 1; y < bheight + 5*half_window; y++) {
+                       for (y = bheight + window - 1; y < bheight + 5 * half_window; y++) {
                                buf[y] = MAXFLOAT;
                        }
 
-                       for(i = 0; i < (bheight + 3*half_window) / window; i++) {
+                       for (i = 0; i < (bheight + 3 * half_window) / window; i++) {
                                int start = (i + 1) * window - 1;
 
                                temp[window - 1] = buf[start];
@@ -514,8 +514,8 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
                                        temp[window - 1 + y] = min(temp[window + y - 2], buf[start + y]);
                                }
 
-                               start = half_window + (i-1) * window + 1;
-                               for (y = -min(0, start); y < window - max(0, start+window - bheight); y++) {
+                               start = half_window + (i - 1) * window + 1;
+                               for (y = -min(0, start); y < window - max(0, start + window - bheight); y++) {
                                        rectf[bwidth * (y + start) + x] = min(temp[y], temp[y + window - 1]);
                                }
                        }
index f684e57c2bca63acfbac5c65397923a5b2d9c080..ef1b73fc58fc86d710fcb64acc7ee90c6c56bf74 100644 (file)
@@ -1203,7 +1203,7 @@ static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, w
 static void MARKER_OT_select_border(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Marker Border select";
+       ot->name = "Marker Border Select";
        ot->description = "Select all time markers using border selection";
        ot->idname = "MARKER_OT_select_border";
        
@@ -1260,7 +1260,7 @@ static int ed_marker_select_all_exec(bContext *C, wmOperator *op)
 static void MARKER_OT_select_all(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "(De)select all markers";
+       ot->name = "(De)select all Markers";
        ot->description = "Change selection of all time markers";
        ot->idname = "MARKER_OT_select_all";
        
index 9add193a5143a01cca2360f08340783c6516c082..64832a1311f40b4134273c213de84a4116eb9c07 100644 (file)
@@ -52,6 +52,7 @@
 #include "DNA_material_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_object_types.h"
+#include "DNA_rigidbody_types.h"
 
 #include "BKE_animsys.h"
 #include "BKE_action.h"
@@ -550,11 +551,12 @@ enum {
  * blocktypes, when using "standard" keying but 'Visual Keying' option in Auto-Keying 
  * settings is on.
  */
-static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
+static bool visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
 {
        bConstraint *con = NULL;
        short searchtype = VISUALKEY_NONE;
-       short has_parent = FALSE;
+       bool has_rigidbody = false;
+       bool has_parent = false;
        const char *identifier = NULL;
        
        /* validate data */
@@ -569,10 +571,14 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
        if (ptr->type == &RNA_Object) {
                /* Object */
                Object *ob = (Object *)ptr->data;
+               RigidBodyOb *rbo = ob->rigidbody_object;
                
                con = ob->constraints.first;
                identifier = RNA_property_identifier(prop);
                has_parent = (ob->parent != NULL);
+               
+               /* active rigidbody objects only, as only those are affected by sim */
+               has_rigidbody = ((rbo) && (rbo->type == RBO_TYPE_ACTIVE));
        }
        else if (ptr->type == &RNA_PoseBone) {
                /* Pose Channel */
@@ -584,13 +590,13 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
        }
        
        /* check if any data to search using */
-       if (ELEM(NULL, con, identifier) && (has_parent == FALSE))
-               return 0;
+       if (ELEM(NULL, con, identifier) && (has_parent == false) && (has_rigidbody == false))
+               return false;
        
        /* location or rotation identifiers only... */
        if (identifier == NULL) {
                printf("%s failed: NULL identifier\n", __func__);
-               return 0;
+               return false;
        }
        else if (strstr(identifier, "location")) {
                searchtype = VISUALKEY_LOC;
@@ -603,15 +609,15 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
        }
        else {
                printf("%s failed: identifier - '%s'\n", __func__, identifier);
-               return 0;
+               return false;
        }
        
        
        /* only search if a searchtype and initial constraint are available */
        if (searchtype) {
-               /* parent is always matching */
-               if (has_parent)
-                       return 1;
+               /* parent or rigidbody are always matching */
+               if (has_parent || has_rigidbody)
+                       return true;
                
                /* constraints */
                for (; con; con = con->next) {
@@ -623,48 +629,48 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
                        switch (con->type) {
                                /* multi-transform constraints */
                                case CONSTRAINT_TYPE_CHILDOF:
-                                       return 1;
+                                       return true;
                                case CONSTRAINT_TYPE_TRANSFORM:
                                case CONSTRAINT_TYPE_TRANSLIKE:
-                                       return 1;
+                                       return true;
                                case CONSTRAINT_TYPE_FOLLOWPATH:
-                                       return 1;
+                                       return true;
                                case CONSTRAINT_TYPE_KINEMATIC:
-                                       return 1;
+                                       return true;
                                
                                /* single-transform constraits  */
                                case CONSTRAINT_TYPE_TRACKTO:
-                                       if (searchtype == VISUALKEY_ROT) return 1;
+                                       if (searchtype == VISUALKEY_ROT) return true;
                                        break;
                                case CONSTRAINT_TYPE_DAMPTRACK:
-                                       if (searchtype == VISUALKEY_ROT) return 1;
+                                       if (searchtype == VISUALKEY_ROT) return true;
                                        break;
                                case CONSTRAINT_TYPE_ROTLIMIT:
-                                       if (searchtype == VISUALKEY_ROT) return 1;
+                                       if (searchtype == VISUALKEY_ROT) return true;
                                        break;
                                case CONSTRAINT_TYPE_LOCLIMIT:
-                                       if (searchtype == VISUALKEY_LOC) return 1;
+                                       if (searchtype == VISUALKEY_LOC) return true;
                                        break;
                                case CONSTRAINT_TYPE_SIZELIMIT:
-                                       if (searchtype == VISUALKEY_SCA) return 1;
+                                       if (searchtype == VISUALKEY_SCA) return true;
                                        break;
                                case CONSTRAINT_TYPE_DISTLIMIT:
-                                       if (searchtype == VISUALKEY_LOC) return 1;
+                                       if (searchtype == VISUALKEY_LOC) return true;
                                        break;
                                case CONSTRAINT_TYPE_ROTLIKE:
-                                       if (searchtype == VISUALKEY_ROT) return 1;
+                                       if (searchtype == VISUALKEY_ROT) return true;
                                        break;
                                case CONSTRAINT_TYPE_LOCLIKE:
-                                       if (searchtype == VISUALKEY_LOC) return 1;
+                                       if (searchtype == VISUALKEY_LOC) return true;
                                        break;
                                case CONSTRAINT_TYPE_SIZELIKE:
-                                       if (searchtype == VISUALKEY_SCA) return 1;
+                                       if (searchtype == VISUALKEY_SCA) return true;
                                        break;
                                case CONSTRAINT_TYPE_LOCKTRACK:
-                                       if (searchtype == VISUALKEY_ROT) return 1;
+                                       if (searchtype == VISUALKEY_ROT) return true;
                                        break;
                                case CONSTRAINT_TYPE_MINMAX:
-                                       if (searchtype == VISUALKEY_LOC) return 1;
+                                       if (searchtype == VISUALKEY_LOC) return true;
                                        break;
                                
                                default:
@@ -673,8 +679,8 @@ static short visualkey_can_use(PointerRNA *ptr, PropertyRNA *prop)
                }
        }
        
-       /* when some condition is met, this function returns, so here it can be 0 */
-       return 0;
+       /* when some condition is met, this function returns, so that means we've got nothing */
+       return false;
 }
 
 /* This helper function extracts the value to use for visual-keyframing 
@@ -696,12 +702,12 @@ static float visualkey_get_value(PointerRNA *ptr, PropertyRNA *prop, int array_i
         */
        if (ptr->type == &RNA_Object) {
                Object *ob = (Object *)ptr->data;
-
+               
                /* Loc code is specific... */
                if (strstr(identifier, "location")) {
                        return ob->obmat[3][array_index];
                }
-
+               
                copy_m4_m4(tmat, ob->obmat);
                rotmode = ob->rotmode;
        }
index e9b33a6c2a6b5b51ea69e2e1b8fb79bdd55df35a..ed3088696b1132b30b34f702912f52c3c8632a1b 100644 (file)
@@ -43,6 +43,7 @@ if(WITH_BLENDER)
 
                # blends
                data_to_c_simple(../../../../release/datafiles/preview.blend SRC)
+               data_to_c_simple(../../../../release/datafiles/preview_cycles.blend SRC)
 
                # images
                data_to_c_simple(../../../../release/datafiles/splash.png SRC)
index 49888d573a0f043a8820e424369fdfed372ef126..fb1f9f37975b19e08ff40a51cff4b2c58ff2fbc4 100644 (file)
@@ -46,6 +46,7 @@ sources.extend((
 
        os.path.join(env['DATA_SOURCES'], "startup.blend.c"),
        os.path.join(env['DATA_SOURCES'], "preview.blend.c"),
+       os.path.join(env['DATA_SOURCES'], "preview_cycles.blend.c"),
        
        os.path.join(env['DATA_SOURCES'], "add.png.c"),
        os.path.join(env['DATA_SOURCES'], "blob.png.c"),
index afe23090ae34ea0588cb7f569db5a9f1058f3427..19552d6038755af70d46ac6b96c75d5e2554d297 100644 (file)
 extern int datatoc_startup_blend_size;
 extern char datatoc_startup_blend[];
 
+extern int datatoc_preview_blend_size;
+extern char datatoc_preview_blend[];
+
+extern int datatoc_preview_cycles_blend_size;
+extern char datatoc_preview_cycles_blend[];
+
 extern int datatoc_blender_icons16_png_size;
 extern char datatoc_blender_icons16_png[];
 
index 8b4b1752774ab48ad930e134bc6fcdb42c0206f3..619fb18cd7a6aee4ad88d42fce41990c7ffd3253 100644 (file)
@@ -169,7 +169,7 @@ static DrawInfo *def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs,
                                /* this code assumes square images */
                                imgsize = bbuf->x;
                                for (y = 0; y < size; y++) {
-                                       memcpy(&iimg->rect[y * size], &bbuf->rect[(y + yofs) * imgsize + xofs], imgsize * sizeof(int));
+                                       memcpy(&iimg->rect[y * size], &bbuf->rect[(y + yofs) * imgsize + xofs], size * sizeof(int));
                                }
                        }
                }
index 00c45e4158782678821282462da30b9fad71c32b..c2c1de9cbd7620f4997675affcc23da2d7060ac4 100644 (file)
@@ -247,6 +247,14 @@ Panel *uiBeginPanel(ScrArea *sa, ARegion *ar, uiBlock *block, PanelType *pt, int
                }
        }
 
+       /* Do not allow closed panels without headers! Else user could get "disappeared" UI! */
+       if ((pt->flag & PNL_NO_HEADER) && (pa->flag & PNL_CLOSED)) {
+               pa->flag &= ~PNL_CLOSED;
+               /* Force update of panels' positions! */
+               pa->sizex = 0;
+               pa->sizey = 0;
+       }
+
        BLI_strncpy(pa->drawname, drawname, UI_MAX_NAME_STR);
 
        /* if a new panel is added, we insert it right after the panel
index ec2b4f5adf056b084e35283eefa4f993992b920f..58d593919396f5985aece88ff4727e4a71e5cf9a 100644 (file)
@@ -58,6 +58,7 @@
 #include "BKE_material.h"
 #include "BKE_modifier.h"
 #include "BKE_object.h"
+#include "BKE_packedFile.h"
 #include "BKE_particle.h"
 #include "BKE_report.h"
 #include "BKE_sca.h"
@@ -546,7 +547,18 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
                        uiButSetFlag(but, UI_BUT_DISABLED);
        }
 
-       if (flag & UI_ID_OPEN) {
+       /* Due to space limit in UI - skip the "open" icon for packed data, and allow to unpack.
+          Only for images, sound and fonts */
+       if (id && BKE_pack_check(id)) {
+
+               but = uiDefIconButO(block, BUT, "FILE_OT_unpack_item", WM_OP_INVOKE_REGION_WIN, ICON_PACKAGE, 0, 0, UI_UNIT_X, UI_UNIT_Y, "Packed File");
+               uiButGetOperatorPtrRNA(but);
+               
+               RNA_string_set(but->opptr, "id_name", id->name + 2);
+               RNA_int_set(but->opptr, "id_type", GS(id->name));
+               
+       }
+       else if (flag & UI_ID_OPEN) {
                int w = id ? UI_UNIT_X : (flag & UI_ID_ADD_NEW) ? UI_UNIT_X * 3 : UI_UNIT_X * 6;
                
                if (openop) {
index e43c8a2b53b28f1f61608c88b57bca8535a4e2f3..77abe43bba79b9ea7e74eb72beab7c37e32db64d 100644 (file)
@@ -720,7 +720,7 @@ static int add_feather_vertex_invoke(bContext *C, wmOperator *op, wmEvent *event
 void MASK_OT_add_feather_vertex(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Add feather Vertex";
+       ot->name = "Add Feather Vertex";
        ot->description = "Add vertex to feather";
        ot->idname = "MASK_OT_add_feather_vertex";
 
index 99fa85b3ee78d3edd8dcebceb537468d865270dd..8d5bfe624fd41afac327bdebea505a17165495b5 100644 (file)
@@ -56,7 +56,8 @@
 #include "recast-capi.h"
 
 
-static void createVertsTrisData(bContext *C, LinkNode *obs, int *nverts_r, float **verts_r, int *ntris_r, int **tris_r)
+static void createVertsTrisData(bContext *C, LinkNode *obs,
+                                int *nverts_r, float **verts_r, int *ntris_r, int **tris_r, unsigned int *r_lay)
 {
        MVert *mvert;
        int nfaces = 0, *tri, i, curnverts, basenverts, curnfaces;
@@ -91,6 +92,8 @@ static void createVertsTrisData(bContext *C, LinkNode *obs, int *nverts_r, float
                        if (mf->v4)
                                ntris += 1;
                }
+
+               *r_lay |= ob->lay;
        }
 
        /* create data */
@@ -295,7 +298,8 @@ static bool buildNavMesh(const RecastData *recastParams, int nverts, float *vert
        return true;
 }
 
-static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh, Base *base)
+static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh, struct recast_polyMeshDetail *dmesh,
+                                  Base *base, unsigned int lay)
 {
        float co[3], rot[3];
        BMEditMesh *em;
@@ -316,7 +320,7 @@ static Object *createRepresentation(bContext *C, struct recast_polyMesh *pmesh,
 
        if (createob) {
                /* create new object */
-               obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, 1);
+               obedit = ED_object_add_type(C, OB_MESH, co, rot, FALSE, lay);
        }
        else {
                obedit = base->object;
@@ -452,15 +456,16 @@ static int navmesh_create_exec(bContext *C, wmOperator *op)
                struct recast_polyMesh *pmesh = NULL;
                struct recast_polyMeshDetail *dmesh = NULL;
                bool ok;
+               unsigned int lay = 0;
 
                int nverts = 0, ntris = 0;
                int *tris = 0;
                float *verts = NULL;
 
-               createVertsTrisData(C, obs, &nverts, &verts, &ntris, &tris);
+               createVertsTrisData(C, obs, &nverts, &verts, &ntris, &tris, &lay);
                BLI_linklist_free(obs, NULL);
                if ((ok = buildNavMesh(&scene->gm.recastData, nverts, verts, ntris, tris, &pmesh, &dmesh, op->reports))) {
-                       createRepresentation(C, pmesh, dmesh, navmeshBase);
+                       createRepresentation(C, pmesh, dmesh, navmeshBase, lay);
                }
 
                MEM_freeN(verts);
@@ -478,7 +483,7 @@ static int navmesh_create_exec(bContext *C, wmOperator *op)
 void MESH_OT_navmesh_make(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Create navigation mesh";
+       ot->name = "Create Navigation Mesh";
        ot->description = "Create navigation mesh for selected objects";
        ot->idname = "MESH_OT_navmesh_make";
 
index 5e5e38c3e43e1738d9fa55091195a6e6179e52b4..4807e7364ea936c5e13b80f8e8dd7b1542bce1ae 100644 (file)
@@ -1864,9 +1864,7 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
                        ob_iter->max_vel = ob->max_vel;
                        ob_iter->obstacleRad = ob->obstacleRad;
                        ob_iter->mass = ob->mass;
-                       ob_iter->anisotropicFriction[0] = ob->anisotropicFriction[0];
-                       ob_iter->anisotropicFriction[1] = ob->anisotropicFriction[1];
-                       ob_iter->anisotropicFriction[2] = ob->anisotropicFriction[2];
+                       copy_v3_v3(ob_iter->anisotropicFriction, ob->anisotropicFriction);
                        ob_iter->collision_boundtype = ob->collision_boundtype;
                        ob_iter->margin = ob->margin;
                        ob_iter->bsoft = copy_bulletsoftbody(ob->bsoft);
@@ -1874,6 +1872,9 @@ static int game_physics_copy_exec(bContext *C, wmOperator *UNUSED(op))
                                ob_iter->restrictflag |= OB_RESTRICT_RENDER;
                        else
                                ob_iter->restrictflag &= ~OB_RESTRICT_RENDER;
+
+                       ob_iter->col_group = ob->col_group;
+                       ob_iter->col_mask = ob->col_mask;
                }
        }
        CTX_DATA_END;
index 5c65e543cc9aa7ee207279ecccfec0c3f1e4827a..d26ea89bd1e25fd2a2bb0b60c119679fa5eb49b2 100644 (file)
@@ -399,7 +399,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        RNA_enum_set(kmi->ptr, "type", 0); /* active */
        kmi = WM_keymap_add_item(keymap, "RIGIDBODY_OT_objects_add", RKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
        RNA_enum_set(kmi->ptr, "type", 1); /* passive */
-       kmi = WM_keymap_add_item(keymap, "RIGIDBODY_OT_objects_remove", RKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
+       WM_keymap_add_item(keymap, "RIGIDBODY_OT_objects_remove", RKEY, KM_PRESS, KM_CTRL | KM_ALT, 0);
 
        WM_keymap_add_menu(keymap, "VIEW3D_MT_object_specials", WKEY, KM_PRESS, 0, 0);
 
index 9749494bc661496d8937b676353ffff263be7934..da12db50cc5af50e6e9b741259720707f1017b30 100644 (file)
@@ -1069,7 +1069,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
 void OBJECT_OT_track_clear(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Clear track";
+       ot->name = "Clear Track";
        ot->description = "Clear tracking constraint or flag from object";
        ot->idname = "OBJECT_OT_track_clear";
        
index fc1e24840a41c9c7afecb3abd2a3f5c1cbd310a6..38ed903a161f0bf3d30b32fdc68b31163fabb77b 100644 (file)
@@ -615,8 +615,7 @@ void RIGIDBODY_OT_mass_calculate(wmOperatorType *ot)
        ot->prop = prop = RNA_def_enum(ot->srna, "material",
                                       DummyRNA_DEFAULT_items, 0,
                                       "Material Preset",
-                                      "Type of material that objects are made of. "
-                                      "Determines material density");
+                                      "Type of material that objects are made of (determines material density)");
        RNA_def_enum_funcs(prop, rigidbody_materials_itemf);
 
        RNA_def_float(ot->srna, "density", 1.0, FLT_MIN, FLT_MAX,
index 25ad1f61aafa21b89b473f6015325a9b6786684c..16ebaf58a596768309b5c14f823c8a78c62becfb 100644 (file)
@@ -97,6 +97,7 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+#include "ED_datafiles.h"
 #include "ED_render.h"
 #include "ED_view3d.h"
 
@@ -168,7 +169,8 @@ typedef struct ShaderPreview {
        int sizex, sizey;
        unsigned int *pr_rect;
        int pr_method;
-       
+
+       Main *pr_main;
 } ShaderPreview;
 
 typedef struct IconPreviewSize {
@@ -187,23 +189,33 @@ typedef struct IconPreview {
 /* *************************** Preview for buttons *********************** */
 
 static Main *pr_main = NULL;
+static Main *pr_main_cycles = NULL;
 
-void ED_preview_init_dbase(void)
-{
 #ifndef WITH_HEADLESS
-       BlendFileData *bfd;
-       extern int datatoc_preview_blend_size;
-       extern char datatoc_preview_blend[];
+static Main *load_main_from_memory(char *blend, int blend_size)
+{
        const int fileflags = G.fileflags;
-       
+       Main *bmain = NULL;
+       BlendFileData *bfd;
+
        G.fileflags |= G_FILE_NO_UI;
-       bfd = BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL);
+       bfd = BLO_read_from_memory(blend, blend_size, NULL);
        if (bfd) {
-               pr_main = bfd->main;
-               
+               bmain = bfd->main;
+
                MEM_freeN(bfd);
        }
        G.fileflags = fileflags;
+
+       return bmain;
+}
+#endif
+
+void ED_preview_init_dbase(void)
+{
+#ifndef WITH_HEADLESS
+       pr_main = load_main_from_memory(datatoc_preview_blend, datatoc_preview_blend_size);
+       pr_main_cycles = load_main_from_memory(datatoc_preview_cycles_blend, datatoc_preview_cycles_blend_size);
 #endif
 }
 
@@ -211,6 +223,9 @@ void ED_preview_free_dbase(void)
 {
        if (pr_main)
                free_main(pr_main);
+
+       if (pr_main_cycles)
+               free_main(pr_main_cycles);
 }
 
 static int preview_mat_has_sss(Material *mat, bNodeTree *ntree)
@@ -239,7 +254,7 @@ static int preview_mat_has_sss(Material *mat, bNodeTree *ntree)
        return 0;
 }
 
-static Scene *preview_get_scene(void)
+static Scene *preview_get_scene(Main *pr_main)
 {
        if (pr_main == NULL) return NULL;
        
@@ -253,8 +268,9 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
 {
        Scene *sce;
        Base *base;
+       Main *pr_main = sp->pr_main;
        
-       sce = preview_get_scene();
+       sce = preview_get_scene(pr_main);
        if (sce) {
                
                /* this flag tells render to not execute depsgraph or ipos etc */
@@ -299,45 +315,47 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
                                sp->matcopy = mat;
                                BLI_addtail(&pr_main->mat, mat);
                                
-                               init_render_material(mat, 0, NULL);     /* call that retrieves mode_l */
-                               end_render_material(mat);
-                               
-                               /* un-useful option */
-                               if (sp->pr_method == PR_ICON_RENDER)
-                                       mat->shade_flag &= ~MA_OBCOLOR;
-
-                               /* turn on raytracing if needed */
-                               if (mat->mode_l & MA_RAYMIRROR)
-                                       sce->r.mode |= R_RAYTRACE;
-                               if (mat->material_type == MA_TYPE_VOLUME)
-                                       sce->r.mode |= R_RAYTRACE;
-                               if ((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
-                                       sce->r.mode |= R_RAYTRACE;
-                               if (preview_mat_has_sss(mat, NULL))
-                                       sce->r.mode |= R_SSS;
-                               
-                               /* turn off fake shadows if needed */
-                               /* this only works in a specific case where the preview.blend contains
-                                * an object starting with 'c' which has a material linked to it (not the obdata)
-                                * and that material has a fake shadow texture in the active texture slot */
-                               for (base = sce->base.first; base; base = base->next) {
-                                       if (base->object->id.name[2] == 'c') {
-                                               Material *shadmat = give_current_material(base->object, base->object->actcol);
-                                               if (shadmat) {
-                                                       if (mat->mode & MA_SHADBUF) shadmat->septex = 0;
-                                                       else shadmat->septex |= 1;
+                               if (!BKE_scene_use_new_shading_nodes(scene)) {
+                                       init_render_material(mat, 0, NULL);     /* call that retrieves mode_l */
+                                       end_render_material(mat);
+                                       
+                                       /* un-useful option */
+                                       if (sp->pr_method == PR_ICON_RENDER)
+                                               mat->shade_flag &= ~MA_OBCOLOR;
+
+                                       /* turn on raytracing if needed */
+                                       if (mat->mode_l & MA_RAYMIRROR)
+                                               sce->r.mode |= R_RAYTRACE;
+                                       if (mat->material_type == MA_TYPE_VOLUME)
+                                               sce->r.mode |= R_RAYTRACE;
+                                       if ((mat->mode_l & MA_RAYTRANSP) && (mat->mode_l & MA_TRANSP))
+                                               sce->r.mode |= R_RAYTRACE;
+                                       if (preview_mat_has_sss(mat, NULL))
+                                               sce->r.mode |= R_SSS;
+                                       
+                                       /* turn off fake shadows if needed */
+                                       /* this only works in a specific case where the preview.blend contains
+                                        * an object starting with 'c' which has a material linked to it (not the obdata)
+                                        * and that material has a fake shadow texture in the active texture slot */
+                                       for (base = sce->base.first; base; base = base->next) {
+                                               if (base->object->id.name[2] == 'c') {
+                                                       Material *shadmat = give_current_material(base->object, base->object->actcol);
+                                                       if (shadmat) {
+                                                               if (mat->mode & MA_SHADBUF) shadmat->septex = 0;
+                                                               else shadmat->septex |= 1;
+                                                       }
                                                }
                                        }
-                               }
-                               
-                               /* turn off bounce lights for volume, 
-                                * doesn't make much visual difference and slows it down too */
-                               if (mat->material_type == MA_TYPE_VOLUME) {
-                                       for (base = sce->base.first; base; base = base->next) {
-                                               if (base->object->type == OB_LAMP) {
-                                                       /* if doesn't match 'Lamp.002' --> main key light */
-                                                       if (strcmp(base->object->id.name + 2, "Lamp.002") != 0) {
-                                                               base->object->restrictflag |= OB_RESTRICT_RENDER;
+                                       
+                                       /* turn off bounce lights for volume, 
+                                        * doesn't make much visual difference and slows it down too */
+                                       if (mat->material_type == MA_TYPE_VOLUME) {
+                                               for (base = sce->base.first; base; base = base->next) {
+                                                       if (base->object->type == OB_LAMP) {
+                                                               /* if doesn't match 'Lamp.002' --> main key light */
+                                                               if (strcmp(base->object->id.name + 2, "Lamp.002") != 0) {
+                                                                       base->object->restrictflag |= OB_RESTRICT_RENDER;
+                                                               }
                                                        }
                                                }
                                        }
@@ -432,19 +450,21 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
                                sp->lampcopy = la;
                                BLI_addtail(&pr_main->lamp, la);
                        }
-                       
-                       if (la && la->type == LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) {
-                               sce->lay = 1 << MA_ATMOS;
-                               sce->world = scene->world;
-                               sce->camera = (Object *)BLI_findstring(&pr_main->object, "CameraAtmo", offsetof(ID, name) + 2);
-                       }
-                       else {
-                               sce->lay = 1 << MA_LAMP;
-                               sce->world = NULL;
-                               sce->camera = (Object *)BLI_findstring(&pr_main->object, "Camera", offsetof(ID, name) + 2);
+
+                       sce->lay = 1 << MA_LAMP;
+
+                       if (!BKE_scene_use_new_shading_nodes(scene)) {
+                               if (la && la->type == LA_SUN && (la->sun_effect_type & LA_SUN_EFFECT_SKY)) {
+                                       sce->lay = 1 << MA_ATMOS;
+                                       sce->world = scene->world;
+                                       sce->camera = (Object *)BLI_findstring(&pr_main->object, "CameraAtmo", offsetof(ID, name) + 2);
+                               }
+                               else {
+                                       sce->world = NULL;
+                                       sce->camera = (Object *)BLI_findstring(&pr_main->object, "Camera", offsetof(ID, name) + 2);
+                               }
                        }
-                       sce->r.mode &= ~R_SHADOW;
-                       
+                               
                        for (base = sce->base.first; base; base = base->next) {
                                if (base->object->id.name[2] == 'p') {
                                        if (base->object->type == OB_LAMP)
@@ -639,6 +659,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
        short idtype = GS(id->name);
        char name[32];
        int sizex;
+       Main *pr_main = sp->pr_main;
        
        /* in case of split preview, use border render */
        if (split) {
@@ -648,7 +669,7 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs
        else sizex = sp->sizex;
        
        /* we have to set preview variables first */
-       sce = preview_get_scene();
+       sce = preview_get_scene(pr_main);
        if (sce) {
                sce->r.xsch = sizex;
                sce->r.ysch = sp->sizey;
@@ -749,6 +770,7 @@ static void shader_preview_startjob(void *customdata, short *stop, short *do_upd
 static void shader_preview_free(void *customdata)
 {
        ShaderPreview *sp = customdata;
+       Main *pr_main = sp->pr_main;
        
        if (sp->matcopy) {
                struct IDProperty *properties;
@@ -1076,13 +1098,14 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
        Object *ob = CTX_data_active_object(C);
        wmJob *wm_job;
        ShaderPreview *sp;
+       Scene *scene = CTX_data_scene(C);
 
        wm_job = WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Shader Preview",
                            WM_JOB_EXCL_RENDER, WM_JOB_TYPE_RENDER_PREVIEW);
        sp = MEM_callocN(sizeof(ShaderPreview), "shader preview");
 
        /* customdata for preview thread */
-       sp->scene = CTX_data_scene(C);
+       sp->scene = scene;
        sp->owner = owner;
        sp->sizex = sizex;
        sp->sizey = sizey;
@@ -1090,6 +1113,14 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M
        sp->id = id;
        sp->parent = parent;
        sp->slot = slot;
+
+       /* hardcoded preview .blend for cycles/internal, this should be solved
+        * once with custom preview .blend path for external engines */
+       if (BKE_scene_use_new_shading_nodes(scene))
+               sp->pr_main = pr_main_cycles;
+       else
+               sp->pr_main = pr_main;
+
        if (ob && ob->totcol) copy_v4_v4(sp->col, ob->col);
        else sp->col[0] = sp->col[1] = sp->col[2] = sp->col[3] = 1.0f;
        
index a22faea9eeca76a7a60c0d3e0042f1497e27f591..e7f5e57552c6bac9c8c294181221e3b089491a8c 100644 (file)
@@ -729,7 +729,7 @@ static int actionzone_cancel(bContext *UNUSED(C), wmOperator *op)
 static void SCREEN_OT_actionzone(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Handle area action zones";
+       ot->name = "Handle Area Action Zones";
        ot->description = "Handle area action zones for mouse actions/gestures";
        ot->idname = "SCREEN_OT_actionzone";
        
@@ -851,7 +851,7 @@ static int area_swap_modal(bContext *C, wmOperator *op, wmEvent *event)
 
 static void SCREEN_OT_area_swap(wmOperatorType *ot)
 {
-       ot->name = "Swap areas";
+       ot->name = "Swap Areas";
        ot->description = "Swap selected areas screen positions";
        ot->idname = "SCREEN_OT_area_swap";
        
@@ -1169,7 +1169,7 @@ static int area_move_modal(bContext *C, wmOperator *op, wmEvent *event)
 static void SCREEN_OT_area_move(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Move area edges";
+       ot->name = "Move Area Edges";
        ot->description = "Move selected area edges";
        ot->idname = "SCREEN_OT_area_move";
        
@@ -2568,7 +2568,7 @@ static int spacedata_cleanup(bContext *C, wmOperator *op)
 static void SCREEN_OT_spacedata_cleanup(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Clean-up space-data";
+       ot->name = "Clean-up Space-data";
        ot->description = "Remove unused settings for invisible editors";
        ot->idname = "SCREEN_OT_spacedata_cleanup";
        
@@ -3368,7 +3368,7 @@ static int border_select_do(bContext *C, wmOperator *op)
 static void SCREEN_OT_border_select(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Border select";
+       ot->name = "Border Select";
        ot->idname = "SCREEN_OT_border_select";
        
        /* api callbacks */
index 1763e62582ab3f025b02c54bfb094d469243aa97..efd0db3b442e0be0782c45f826d6d7762934fa23 100644 (file)
@@ -272,7 +272,7 @@ void SCREEN_OT_screenshot(wmOperatorType *ot)
        
        WM_operator_properties_filesel(ot, FOLDERFILE | IMAGEFILE, FILE_SPECIAL, FILE_SAVE,
                                       WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY);
-       RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Screenshot the whole Blender window");
+       RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Capture the whole window. Otherwise only capture the active area");
 }
 
 /* *************** screenshot movie job ************************* */
@@ -500,5 +500,5 @@ void SCREEN_OT_screencast(wmOperatorType *ot)
        ot->flag = 0;
        
        RNA_def_property(ot->srna, "filepath", PROP_STRING, PROP_FILEPATH);
-       RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Screencast the whole Blender window");
+       RNA_def_boolean(ot->srna, "full", 1, "Full Screen", "Capture the whole window. Otherwise only capture the active area");
 }
index aaa1328f9f6afae19ac1ed5cb3a42d8b0e90ba2c..eb138bfeeef975a29f648ebb21c6aa8bf9c9e30d 100644 (file)
@@ -264,7 +264,7 @@ static void SOUND_OT_update_animation_flags(wmOperatorType *ot)
         */
 
        /* identifiers */
-       ot->name = "Update animation";
+       ot->name = "Update Animation";
        ot->description = "Update animation flags";
        ot->idname = "SOUND_OT_update_animation_flags";
 
@@ -300,7 +300,7 @@ static int sound_bake_animation_exec(bContext *C, wmOperator *UNUSED(op))
 static void SOUND_OT_bake_animation(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Update animation cache";
+       ot->name = "Update Animation Cache";
        ot->description = "Update the audio animation cache";
        ot->idname = "SOUND_OT_bake_animation";
 
index 26bae6e39781060c0c5a2fb13b50e22260354cdb..cf4e76a842708fbf0b94ff69909c8c1ea8fe0aec 100644 (file)
@@ -908,7 +908,7 @@ static int change_frame_modal(bContext *C, wmOperator *op, wmEvent *event)
 void CLIP_OT_change_frame(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Change frame";
+       ot->name = "Change Frame";
        ot->idname = "CLIP_OT_change_frame";
        ot->description = "Interactively change the current frame number";
 
index 62e9a3a7f73d638ef131a7294270e2a8f9566fd1..b5426fe15e1b1801f351804a88657f2869c34f55 100644 (file)
@@ -39,6 +39,7 @@ struct ReportList;
 
 void FILE_OT_pack_all(struct wmOperatorType *ot);
 void FILE_OT_unpack_all(struct wmOperatorType *ot);
+void FILE_OT_unpack_item(struct wmOperatorType *ot);
 void FILE_OT_pack_libraries(struct wmOperatorType *ot);
 void FILE_OT_unpack_libraries(struct wmOperatorType *ot);
 
index 104349e172a482da0e135a2b8de9f2d9eed23e01..663d136fdf2b16f6d6d1e19e9e15fd52bda89e1a 100644 (file)
 #include "BKE_context.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
+#include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_packedFile.h"
 #include "BKE_report.h"
+#include "BKE_screen.h"
 
 
 #include "WM_api.h"
@@ -249,6 +251,78 @@ void FILE_OT_unpack_all(wmOperatorType *ot)
        RNA_def_enum(ot->srna, "method", unpack_all_method_items, PF_USE_LOCAL, "Method", "How to unpack");
 }
 
+/********************* unpack single item operator *********************/
+
+static const EnumPropertyItem unpack_item_method_items[] = {
+       {PF_USE_LOCAL, "USE_LOCAL", 0, "Use file from current directory (create when necessary)", ""},
+       {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write file to current directory (overwrite existing file)", ""},
+       {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use file in original location (create when necessary)", ""},
+       {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write file to original location (overwrite existing file)", ""},
+       /* {PF_ASK, "ASK", 0, "Ask for each file", ""}, */
+       {0, NULL, 0, NULL, NULL}};
+
+
+static int unpack_item_exec(bContext *C, wmOperator *op)
+{
+       Main *bmain = CTX_data_main(C);
+       ID *id;
+       char idname[BKE_ST_MAXNAME];
+       int type = RNA_int_get(op->ptr, "id_type");
+       int method = RNA_enum_get(op->ptr, "method");
+       
+       RNA_string_get(op->ptr, "id_name", idname);
+       id = BKE_libblock_find_name(type, idname);
+
+       if (id == NULL) {
+               BKE_report(op->reports, RPT_WARNING, "No packed file");
+               return OPERATOR_CANCELLED;
+       }
+       
+       if (method != PF_KEEP)
+               BKE_unpack_id(bmain, id, op->reports, method);  /* XXX PF_ASK can't work here */
+       
+       G.fileflags &= ~G_AUTOPACK;
+       
+       return OPERATOR_FINISHED;
+}
+
+static int unpack_item_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+{
+       uiPopupMenu *pup;
+       uiLayout *layout;
+       
+       pup = uiPupMenuBegin(C, "Unpack", ICON_NONE);
+       layout = uiPupMenuLayout(pup);
+       
+       uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT);
+       uiItemsFullEnumO(layout, op->type->idname, "method", op->ptr->data, WM_OP_EXEC_REGION_WIN, 0);
+       
+       uiPupMenuEnd(C, pup);
+       
+       return OPERATOR_CANCELLED;
+}
+
+void FILE_OT_unpack_item(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name = "Unpack Item";
+       ot->idname = "FILE_OT_unpack_item";
+       ot->description = "Unpack this file to an external file";
+       
+       /* api callbacks */
+       ot->exec = unpack_item_exec;
+       ot->invoke = unpack_item_invoke;
+       
+       /* flags */
+       ot->flag = OPTYPE_UNDO;
+       
+       /* properties */
+       RNA_def_enum(ot->srna, "method", unpack_item_method_items, PF_USE_LOCAL, "Method", "How to unpack");
+       RNA_def_string(ot->srna, "id_name", "", BKE_ST_MAXNAME, "ID name", "Name of ID block to unpack");
+       RNA_def_int(ot->srna, "id_type", 0, 0, INT_MAX, "ID Type", "Identifier type of ID block", 0, INT_MAX);
+}
+
+
 /********************* make paths relative operator *********************/
 
 static int make_paths_relative_exec(bContext *C, wmOperator *op)
index 023ffa502729def7a61756a85623b5948709c2cc..3050563e538578a44679af204fc664259d4f285e 100644 (file)
@@ -148,7 +148,7 @@ static int select_report_pick_invoke(bContext *C, wmOperator *op, wmEvent *event
 void INFO_OT_select_pick(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Select report";
+       ot->name = "Select Report";
        ot->description = "Select reports by index";
        ot->idname = "INFO_OT_select_pick";
 
index 60b04f7b029957dc44b0bbd916683f6cefe5f9f8..1577ac338e762606c7ee04cb56dcd942f3853104 100644 (file)
@@ -180,6 +180,7 @@ static void info_operatortypes(void)
        WM_operatortype_append(FILE_OT_pack_all);
        WM_operatortype_append(FILE_OT_pack_libraries);
        WM_operatortype_append(FILE_OT_unpack_all);
+       WM_operatortype_append(FILE_OT_unpack_item);
        WM_operatortype_append(FILE_OT_unpack_libraries);
        
        WM_operatortype_append(FILE_OT_make_paths_relative);
index e898a1baf743219abf3cbb35064255582f6ae68e..a55da0e3b2cf7bfb38a2a6f6eef0733e3a49e24f 100644 (file)
@@ -145,7 +145,7 @@ void LOGIC_OT_links_cut(wmOperatorType *ot)
 {
        PropertyRNA *prop;
        
-       ot->name = "Cut links";
+       ot->name = "Cut Links";
        ot->idname = "LOGIC_OT_links_cut";
        ot->description = "Remove logic brick connections";
        
index f28757bb431fcd1d32149b4a55a8c247dda7d047..2313885dbaf8376e41185d8cce91b5f6ecbeaa5d 100644 (file)
@@ -330,8 +330,10 @@ static void LOGIC_OT_sensor_add(wmOperatorType *ot)
        /* properties */
        ot->prop = 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);
-       RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
-       RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
+       prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Sensor to add");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+       prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Sensor to");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Add/Remove Controller Operator ************* */
@@ -423,16 +425,14 @@ static int controller_add_exec(bContext *C, wmOperator *op)
        ob->scaflag |= OB_SHOWCONT;
        
        WM_event_add_notifier(C, NC_LOGIC, NULL);
-
-       /* prevent the operator to get stuck with the "object" of the previous call -
-        * it only happens when it's called from the "smart controller", see bug #54102 */
-       RNA_string_set(op->ptr, "object", "");  
        
        return OPERATOR_FINISHED;
 }
 
 static void LOGIC_OT_controller_add(wmOperatorType *ot)
 {
+       PropertyRNA *prop;
+
        /* identifiers */
        ot->name = "Add Controller";
        ot->description = "Add a controller to the active object";
@@ -448,8 +448,10 @@ static void LOGIC_OT_controller_add(wmOperatorType *ot)
        
        /* properties */
        ot->prop = RNA_def_enum(ot->srna, "type", controller_type_items, CONT_LOGIC_AND, "Type", "Type of controller to add");
-       RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
-       RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
+       prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Controller to add");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+       prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Controller to");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Add/Remove Actuator Operator ************* */
@@ -551,8 +553,10 @@ static void LOGIC_OT_actuator_add(wmOperatorType *ot)
        /* properties */
        ot->prop = 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);
-       RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
-       RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
+       prop = RNA_def_string(ot->srna, "name", "", MAX_NAME, "Name", "Name of the Actuator to add");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+       prop = RNA_def_string(ot->srna, "object", "", MAX_NAME, "Object", "Name of the Object to add the Actuator to");
+       RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
 
 /* ************* Move Logic Bricks Operator ************* */
index 18ce2c81716d4232605f450c70d4b8ea1c3ea866..b47be150417afea835bb15684c565604d62b176a 100644 (file)
@@ -305,7 +305,7 @@ void NODE_OT_add_reroute(wmOperatorType *ot)
 {
        PropertyRNA *prop;
 
-       ot->name = "Add reroute";
+       ot->name = "Add Reroute";
        ot->idname = "NODE_OT_add_reroute";
 
        ot->invoke = WM_gesture_lines_invoke;
index 2fae92d674c48beadc1958e87be42c862aa2312d..321eaa32e80a3146a7afdd852a553c321d8edffe 100644 (file)
@@ -1749,7 +1749,7 @@ static int node_delete_reconnect_exec(bContext *C, wmOperator *UNUSED(op))
 void NODE_OT_delete_reconnect(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Delete with reconnect";
+       ot->name = "Delete with Reconnect";
        ot->description = "Delete nodes; will reconnect nodes as if deletion was muted";
        ot->idname = "NODE_OT_delete_reconnect";
 
@@ -2031,7 +2031,7 @@ static int node_clipboard_copy_exec(bContext *C, wmOperator *UNUSED(op))
 void NODE_OT_clipboard_copy(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Copy to clipboard";
+       ot->name = "Copy to Clipboard";
        ot->description = "Copies selected nodes to the clipboard";
        ot->idname = "NODE_OT_clipboard_copy";
 
@@ -2152,7 +2152,7 @@ static int node_clipboard_paste_invoke(bContext *C, wmOperator *op, wmEvent *eve
 void NODE_OT_clipboard_paste(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Paste from clipboard";
+       ot->name = "Paste from Clipboard";
        ot->description = "Pastes nodes from the clipboard to the active node tree";
        ot->idname = "NODE_OT_clipboard_paste";
 
index 7fa48c48ad656f1cf68f4cce0fa62e3f08b349d3..8d7eef22822534d67707322069c3d9d8dddac53b 100644 (file)
@@ -876,7 +876,7 @@ void NODE_OT_links_cut(wmOperatorType *ot)
 {
        PropertyRNA *prop;
 
-       ot->name = "Cut links";
+       ot->name = "Cut Links";
        ot->idname = "NODE_OT_links_cut";
        ot->description = "Use the mouse to cut (remove) some links";
 
index 4e6783e1862a5d2c45e0e415a3db2a174350204d..96008004ee447aa11f4796df4c4bd4c07e06679f 100644 (file)
@@ -71,7 +71,7 @@ static int run_pyfile_exec(bContext *C, wmOperator *op)
 void SCRIPT_OT_python_file_run(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Run python file";
+       ot->name = "Run Python File";
        ot->description = "Run Python file";
        ot->idname = "SCRIPT_OT_python_file_run";
        ot->flag = OPTYPE_UNDO;
index c6c70ccb424220a569e7f8dbf7214b3d45e2aeae..155280938696a9324697b4654146152e195e1a34 100644 (file)
@@ -1124,7 +1124,7 @@ static int sequencer_snap_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(ev
 void SEQUENCER_OT_snap(struct wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Snap strips";
+       ot->name = "Snap Strips";
        ot->idname = "SEQUENCER_OT_snap";
        ot->description = "Frame where selected strips will be snapped";
        
index 192f45ac9182eae3a21f64b304cdb7a71c58cded..0d1ecb76d0e8f708a9622e217e1e515bd1f5061c 100644 (file)
@@ -704,7 +704,7 @@ static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEv
 void SEQUENCER_OT_select_linked_pick(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Select pick linked";
+       ot->name = "Select Pick Linked";
        ot->idname = "SEQUENCER_OT_select_linked_pick";
        ot->description = "Select a chain of linked strips nearest to the mouse pointer";
        
@@ -739,7 +739,7 @@ static int sequencer_select_linked_exec(bContext *C, wmOperator *UNUSED(op))
 void SEQUENCER_OT_select_linked(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Select linked";
+       ot->name = "Select Linked";
        ot->idname = "SEQUENCER_OT_select_linked";
        ot->description = "Select all strips adjacent to the current selection";
        
index a1e132c66013a0a90226500e23be09446b5dd175..562d1ec4b644e0003beb67799811631e9a07a96f 100644 (file)
@@ -972,7 +972,7 @@ static int viewrotate_cancel(bContext *C, wmOperator *op)
 void VIEW3D_OT_rotate(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Rotate view";
+       ot->name = "Rotate View";
        ot->description = "Rotate the view";
        ot->idname = "VIEW3D_OT_rotate";
 
@@ -1330,7 +1330,7 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void VIEW3D_OT_ndof_orbit_zoom(struct wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "NDOF Orbit View with zoom";
+       ot->name = "NDOF Orbit View with Zoom";
        ot->description = "Explore every angle of an object using the 3D mouse";
        ot->idname = "VIEW3D_OT_ndof_orbit_zoom";
 
@@ -1590,7 +1590,7 @@ static int ndof_all_invoke(bContext *C, wmOperator *op, wmEvent *event)
 void VIEW3D_OT_ndof_all(struct wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "NDOF move View";
+       ot->name = "NDOF Move View";
        ot->description = "Position your viewpoint with the 3D mouse";
        ot->idname = "VIEW3D_OT_ndof_all";
 
@@ -1753,7 +1753,7 @@ void VIEW3D_OT_move(wmOperatorType *ot)
 {
 
        /* identifiers */
-       ot->name = "Move view";
+       ot->name = "Move View";
        ot->description = "Move the view";
        ot->idname = "VIEW3D_OT_move";
 
@@ -2375,7 +2375,7 @@ static int viewdolly_cancel(bContext *C, wmOperator *op)
 void VIEW3D_OT_dolly(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Dolly view";
+       ot->name = "Dolly View";
        ot->description = "Dolly in/out in the view";
        ot->idname = "VIEW3D_OT_dolly";
 
@@ -3457,7 +3457,7 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
        PropertyRNA *prop;
 
        /* identifiers */
-       ot->name = "View numpad";
+       ot->name = "View Numpad";
        ot->description = "Use a preset viewpoint";
        ot->idname = "VIEW3D_OT_viewnumpad";
 
index d29326db6b0b5b1f63c013359a9c35953d9b8318..c4960de1e195d011e184c060713673b72f90194a 100644 (file)
@@ -2336,7 +2336,7 @@ static void constraintTransLim(TransInfo *t, TransData *td)
                        ListBase targets = {NULL, NULL};
                        
                        /* only consider constraint if enabled */
-                       if (con->flag & CONSTRAINT_DISABLE) continue;
+                       if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) continue;
                        if (con->enforce == 0.0f) continue;
                        
                        /* only use it if it's tagged for this purpose (and the right type) */
@@ -2427,7 +2427,7 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td)
                /* Evaluate valid constraints */
                for (con = td->con; con; con = con->next) {
                        /* only consider constraint if enabled */
-                       if (con->flag & CONSTRAINT_DISABLE) continue;
+                       if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) continue;
                        if (con->enforce == 0.0f) continue;
 
                        /* we're only interested in Limit-Rotation constraints */
@@ -2517,7 +2517,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td)
                /* Evaluate valid constraints */
                for (con = td->con; con; con = con->next) {
                        /* only consider constraint if enabled */
-                       if (con->flag & CONSTRAINT_DISABLE) continue;
+                       if (con->flag & (CONSTRAINT_DISABLE | CONSTRAINT_OFF)) continue;
                        if (con->enforce == 0.0f) continue;
                        
                        /* we're only interested in Limit-Scale constraints */
@@ -4872,70 +4872,102 @@ int BoneEnvelope(TransInfo *t, const int UNUSED(mval[2]))
 static BMEdge *get_other_edge(BMVert *v, BMEdge *e)
 {
        BMIter iter;
-       BMEdge *e2;
+       BMEdge *e_iter;
 
-       BM_ITER_ELEM (e2, &iter, v, BM_EDGES_OF_VERT) {
-               if (BM_elem_flag_test(e2, BM_ELEM_SELECT) && e2 != e)
-                       return e2;
+       BM_ITER_ELEM (e_iter, &iter, v, BM_EDGES_OF_VERT) {
+               if (BM_elem_flag_test(e_iter, BM_ELEM_SELECT) && e_iter != e) {
+                       return e_iter;
+               }
        }
 
        return NULL;
 }
 
+static void len_v3_ensure(float v[3], const float length)
+{
+       normalize_v3(v);
+       mul_v3_fl(v, length);
+}
+
+/**
+ * Given 2 edges and a loop, step over the loops
+ * and calculate a direction to slide along.
+ *
+ * \param r_slide_vec the direction to slide,
+ * the length of the vector defines the slide distance.
+ */
 static BMLoop *get_next_loop(BMVert *v, BMLoop *l,
-                             BMEdge *olde, BMEdge *nexte, float vec[3])
+                             BMEdge *e_prev, BMEdge *e_next, float r_slide_vec[3])
 {
-       BMLoop *firstl;
-       float a[3] = {0.0f, 0.0f, 0.0f}, n[3] = {0.0f, 0.0f, 0.0f};
+       BMLoop *l_first;
+       float vec_accum[3] = {0.0f, 0.0f, 0.0f};
+       float vec_accum_len = 0.0f;
        int i = 0;
 
-       firstl = l;
+       BLI_assert(BM_edge_share_vert(e_prev, e_next) == v);
+
+       l_first = l;
        do {
                l = BM_face_other_edge_loop(l->f, l->e, v);
                if (l->radial_next == l)
                        return NULL;
                
-               if (l->e == nexte) {
+               if (l->e == e_next) {
                        if (i) {
-                               mul_v3_fl(a, 1.0f / (float)i);
+                               len_v3_ensure(vec_accum, vec_accum_len / (float)i);
                        }
                        else {
-                               float f1[3], f2[3], f3[3];
+                               /* When there is no edge to slide along,
+                                * we must slide along the vector defined by the face we're attach to */
+                               float e_dir_prev[3], e_dir_next[3], tvec[3];
 
-                               sub_v3_v3v3(f1, BM_edge_other_vert(olde, v)->co, v->co);
-                               sub_v3_v3v3(f2, BM_edge_other_vert(nexte, v)->co, v->co);
+                               sub_v3_v3v3(e_dir_prev, BM_edge_other_vert(e_prev, v)->co, v->co);
+                               sub_v3_v3v3(e_dir_next, BM_edge_other_vert(e_next, v)->co, v->co);
 
-                               cross_v3_v3v3(f3, f1, l->f->no);
-                               cross_v3_v3v3(a, f2, l->f->no);
-                               mul_v3_fl(a, -1.0f);
+                               cross_v3_v3v3(tvec, l->f->no, e_dir_prev);
+                               cross_v3_v3v3(vec_accum, e_dir_next, l->f->no);
 
-                               mid_v3_v3v3(a, a, f3);
+                               mid_v3_v3v3(vec_accum, vec_accum, tvec);
+
+                               /* check if we need to flip
+                                * (compare the normal defines by the edges with the face normal) */
+                               cross_v3_v3v3(tvec, e_dir_prev, e_dir_next);
+                               if (dot_v3v3(tvec, l->f->no) > 0.0f) {
+                                       negate_v3(vec_accum);
+                               }
                        }
-                       
-                       copy_v3_v3(vec, a);
+
+                       copy_v3_v3(r_slide_vec, vec_accum);
                        return l;
                }
                else {
-                       sub_v3_v3v3(n, BM_edge_other_vert(l->e, v)->co, v->co);
-                       add_v3_v3v3(a, a, n);
+                       /* accumulate the normalized edge vector,
+                        * normalize so some edges don't skew the result */
+                       float tvec[3];
+                       sub_v3_v3v3(tvec, BM_edge_other_vert(l->e, v)->co, v->co);
+                       vec_accum_len += normalize_v3(tvec);
+                       add_v3_v3(vec_accum, tvec);
                        i += 1;
                }
 
-               if (BM_face_other_edge_loop(l->f, l->e, v)->e == nexte) {
-                       if (i)
-                               mul_v3_fl(a, 1.0f / (float)i);
-                       
-                       copy_v3_v3(vec, a);
+               if (BM_face_other_edge_loop(l->f, l->e, v)->e == e_next) {
+                       if (i) {
+                               len_v3_ensure(vec_accum, vec_accum_len / (float)i);
+                       }
+
+                       copy_v3_v3(r_slide_vec, vec_accum);
                        return BM_face_other_edge_loop(l->f, l->e, v);
                }
                
+               BLI_assert(l != l->radial_next);
                l = l->radial_next;
-       } while (l != firstl);
+       } while (l != l_first);
 
-       if (i)
-               mul_v3_fl(a, 1.0f / (float)i);
+       if (i) {
+               len_v3_ensure(vec_accum, vec_accum_len / (float)i);
+       }
        
-       copy_v3_v3(vec, a);
+       copy_v3_v3(r_slide_vec, vec_accum);
        
        return NULL;
 }
@@ -4991,7 +5023,7 @@ static int createEdgeSlideVerts(TransInfo *t)
        BMesh *bm = em->bm;
        BMIter iter;
        BMEdge *e, *e1;
-       BMVert *v, *v2, *first;
+       BMVert *v, *v2;
        TransDataEdgeSlideVert *sv_array;
        BMBVHTree *btree;
        SmallHash table;
@@ -5098,6 +5130,7 @@ static int createEdgeSlideVerts(TransInfo *t)
        j = 0;
        while (1) {
                BMLoop *l, *l1, *l2;
+               BMVert *v_first;
 
                v = NULL;
                BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
@@ -5112,7 +5145,7 @@ static int createEdgeSlideVerts(TransInfo *t)
                if (!v->e)
                        continue;
                
-               first = v;
+               v_first = v;
 
                /*walk along the edge loop*/
                e = v->e;
@@ -5132,7 +5165,7 @@ static int createEdgeSlideVerts(TransInfo *t)
                                break;
 
                        v = BM_edge_other_vert(e, v);
-               } while (e != first->e);
+               } while (e != v_first->e);
 
                BM_elem_flag_disable(v, BM_ELEM_TAG);
 
@@ -5152,10 +5185,12 @@ static int createEdgeSlideVerts(TransInfo *t)
                }
 
                /*iterate over the loop*/
-               first = v;
+               v_first = v;
                do {
                        TransDataEdgeSlideVert *sv = sv_array + j;
 
+                       BLI_assert(j < MEM_allocN_len(sv_array) / sizeof(*sv));
+
                        sv->v = v;
                        sv->origvert = *v;
                        sv->loop_nr = loop_nr;
@@ -5179,6 +5214,8 @@ static int createEdgeSlideVerts(TransInfo *t)
                        if (!e) {
                                //v2=v, v = BM_edge_other_vert(l1->e, v);
 
+                               BLI_assert(j + 1 < MEM_allocN_len(sv_array) / sizeof(*sv));
+
                                sv = sv_array + j + 1;
                                sv->v = v;
                                sv->origvert = *v;
@@ -5208,7 +5245,7 @@ static int createEdgeSlideVerts(TransInfo *t)
 
                        BM_elem_flag_disable(v, BM_ELEM_TAG);
                        BM_elem_flag_disable(v2, BM_ELEM_TAG);
-               } while (e != first->e && l1);
+               } while (e != v_first->e && l1);
 
                loop_nr++;
        }
index 63cde9c7d5947c0d3e2b56f681917da7a1ddfe24..80f35d531cdb9e959e9c23ee8e9699f66cc3f726 100644 (file)
@@ -930,8 +930,7 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
        ibuf = BKE_image_acquire_ibuf(ima, NULL, NULL);
        
        if (ima->repbind || (GPU_get_mipmap() && !GTS.gpu_mipmap) || !ima->bindcode || !ibuf ||
-           (!is_power_of_2_i(ibuf->x) || !is_power_of_2_i(ibuf->y)) ||
-           (w == 0) || (h == 0))
+               (w == 0) || (h == 0))
        {
                /* these cases require full reload still */
                GPU_free_image(ima);
index 5f34fad09c60b6bb2ffbbab5c1a1617d90072418..d3a8742ede75f484655c0948c0649df9546a8b4f 100644 (file)
@@ -342,8 +342,8 @@ typedef enum FunctionFlag {
        FUNC_ALLOW_WRITE = 4096,
 
        /* registering */
-       FUNC_REGISTER = 16,
-       FUNC_REGISTER_OPTIONAL = 16 | 32,
+       FUNC_REGISTER = 32,
+       FUNC_REGISTER_OPTIONAL = 32 | 64,
 
        /* internal flags */
        FUNC_BUILTIN = 128,
index c1eb3b9b000b21c6936604aaf24bfba78502e3ce..938ef7a50321134ae102fc8f714e61bc5706b346 100644 (file)
@@ -55,19 +55,23 @@ EnumPropertyItem rigidbody_ob_shape_items[] = {
        {RB_SHAPE_CAPSULE, "CAPSULE", ICON_OUTLINER_OB_META, "Capsule", ""},
        {RB_SHAPE_CYLINDER, "CYLINDER", ICON_MESH_CYLINDER, "Cylinder", ""},
        {RB_SHAPE_CONE, "CONE", ICON_MESH_CONE, "Cone", ""},
-       {RB_SHAPE_CONVEXH, "CONVEX_HULL", ICON_MESH_ICOSPHERE, "Convex Hull", "A mesh-like surface encompassing (i.e. shrinkwrap over) all verts. Best results with fewer vertices"},
-       {RB_SHAPE_TRIMESH, "MESH", ICON_MESH_MONKEY, "Mesh", "Mesh consisting of triangles only, allowing for more detailed interactions than convex hulls"},
+       {RB_SHAPE_CONVEXH, "CONVEX_HULL", ICON_MESH_ICOSPHERE, "Convex Hull",
+                          "A mesh-like surface encompassing (i.e. shrinkwrap over) all vertices (best results with "
+                          "fewer vertices)"},
+       {RB_SHAPE_TRIMESH, "MESH", ICON_MESH_MONKEY, "Mesh",
+                          "Mesh consisting of triangles only, allowing for more detailed interactions than convex hulls"},
        {0, NULL, 0, NULL, NULL}};
 
 /* collision shapes of constraints in rigid body sim */
 EnumPropertyItem rigidbody_con_type_items[] = {
-       {RBC_TYPE_FIXED, "FIXED", ICON_FORCE_FORCE, "Fixed", "Glues rigid bodies together"},
-       {RBC_TYPE_POINT, "POINT", ICON_FORCE_FORCE, "Point", "Constrains rigid bodies to move aound common pivot point"},
-       {RBC_TYPE_HINGE, "HINGE", ICON_FORCE_FORCE, "Hinge", "Restricts rigid body rotation to one axis"},
-       {RBC_TYPE_SLIDER, "SLIDER", ICON_FORCE_FORCE, "Slider", "Restricts rigid boddy translation to one axis"},
-       {RBC_TYPE_PISTON, "PISTON", ICON_FORCE_FORCE, "Piston", "Restricts rigid boddy translation and rotation to one axis"},
-       {RBC_TYPE_6DOF, "GENERIC", ICON_FORCE_FORCE, "Generic", "Restricts translation and rotation to specified axes"},
-       {RBC_TYPE_6DOF_SPRING, "GENERIC_SPRING", ICON_FORCE_FORCE, "Generic Spring", "Restricts translation and rotation to specified axes with springs"},
+       {RBC_TYPE_FIXED, "FIXED", ICON_FORCE_FORCE, "Fixed", "Glue rigid bodies together"},
+       {RBC_TYPE_POINT, "POINT", ICON_FORCE_FORCE, "Point", "Constrain rigid bodies to move around common pivot point"},
+       {RBC_TYPE_HINGE, "HINGE", ICON_FORCE_FORCE, "Hinge", "Restrict rigid body rotation to one axis"},
+       {RBC_TYPE_SLIDER, "SLIDER", ICON_FORCE_FORCE, "Slider", "Restrict rigid body translation to one axis"},
+       {RBC_TYPE_PISTON, "PISTON", ICON_FORCE_FORCE, "Piston", "Restrict rigid body translation and rotation to one axis"},
+       {RBC_TYPE_6DOF, "GENERIC", ICON_FORCE_FORCE, "Generic", "Restrict translation and rotation to specified axes"},
+       {RBC_TYPE_6DOF_SPRING, "GENERIC_SPRING", ICON_FORCE_FORCE, "Generic Spring",
+                              "Restrict translation and rotation to specified axes with springs"},
        {0, NULL, 0, NULL, NULL}};
 
 
@@ -560,7 +564,7 @@ static void rna_def_rigidbody_world(BlenderRNA *brna)
        RNA_def_property_range(prop, 0.0f, 100.0f);
        RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3);
        RNA_def_property_float_default(prop, 1.0f);
-       RNA_def_property_ui_text(prop, "Time Scale", "Changes the speed of the simulation");
+       RNA_def_property_ui_text(prop, "Time Scale", "Change the speed of the simulation");
        RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
        
        /* timestep */
@@ -569,7 +573,9 @@ static void rna_def_rigidbody_world(BlenderRNA *brna)
        RNA_def_property_range(prop, 1, SHRT_MAX);
        RNA_def_property_ui_range(prop, 60, 1000, 1, 0);
        RNA_def_property_int_default(prop, 60);
-       RNA_def_property_ui_text(prop, "Steps Per Second", "Number of simulation steps taken per second (higher values are more accurate but slower)");
+       RNA_def_property_ui_text(prop, "Steps Per Second",
+                                "Number of simulation steps taken per second (higher values are more accurate "
+                                "but slower)");
        RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
        
        /* constraint solver iterations */
@@ -579,14 +585,18 @@ static void rna_def_rigidbody_world(BlenderRNA *brna)
        RNA_def_property_ui_range(prop, 10, 100, 1, 0);
        RNA_def_property_int_default(prop, 10);
        RNA_def_property_int_funcs(prop, NULL, "rna_RigidBodyWorld_num_solver_iterations_set", NULL);
-       RNA_def_property_ui_text(prop, "Solver Iterations", "Number of constraint solver iterations made per simulation step (higher values are more accurate but slower)");
+       RNA_def_property_ui_text(prop, "Solver Iterations",
+                                "Number of constraint solver iterations made per simulation step (higher values are more "
+                                "accurate but slower)");
        RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
        
        /* split impulse */
        prop = RNA_def_property(srna, "use_split_impulse", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBW_FLAG_USE_SPLIT_IMPULSE);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyWorld_split_impulse_set");
-       RNA_def_property_ui_text(prop, "Split Impulse", "Reduces extra velocity that can build up when objects collide (lowers simulation stabilty a litte so use only when necessary)");
+       RNA_def_property_ui_text(prop, "Split Impulse",
+                                "Reduce extra velocity that can build up when objects collide (lowers simulation "
+                                "stability a little so use only when necessary)");
        RNA_def_property_update(prop, NC_SCENE, "rna_RigidBodyWorld_reset");
 
        /* cache */
@@ -626,7 +636,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
        prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", RBO_FLAG_DISABLED);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_disabled_set");
-       RNA_def_property_ui_text(prop, "Enabled", "Rigid Body actively participated in the simulation");
+       RNA_def_property_ui_text(prop, "Enabled", "Rigid Body actively participates to the simulation");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        
        prop = RNA_def_property(srna, "collision_shape", PROP_ENUM, PROP_NONE);
@@ -639,7 +649,7 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
        prop = RNA_def_property(srna, "kinematic", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_KINEMATIC);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_kinematic_state_set");
-       RNA_def_property_ui_text(prop, "Kinematic", "Allows rigid body to be controlled by the animation system");
+       RNA_def_property_ui_text(prop, "Kinematic", "Allow rigid body to be controlled by the animation system");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        
        /* Physics Parameters */
@@ -659,12 +669,14 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_USE_DEACTIVATION);
        RNA_def_property_boolean_default(prop, TRUE);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyOb_activation_state_set");
-       RNA_def_property_ui_text(prop, "Enable Deactivation", "Enables deactivation of resting rigid bodies (increases performance and stability but can cause glitches)");
+       RNA_def_property_ui_text(prop, "Enable Deactivation",
+                                "Enable deactivation of resting rigid bodies (increases performance and stability "
+                                "but can cause glitches)");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        
        prop = RNA_def_property(srna, "start_deactivated", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_START_DEACTIVATED);
-       RNA_def_property_ui_text(prop, "Start Deactivated", "Deactivates rigid body at the start of the simulation");
+       RNA_def_property_ui_text(prop, "Start Deactivated", "Deactivate rigid body at the start of the simulation");
        RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        
@@ -673,7 +685,8 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
        RNA_def_property_range(prop, FLT_MIN, FLT_MAX); // range must always be positive (and non-zero)
        RNA_def_property_float_default(prop, 0.4f);
        RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_linear_sleepThresh_set", NULL);
-       RNA_def_property_ui_text(prop, "Linear Velocity Deactivation Threshold", "Linear Velocity below which simulation stops simulating object");
+       RNA_def_property_ui_text(prop, "Linear Velocity Deactivation Threshold",
+                                "Linear Velocity below which simulation stops simulating object");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        
        prop = RNA_def_property(srna, "deactivate_angular_velocity", PROP_FLOAT, PROP_UNIT_VELOCITY);
@@ -681,7 +694,8 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
        RNA_def_property_range(prop, FLT_MIN, FLT_MAX); // range must always be positive (and non-zero)
        RNA_def_property_float_default(prop, 0.5f);
        RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_angular_sleepThresh_set", NULL);
-       RNA_def_property_ui_text(prop, "Angular Velocity Deactivation Threshold", "Angular Velocity below which simulation stops simulating object");
+       RNA_def_property_ui_text(prop, "Angular Velocity Deactivation Threshold",
+                                "Angular Velocity below which simulation stops simulating object");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        
        /* Dynamics Parameters - Damping Parameters */
@@ -717,14 +731,17 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
        RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3);
        RNA_def_property_float_default(prop, 0.0f);
        RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_restitution_set", NULL);
-       RNA_def_property_ui_text(prop, "Restitution", "Tendency of object to bounce after colliding with another (0 = stays still, 1 = perfectly elastic)");
+       RNA_def_property_ui_text(prop, "Restitution",
+                                "Tendency of object to bounce after colliding with another "
+                                "(0 = stays still, 1 = perfectly elastic)");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        
        /* Collision Parameters - Sensitivity */
        prop = RNA_def_property(srna, "use_margin", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBO_FLAG_USE_MARGIN);
        RNA_def_property_boolean_default(prop, FALSE);
-       RNA_def_property_ui_text(prop, "Collision Margin", "Use custom collision margin (some shapes will have a visible gap around them)");
+       RNA_def_property_ui_text(prop, "Collision Margin",
+                                "Use custom collision margin (some shapes will have a visible gap around them)");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_reset");
        
        prop = RNA_def_property(srna, "collision_margin", PROP_FLOAT, PROP_UNIT_LENGTH);
@@ -733,13 +750,15 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
        RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 3);
        RNA_def_property_float_default(prop, 0.04f);
        RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyOb_collision_margin_set", NULL);
-       RNA_def_property_ui_text(prop, "Collision Margin", "Threshold of distance near surface where collisions are still considered (best results when non-zero)");
+       RNA_def_property_ui_text(prop, "Collision Margin",
+                                "Threshold of distance near surface where collisions are still considered "
+                                "(best results when non-zero)");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_shape_reset");
        
        prop = RNA_def_property(srna, "collision_groups", PROP_BOOLEAN, PROP_LAYER_MEMBER);
        RNA_def_property_boolean_sdna(prop, NULL, "col_groups", 1);
        RNA_def_property_array(prop, 20);
-       RNA_def_property_ui_text(prop, "Collison Groups", "Collision Groups Rigid Body belongs to");
+       RNA_def_property_ui_text(prop, "Collision Groups", "Collision Groups Rigid Body belongs to");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
        RNA_def_property_flag(prop, PROP_LIB_EXCEPTION);
 }
@@ -751,7 +770,8 @@ static void rna_def_rigidbody_constraint(BlenderRNA *brna)
 
        srna = RNA_def_struct(brna, "RigidBodyConstraint", NULL);
        RNA_def_struct_sdna(srna, "RigidBodyCon");
-       RNA_def_struct_ui_text(srna, "Rigid Body Constraint", "Constraint influencing Objects inside Rigid Body Simulation");
+       RNA_def_struct_ui_text(srna, "Rigid Body Constraint",
+                              "Constraint influencing Objects inside Rigid Body Simulation");
        RNA_def_struct_path_func(srna, "rna_RigidBodyCon_path");
 
        /* Enums */
@@ -772,7 +792,7 @@ static void rna_def_rigidbody_constraint(BlenderRNA *brna)
        prop = RNA_def_property(srna, "disable_collisions", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_DISABLE_COLLISIONS);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_disable_collisions_set");
-       RNA_def_property_ui_text(prop, "Disable Collisions", "Disables collisions between constrained ridid bodies");
+       RNA_def_property_ui_text(prop, "Disable Collisions", "Disable collisions between constrained rigid bodies");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "object1", PROP_POINTER, PROP_NONE);
@@ -793,7 +813,8 @@ static void rna_def_rigidbody_constraint(BlenderRNA *brna)
        prop = RNA_def_property(srna, "use_breaking", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_BREAKING);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_use_breaking_set");
-       RNA_def_property_ui_text(prop, "Breakable", "Constraint can be broaken if it receives an impulse above the threshold");
+       RNA_def_property_ui_text(prop, "Breakable",
+                                "Constraint can be broken if it receives an impulse above the threshold");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "breaking_threshold", PROP_FLOAT, PROP_NONE);
@@ -802,14 +823,16 @@ static void rna_def_rigidbody_constraint(BlenderRNA *brna)
        RNA_def_property_ui_range(prop, 0.0f, 1000.0f, 100.0, 2);
        RNA_def_property_float_default(prop, 10.0f);
        RNA_def_property_float_funcs(prop, NULL, "rna_RigidBodyCon_breaking_threshold_set", NULL);
-       RNA_def_property_ui_text(prop, "Breaking Threshold", "Impulse threshold that must be reached for the constraint to break");
+       RNA_def_property_ui_text(prop, "Breaking Threshold",
+                                "Impulse threshold that must be reached for the constraint to break");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
 
        /* Solver Iterations */
        prop = RNA_def_property(srna, "override_solver_iterations", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_OVERRIDE_SOLVER_ITERATIONS);
        RNA_def_property_boolean_funcs(prop, NULL, "rna_RigidBodyCon_override_solver_iterations_set");
-       RNA_def_property_ui_text(prop, "Override Solver Iterations", "Overrides the number of solver iterations for this constraint");
+       RNA_def_property_ui_text(prop, "Override Solver Iterations",
+                                "Override the number of solver iterations for this constraint");
        RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "num_solver_iterations", PROP_INT, PROP_NONE);
@@ -818,131 +841,133 @@ static void rna_def_rigidbody_constraint(BlenderRNA *brna)
        RNA_def_property_ui_range(prop, 1, 100, 1, 0);
        RNA_def_property_int_default(prop, 10);
        RNA_def_property_int_funcs(prop, NULL, "rna_RigidBodyCon_num_solver_iterations_set", NULL);
-       RNA_def_property_ui_text(prop, "Solver Iterations", "Number of constraint solver iterations made per simulation step (higher values are more accurate but slower)");
+       RNA_def_property_ui_text(prop, "Solver Iterations",
+                                "Number of constraint solver iterations made per simulation step (higher values are more "
+                                "accurate but slower)");
        RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
 
        /* Limits */
        prop = RNA_def_property(srna, "use_limit_lin_x", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_X);
-       RNA_def_property_ui_text(prop, "X Axis", "Limits translation on x axis");
+       RNA_def_property_ui_text(prop, "X Axis", "Limit translation on X axis");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_limit_lin_y", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_Y);
-       RNA_def_property_ui_text(prop, "Y Axis", "Limits translation on y axis");
+       RNA_def_property_ui_text(prop, "Y Axis", "Limit translation on Y axis");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_limit_lin_z", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_LIN_Z);
-       RNA_def_property_ui_text(prop, "Z Axis", "Limits translation on z axis");
+       RNA_def_property_ui_text(prop, "Z Axis", "Limit translation on Z axis");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_limit_ang_x", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_X);
-       RNA_def_property_ui_text(prop, "X Angle", "Limits rotation around x axis");
+       RNA_def_property_ui_text(prop, "X Angle", "Limit rotation around X axis");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_limit_ang_y", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_Y);
-       RNA_def_property_ui_text(prop, "Y Angle", "Limits rotation around y axis");
+       RNA_def_property_ui_text(prop, "Y Angle", "Limit rotation around Y axis");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_limit_ang_z", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_LIMIT_ANG_Z);
-       RNA_def_property_ui_text(prop, "Z Angle", "Limits rotation around z axis");
+       RNA_def_property_ui_text(prop, "Z Angle", "Limit rotation around Z axis");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_spring_x", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_X);
-       RNA_def_property_ui_text(prop, "X Spring", "Enables spring on X axis");
+       RNA_def_property_ui_text(prop, "X Spring", "Enable spring on X axis");
        RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_spring_y", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_Y);
-       RNA_def_property_ui_text(prop, "Y Spring", "Enables spring on Y axis");
+       RNA_def_property_ui_text(prop, "Y Spring", "Enable spring on Y axis");
        RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "use_spring_z", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", RBC_FLAG_USE_SPRING_Z);
-       RNA_def_property_ui_text(prop, "Z Spring", "Enables spring on Z axis");
+       RNA_def_property_ui_text(prop, "Z Spring", "Enable spring on Z axis");
        RNA_def_property_update(prop, NC_OBJECT, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_lin_x_lower", PROP_FLOAT, PROP_UNIT_LENGTH);
        RNA_def_property_float_sdna(prop, NULL, "limit_lin_x_lower");
        RNA_def_property_float_default(prop, -1.0f);
-       RNA_def_property_ui_text(prop, "Lower X Limit", "Lower limit of x axis translation");
+       RNA_def_property_ui_text(prop, "Lower X Limit", "Lower limit of X axis translation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_lin_x_upper", PROP_FLOAT, PROP_UNIT_LENGTH);
        RNA_def_property_float_sdna(prop, NULL, "limit_lin_x_upper");
        RNA_def_property_float_default(prop, 1.0f);
-       RNA_def_property_ui_text(prop, "Upper X Limit", "Upper limit of x axis translation");
+       RNA_def_property_ui_text(prop, "Upper X Limit", "Upper limit of X axis translation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_lin_y_lower", PROP_FLOAT, PROP_UNIT_LENGTH);
        RNA_def_property_float_sdna(prop, NULL, "limit_lin_y_lower");
        RNA_def_property_float_default(prop, -1.0f);
-       RNA_def_property_ui_text(prop, "Lower Y Limit", "Lower limit of y axis translation");
+       RNA_def_property_ui_text(prop, "Lower Y Limit", "Lower limit of Y axis translation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_lin_y_upper", PROP_FLOAT, PROP_UNIT_LENGTH);
        RNA_def_property_float_sdna(prop, NULL, "limit_lin_y_upper");
        RNA_def_property_float_default(prop, 1.0f);
-       RNA_def_property_ui_text(prop, "Upper Y Limit", "Upper limit of y axis translation");
+       RNA_def_property_ui_text(prop, "Upper Y Limit", "Upper limit of Y axis translation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_lin_z_lower", PROP_FLOAT, PROP_UNIT_LENGTH);
        RNA_def_property_float_sdna(prop, NULL, "limit_lin_z_lower");
        RNA_def_property_float_default(prop, -1.0f);
-       RNA_def_property_ui_text(prop, "Lower Z Limit", "Lower limit of z axis translation");
+       RNA_def_property_ui_text(prop, "Lower Z Limit", "Lower limit of Z axis translation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_lin_z_upper", PROP_FLOAT, PROP_UNIT_LENGTH);
        RNA_def_property_float_sdna(prop, NULL, "limit_lin_z_upper");
        RNA_def_property_float_default(prop, 1.0f);
-       RNA_def_property_ui_text(prop, "Upper Z Limit", "Upper limit of z axis translation");
+       RNA_def_property_ui_text(prop, "Upper Z Limit", "Upper limit of Z axis translation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_ang_x_lower", PROP_FLOAT, PROP_ANGLE);
        RNA_def_property_float_sdna(prop, NULL, "limit_ang_x_lower");
        RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
        RNA_def_property_float_default(prop, -M_PI_4);
-       RNA_def_property_ui_text(prop, "Lower X Angle Limit", "Lower limit of x axis rotation");
+       RNA_def_property_ui_text(prop, "Lower X Angle Limit", "Lower limit of X axis rotation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_ang_x_upper", PROP_FLOAT, PROP_ANGLE);
        RNA_def_property_float_sdna(prop, NULL, "limit_ang_x_upper");
        RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
        RNA_def_property_float_default(prop, M_PI_4);
-       RNA_def_property_ui_text(prop, "Upper X Angle Limit", "Upper limit of x axis rotation");
+       RNA_def_property_ui_text(prop, "Upper X Angle Limit", "Upper limit of X axis rotation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_ang_y_lower", PROP_FLOAT, PROP_ANGLE);
        RNA_def_property_float_sdna(prop, NULL, "limit_ang_y_lower");
        RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
        RNA_def_property_float_default(prop, -M_PI_4);
-       RNA_def_property_ui_text(prop, "Lower Y Angle Limit", "Lower limit of y axis rotation");
+       RNA_def_property_ui_text(prop, "Lower Y Angle Limit", "Lower limit of Y axis rotation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_ang_y_upper", PROP_FLOAT, PROP_ANGLE);
        RNA_def_property_float_sdna(prop, NULL, "limit_ang_y_upper");
        RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
        RNA_def_property_float_default(prop, M_PI_4);
-       RNA_def_property_ui_text(prop, "Upper Y Angle Limit", "Upper limit of y axis rotation");
+       RNA_def_property_ui_text(prop, "Upper Y Angle Limit", "Upper limit of Y axis rotation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_ang_z_lower", PROP_FLOAT, PROP_ANGLE);
        RNA_def_property_float_sdna(prop, NULL, "limit_ang_z_lower");
        RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
        RNA_def_property_float_default(prop, -M_PI_4);
-       RNA_def_property_ui_text(prop, "Lower Z Angle Limit", "Lower limit of z axis rotation");
+       RNA_def_property_ui_text(prop, "Lower Z Angle Limit", "Lower limit of Z axis rotation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "limit_ang_z_upper", PROP_FLOAT, PROP_ANGLE);
        RNA_def_property_float_sdna(prop, NULL, "limit_ang_z_upper");
        RNA_def_property_range(prop, -M_PI * 2, M_PI * 2);
        RNA_def_property_float_default(prop, M_PI_4);
-       RNA_def_property_ui_text(prop, "Upper Z Angle Limit", "Upper limit of z axis rotation");
+       RNA_def_property_ui_text(prop, "Upper Z Angle Limit", "Upper limit of Z axis rotation");
        RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_RigidBodyOb_reset");
 
        prop = RNA_def_property(srna, "spring_stiffness_x", PROP_FLOAT, PROP_UNIT_LENGTH);
index b5b3897ed46c40e218f1a60b5b1e52ef35ba294d..9bd20d854e732251efd778c5394861a68a45563c 100644 (file)
@@ -946,7 +946,7 @@ static int rna_Function_registered_get(PointerRNA *ptr)
 static int rna_Function_registered_optional_get(PointerRNA *ptr)
 {
        FunctionRNA *func = (FunctionRNA *)ptr->data;
-       return func->flag & FUNC_REGISTER_OPTIONAL;
+       return func->flag & (FUNC_REGISTER_OPTIONAL & ~FUNC_REGISTER);
 }
 
 static int rna_Function_no_self_get(PointerRNA *ptr)
index 96bd0fb327e038aaa1a93d554e47c52d435201d6..843743b9a9a63d261fc1e3432419346ef28e0af0 100644 (file)
@@ -1830,28 +1830,29 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
        /* etch-a-ton */
        prop = RNA_def_property(srna, "use_bone_sketching", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING);
-       RNA_def_property_ui_text(prop, "Use Bone Sketching", "DOC BROKEN");
+       RNA_def_property_ui_text(prop, "Use Bone Sketching", "Use sketching to create and edit bones");
 /*     RNA_def_property_ui_icon(prop, ICON_EDIT, 0); */
+       RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
        prop = RNA_def_property(srna, "use_etch_quick", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_QUICK);
-       RNA_def_property_ui_text(prop, "Quick Sketching", "DOC BROKEN");
+       RNA_def_property_ui_text(prop, "Quick Sketching", "Automatically convert and delete on stroke end");
 
        prop = RNA_def_property(srna, "use_etch_overdraw", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "bone_sketching", BONE_SKETCHING_ADJUST);
-       RNA_def_property_ui_text(prop, "Overdraw Sketching", "DOC BROKEN");
+       RNA_def_property_ui_text(prop, "Overdraw Sketching", "Adjust strokes by drawing near them");
        
        prop = RNA_def_property(srna, "use_etch_autoname", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "skgen_retarget_options", SK_RETARGET_AUTONAME);
-       RNA_def_property_ui_text(prop, "Autoname", "DOC BROKEN");
+       RNA_def_property_ui_text(prop, "Autoname Bones", "Automatically generate values to replace &N and &S suffix placeholders in template names");
 
        prop = RNA_def_property(srna, "etch_number", PROP_STRING, PROP_NONE);
        RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
-       RNA_def_property_ui_text(prop, "Number", "DOC BROKEN");
+       RNA_def_property_ui_text(prop, "Number", "Text to replace &N with (e.g. 'Finger.&N' -> 'Finger.1' or 'Finger.One')");
 
        prop = RNA_def_property(srna, "etch_side", PROP_STRING, PROP_NONE);
        RNA_def_property_string_sdna(prop, NULL, "skgen_num_string");
-       RNA_def_property_ui_text(prop, "Side", "DOC BROKEN");
+       RNA_def_property_ui_text(prop, "Side", "Text to replace &S with (e.g. 'Arm.&S' -> 'Arm.R' or 'Arm.Right')");
 
        prop = RNA_def_property(srna, "etch_template", PROP_POINTER, PROP_NONE);
        RNA_def_property_pointer_sdna(prop, NULL, "skgen_template");
@@ -1870,14 +1871,14 @@ static void rna_def_tool_settings(BlenderRNA  *brna)
        RNA_def_property_float_sdna(prop, NULL, "skgen_correlation_limit");
        RNA_def_property_range(prop, 0.00001, 1.0);
        RNA_def_property_ui_range(prop, 0.01, 1.0, 0.01, 2);
-       RNA_def_property_ui_text(prop, "Limit", "Number of bones in the subdivided stroke");
+       RNA_def_property_ui_text(prop, "Limit", "Correlation threshold for number of bones in the subdivided stroke");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
        prop = RNA_def_property(srna, "etch_length_limit", PROP_FLOAT, PROP_DISTANCE);
        RNA_def_property_float_sdna(prop, NULL, "skgen_length_limit");
        RNA_def_property_range(prop, 0.00001, 100000.0);
        RNA_def_property_ui_range(prop, 0.001, 100.0, 0.1, 3);
-       RNA_def_property_ui_text(prop, "Length", "Number of bones in the subdivided stroke");
+       RNA_def_property_ui_text(prop, "Length", "Maximum length of the subdivided bones");
        RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
 
        prop = RNA_def_property(srna, "etch_roll_mode", PROP_ENUM, PROP_NONE);
@@ -3037,7 +3038,7 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
        RNA_def_property_float_sdna(prop, NULL, "eyeseparation");
        RNA_def_property_range(prop, 0.01, 5.0);
        RNA_def_property_ui_text(prop, "Eye Separation",
-                                "Set the distance between the eyes - the camera focal length/30 should be fine");
+                                "Set the distance between the eyes - the camera focal distance/30 should be fine");
        RNA_def_property_update(prop, NC_SCENE, NULL);
        
        /* Dome */
@@ -3162,10 +3163,12 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
        RNA_def_property_update(prop, NC_SCENE, NULL);
 
        /* mode */
+       /* not used  *//* deprecated !!!!!!!!!!!!! */
        prop = RNA_def_property(srna, "use_occlusion_culling", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "mode", WO_DBVT_CULLING);
-       RNA_def_property_ui_text(prop, "DBVT culling",
-                                "Use optimized Bullet DBVT tree for view frustum and occlusion culling");
+       RNA_def_property_ui_text(prop, "DBVT Culling",
+                                "Use optimized Bullet DBVT tree for view frustum and occlusion culling "
+                                "(more efficient, but it can waste unecessary CPU if the scene doesn't have Occluder objects");
        
        /* not used  *//* deprecated !!!!!!!!!!!!! */
        prop = RNA_def_property(srna, "use_activity_culling", PROP_BOOLEAN, PROP_NONE);
index e877367790eb84b599ad36780b741df54046ffe6..b0df27b957b0bc6779d5c940a30653c39d6b016b 100644 (file)
 
 static void rna_Scene_frame_set(Scene *scene, int frame, float subframe)
 {
-       scene->r.cfra = frame;
-       scene->r.subframe = subframe;
+       float cfra = (float)frame + subframe;
+
+       scene->r.cfra = floorf(cfra);
+       scene->r.subframe = cfra - floorf(cfra);
        
        CLAMP(scene->r.cfra, MINAFRAME, MAXFRAME);
        BKE_scene_update_for_newframe(G.main, scene, (1 << 20) - 1);
index fad93ea9054d0d4ade68ec80946e5ea07d4dfd3a..e5585b4f72d6f3c04f7aebc5a25b4eb0b1388d44 100644 (file)
@@ -791,7 +791,7 @@ static void rna_def_panel(BlenderRNA *brna)
 
        func = RNA_def_function(srna, "draw_header", NULL);
        RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout");
-       RNA_def_function_flag(func, FUNC_REGISTER);
+       RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
        parm = RNA_def_pointer(func, "context", "Context", "", "");
        RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
 
@@ -863,7 +863,7 @@ static void rna_def_uilist(BlenderRNA *brna)
        func = RNA_def_function(srna, "draw_item", NULL);
        RNA_def_function_ui_description(func, "Draw an item in the list (NOTE: when you define your own draw_item "
                                              "function, you may want to check given 'item' is of the right type...)");
-       RNA_def_function_flag(func, FUNC_REGISTER);
+       RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
        parm = RNA_def_pointer(func, "context", "Context", "", "");
        RNA_def_property_flag(parm, PROP_REQUIRED);
        parm = RNA_def_pointer(func, "layout", "UILayout", "", "Layout to draw the item");
index 85a6db0070342ce32da9a7f139a58b6c70f02197..4de92d090fcd119d812e04b6d3612b3bff5917d3 100644 (file)
@@ -6857,7 +6857,7 @@ static int bpy_class_validate_recursive(PointerRNA *dummyptr, StructRNA *srna, v
                i++;
 
                if (item == NULL) {
-                       if ((flag & FUNC_REGISTER_OPTIONAL) == 0) {
+                       if ((flag & (FUNC_REGISTER_OPTIONAL & ~FUNC_REGISTER)) == 0) {
                                PyErr_Format(PyExc_AttributeError,
                                             "expected %.200s, %.200s class to have an \"%.200s\" attribute",
                                             class_type, py_class_name,
index 3d05f51fb9693905ebf16d5e84d7ee0fcec6a452..91cff67fc49c9b8dd89a18d861e49bc7a5f38d14 100644 (file)
@@ -251,6 +251,86 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
        }
 }
 
+/* Line-Line intersection using algorithm from mathworld.wolfram.com */
+
+PyDoc_STRVAR(M_Geometry_intersect_sphere_sphere_2d_doc,
+".. function:: intersect_sphere_sphere_2d(p_a, radius_a, p_b, radius_b)\n"
+"\n"
+"   Returns 2 points on between intersecting circles.\n"
+"\n"
+"   :arg p_a: Center of the first circle\n"
+"   :type p_a: :class:`mathutils.Vector`\n"
+"   :arg radius_a: Radius of the first circle\n"
+"   :type radius_a: float\n"
+"   :arg p_b: Center of the second circle\n"
+"   :type p_b: :class:`mathutils.Vector`\n"
+"   :arg radius_b: Radius of the second circle\n"
+"   :type radius_b: float\n"
+"   :rtype: tuple of :class:`mathutils.Vector`'s or None when there is no intersection\n"
+);
+static PyObject *M_Geometry_intersect_sphere_sphere_2d(PyObject *UNUSED(self), PyObject *args)
+{
+       PyObject *ret;
+       VectorObject *vec_a, *vec_b;
+       float *v_a, *v_b;
+       float rad_a, rad_b;
+       float v_ab[2];
+       float dist;
+
+       if (!PyArg_ParseTuple(args, "O!fO!f:intersect_sphere_sphere_2d",
+                             &vector_Type, &vec_a, &rad_a,
+                             &vector_Type, &vec_b, &rad_b))
+       {
+               return NULL;
+       }
+
+       if (BaseMath_ReadCallback(vec_a) == -1 ||
+           BaseMath_ReadCallback(vec_b) == -1)
+       {
+               return NULL;
+       }
+
+       ret = PyTuple_New(2);
+
+       v_a = vec_a->vec;
+       v_b = vec_b->vec;
+
+       sub_v2_v2v2(v_ab, v_b, v_a);
+       dist = len_v2(v_ab);
+
+       if (/* out of range */
+           (dist > rad_a + rad_b) ||
+           /* fully-contained in the other */
+           (dist < abs(rad_a - rad_b)) ||
+           /* co-incident */
+           (dist < FLT_EPSILON))
+       {
+               /* out of range */
+               PyTuple_SET_ITEM(ret, 0,  Py_None); Py_INCREF(Py_None);
+               PyTuple_SET_ITEM(ret, 1,  Py_None); Py_INCREF(Py_None);
+       }
+       else {
+               const float dist_delta = ((rad_a * rad_a) - (rad_b * rad_b) + (dist * dist)) / (2.0f * dist);
+               const float h = powf(fabsf((rad_a * rad_a) - (dist_delta * dist_delta)), 0.5f);
+               float i_cent[2];
+               float i1[2], i2[2];
+
+               i_cent[0] = v_a[0] + ((v_ab[0] * dist_delta) / dist);
+               i_cent[1] = v_a[1] + ((v_ab[1] * dist_delta) / dist);
+
+               i1[0] = i_cent[0] + h * v_ab[1] / dist;
+               i1[1] = i_cent[1] - h * v_ab[0] / dist;
+
+               i2[0] = i_cent[0] - h * v_ab[1] / dist;
+               i2[1] = i_cent[1] + h * v_ab[0] / dist;
+
+               PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(i1, 2, Py_NEW, NULL));
+               PyTuple_SET_ITEM(ret, 1, Vector_CreatePyObject(i2, 2, Py_NEW, NULL));
+       }
+
+       return ret;
+}
+
 PyDoc_STRVAR(M_Geometry_normal_doc,
 ".. function:: normal(v1, v2, v3, v4=None)\n"
 "\n"
@@ -1376,6 +1456,7 @@ static PyMethodDef M_Geometry_methods[] = {
        {"intersect_line_sphere", (PyCFunction) M_Geometry_intersect_line_sphere, METH_VARARGS, M_Geometry_intersect_line_sphere_doc},
        {"intersect_line_sphere_2d", (PyCFunction) M_Geometry_intersect_line_sphere_2d, METH_VARARGS, M_Geometry_intersect_line_sphere_2d_doc},
        {"distance_point_to_plane", (PyCFunction) M_Geometry_distance_point_to_plane, METH_VARARGS, M_Geometry_distance_point_to_plane_doc},
+       {"intersect_sphere_sphere_2d", (PyCFunction) M_Geometry_intersect_sphere_sphere_2d, METH_VARARGS, M_Geometry_intersect_sphere_sphere_2d_doc},
        {"area_tri", (PyCFunction) M_Geometry_area_tri, METH_VARARGS, M_Geometry_area_tri_doc},
        {"normal", (PyCFunction) M_Geometry_normal, METH_VARARGS, M_Geometry_normal_doc},
        {"barycentric_transform", (PyCFunction) M_Geometry_barycentric_transform, METH_VARARGS, M_Geometry_barycentric_transform_doc},
index 1c4ab5a4b0e0a023ce5152d145b6ea88920527a8..c85df29de926df21c56c0d005767106610b36cd7 100644 (file)
@@ -905,7 +905,7 @@ int fromcocoa_request_qtcodec_settings(bContext *C, wmOperator *op)
 void SCENE_OT_render_data_set_quicktime_codec(wmOperatorType *ot)
 {
        /* identifiers */
-       ot->name = "Change codec";
+       ot->name = "Change Codec";
        ot->description = "Change Quicktime codec Settings";
        ot->idname = "SCENE_OT_render_data_set_quicktime_codec";
        
index 866932632c27b06152feaaa82fa1208dcb758c5d..d77ca10e0b2bb50d120e1921ce02e00669cc99bb 100644 (file)
@@ -1879,8 +1879,6 @@ static void do_render_all_options(Render *re)
        /* ensure no images are in memory from previous animated sequences */
        BKE_image_all_free_anim_ibufs(re->r.cfra);
 
-       re->pool = BKE_image_pool_new();
-
        if (RE_engine_render(re, 1)) {
                /* in this case external render overrides all */
        }
@@ -1893,7 +1891,12 @@ static void do_render_all_options(Render *re)
                re->display_draw(re->ddh, re->result, NULL);
        }
        else {
+               re->pool = BKE_image_pool_new();
+
                do_render_composite_fields_blur_3d(re);
+
+               BKE_image_pool_free(re->pool);
+               re->pool = NULL;
        }
        
        re->i.lastframetime = PIL_check_seconds_timer() - re->i.starttime;
@@ -1905,9 +1908,6 @@ static void do_render_all_options(Render *re)
                renderresult_stampinfo(re);
                re->display_draw(re->ddh, re->result, NULL);
        }
-
-       BKE_image_pool_free(re->pool);
-       re->pool = NULL;
 }
 
 static int check_valid_camera(Scene *scene, Object *camera_override)
index 03a81e944c0dbd388371c417db1719c913292326..e22694a65605132e7d0c5f69eab52edf144f3cd4 100644 (file)
@@ -3954,7 +3954,7 @@ static int wm_ndof_sensitivity_exec(bContext *UNUSED(C), wmOperator *op)
 
 static void WM_OT_ndof_sensitivity_change(wmOperatorType *ot)
 {
-       ot->name = "Change NDOF sensitivity";
+       ot->name = "Change NDOF Sensitivity";
        ot->idname = "WM_OT_ndof_sensitivity_change";
        ot->description = "Change NDOF sensitivity";
        
index f8ad8870e83d4467f05202b7359e32f077cf3aa2..3a9a10dd0cc767d7492b62cd0dbbec611951801e 100644 (file)
@@ -121,6 +121,50 @@ static void DisableForText()
        }
 }
 
+void BL_draw_gamedebug_box(int xco, int yco, int width, int height, float percentage)
+{
+       /* This is a rather important line :( The gl-mode hasn't been left
+        * behind quite as neatly as we'd have wanted to. I don't know
+        * what cause it, though :/ .*/
+       glDisable(GL_DEPTH_TEST);
+       
+       glMatrixMode(GL_PROJECTION);
+       glPushMatrix();
+       glLoadIdentity();
+       
+       glOrtho(0, width, 0, height, -100, 100);
+       
+       glMatrixMode(GL_MODELVIEW);
+       glPushMatrix();
+       glLoadIdentity();
+       
+       yco = height - yco;
+       int barsize = 50;
+
+       /* draw in black first*/
+       glColor3ub(0, 0, 0);
+       glBegin(GL_QUADS);
+       glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1 + 10);
+       glVertex2f(xco + 1, yco - 1 + 10);
+       glVertex2f(xco + 1, yco - 1);
+       glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1);
+       glEnd();
+       
+       glColor3ub(255, 255, 255);
+       glBegin(GL_QUADS);
+       glVertex2f(xco + 1 + barsize * percentage, yco + 10);
+       glVertex2f(xco, yco + 10);
+       glVertex2f(xco, yco);
+       glVertex2f(xco + 1 + barsize * percentage, yco);
+       glEnd();
+       
+       glMatrixMode(GL_PROJECTION);
+       glPopMatrix();
+       glMatrixMode(GL_MODELVIEW);
+       glPopMatrix();
+       glEnable(GL_DEPTH_TEST);
+}
+
 /* Print 3D text */
 void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* color, double* mat, float aspect)
 {
@@ -164,7 +208,9 @@ void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int
 
        /* the actual drawing */
        glColor3ub(255, 255, 255);
-       BLF_draw_default((float)xco, (float)(height-yco), 0.0f, (char *)text, 65535); /* XXX, use real len */
+       BLF_size(blf_mono_font, 11, 72);
+       BLF_position(blf_mono_font, (float)xco, (float)(height-yco), 0.0f);
+       BLF_draw(blf_mono_font, (char *)text, 65535); /* XXX, use real len */
 
        glMatrixMode(GL_PROJECTION);
        glPopMatrix();
@@ -193,9 +239,13 @@ void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int widt
 
        /* draw in black first*/
        glColor3ub(0, 0, 0);
-       BLF_draw_default((float)(xco+2), (float)(height-yco-2), 0.0f, text, 65535); /* XXX, use real len */
+       BLF_size(blf_mono_font, 11, 72);
+       BLF_position(blf_mono_font, (float)xco+1, (float)(height-yco-1), 0.0f);
+       BLF_draw(blf_mono_font, (char *)text, 65535);/* XXX, use real len */
+       
        glColor3ub(255, 255, 255);
-       BLF_draw_default((float)xco, (float)(height-yco), 0.0f, text, 65535); /* XXX, use real len */
+       BLF_position(blf_mono_font, (float)xco, (float)(height-yco), 0.0f);
+       BLF_draw(blf_mono_font, (char *)text, 65535);
 
        glMatrixMode(GL_PROJECTION);
        glPopMatrix();
index 7ba612b19cfd5c477b2577a3cccad7df1e7b7495..5c3f0684764b813cea4ffc107c2c59821fadb786 100644 (file)
@@ -50,6 +50,7 @@ void  BL_HideMouse(struct wmWindow *win);
 void   BL_NormalMouse(struct wmWindow *win);
 void   BL_WaitMouse(struct wmWindow *win);
 
+void BL_draw_gamedebug_box(int xco, int yco, int width, int height, float percentage);
 void BL_print_game_line(int fontid, const char* text, int size, int dpi, float* color, double* mat, float aspect);
 void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height);
 void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height);
index e32239b148d48b91e12f4b0d1a2ed68117b2a334..64ed384e961f615e1345e4e659a5346b8f25eca9 100644 (file)
@@ -280,6 +280,16 @@ void KX_BlenderRenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmat
                }
        }
 }
+
+void KX_BlenderRenderTools::RenderBox2D(int xco,
+                       int yco,
+                       int width,
+                       int height,
+                       float percentage)
+{
+       BL_draw_gamedebug_box(xco, yco, width, height, percentage);
+}
+
 void KX_BlenderRenderTools::RenderText3D(int fontid,
                                                                                 const char* text,
                                                                                 int size,
index 7195524ceaefaaa6c6bbcbefa6f5df1a1da3fd6f..228763e7d2d4a818dedf04a6a528317a4bc2b8da 100644 (file)
@@ -71,6 +71,13 @@ public:
        void                            DisableOpenGLLights();
        void                            ProcessLighting(RAS_IRasterizer *rasty, bool uselights, const MT_Transform& viewmat);
 
+       void                            RenderBox2D(int xco,
+                                                                       int yco,
+                                                                       int width,
+                                                                       int height,
+                                                                       float percentage);
+
+       
        void                            RenderText3D(int fontid,
                                         const char* text,
                                         int size,
index 409a3bfec8f401109e7ac1c440191d2c1001c641..ae902e23d65fec202ba1d9d6100a541a13c658c7 100644 (file)
@@ -1973,6 +1973,22 @@ static KX_GameObject *gameobject_from_blenderobject(
                        ((ob->gameflag2 & OB_NEVER_DO_ACTIVITY_CULLING)!=0);
                gameobj->SetIgnoreActivityCulling(ignoreActivityCulling);
                gameobj->SetOccluder((ob->gameflag & OB_OCCLUDER) != 0, false);
+
+               // we only want obcolor used if there is a material in the mesh
+               // that requires it
+               Material *mat= NULL;
+               bool bUseObjectColor=false;
+               
+               for (int i=0;i<mesh->totcol;i++) {
+                       mat=mesh->mat[i];
+                       if (!mat) break;
+                       if ((mat->shade_flag &= MA_OBCOLOR)) {
+                               bUseObjectColor = true;
+                               break;
+                       }
+               }
+               if (bUseObjectColor)
+                       gameobj->SetObjectColor(ob->col);
        
                // two options exists for deform: shape keys and armature
                // only support relative shape key
index dfc866526eb6ad3324baaaee32751ed198116243..bab4aa14bbdbdb0519761b78278f590c66a83c1d 100644 (file)
@@ -283,6 +283,78 @@ void GPC_RenderTools::applyTransform(RAS_IRasterizer* rasty,double* oglmatrix,in
        }
 }
 
+void GPC_RenderTools::RenderBox2D(int xco,
+                                                                               int yco,
+                                                                               int width,
+                                                                               int height,
+                                                                               float percentage)
+{
+       // Save and change OpenGL settings
+       int texture2D;
+       glGetIntegerv(GL_TEXTURE_2D, (GLint*)&texture2D);
+       glDisable(GL_TEXTURE_2D);
+       int fog;
+       glGetIntegerv(GL_FOG, (GLint*)&fog);
+       glDisable(GL_FOG);
+       
+       int light;
+       glGetIntegerv(GL_LIGHTING, (GLint*)&light);
+       glDisable(GL_LIGHTING);
+       
+       glDisable(GL_DEPTH_TEST);
+       
+       // Set up viewing settings
+       glMatrixMode(GL_PROJECTION);
+       glPushMatrix();
+       glLoadIdentity();
+       glOrtho(0, width, 0, height, -1, 1);
+       glMatrixMode(GL_MODELVIEW);
+       glPushMatrix();
+       glLoadIdentity();
+       
+       yco = height - yco;
+       int barsize = 50;
+       
+       // draw in black first
+       glColor3ub(0, 0, 0);
+       glBegin(GL_QUADS);
+       glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1 + 10);
+       glVertex2f(xco + 1, yco - 1 + 10);
+       glVertex2f(xco + 1, yco - 1);
+       glVertex2f(xco + 1 + 1 + barsize * percentage, yco - 1);
+       glEnd();
+       
+       glColor3ub(255, 255, 255);
+       glBegin(GL_QUADS);
+       glVertex2f(xco + 1 + barsize * percentage, yco + 10);
+       glVertex2f(xco, yco + 10);
+       glVertex2f(xco, yco);
+       glVertex2f(xco + 1 + barsize * percentage, yco);
+       glEnd();
+       
+       // Restore view settings
+       glMatrixMode(GL_PROJECTION);
+       glPopMatrix();
+       glMatrixMode(GL_MODELVIEW);
+       glPopMatrix();
+       
+       // Restore OpenGL Settings
+       if (fog)
+               glEnable(GL_FOG);
+       else
+               glDisable(GL_FOG);
+       
+       if (texture2D)
+               glEnable(GL_TEXTURE_2D);
+       else
+               glDisable(GL_TEXTURE_2D);
+       if (light)
+               glEnable(GL_LIGHTING);
+       else
+               glDisable(GL_LIGHTING);
+}
+
+
 void GPC_RenderTools::RenderText3D(    int fontid,
                                                                        const char* text,
                                                                        int size,
index 1030c09548a4138cb983f28c3c0090c525bc163f..f4dcddd3250111cd2d19ffe662bebbfe1daf4c01 100644 (file)
@@ -70,6 +70,12 @@ public:
        void                            DisableOpenGLLights();
        void                            ProcessLighting(RAS_IRasterizer *rasty, bool uselights, const MT_Transform& viewmat);
 
+       void                            RenderBox2D(int xco,
+                                               int yco,
+                                               int width,
+                                               int height,
+                                               float percentage);
+
        void                            RenderText3D(int fontid,
                                                                         const char* text,
                                                                         int size,
index 0ddac9c897ac58cc1db1dcb064d063c9c503d0d5..23419f11cd53c3a668be43b7079cccae2550c3d9 100644 (file)
@@ -1446,7 +1446,7 @@ void KX_KetsjiEngine::RenderDebugProperties()
        int xcoord = 12;        // mmmm, these constants were taken from blender source
        int ycoord = 17;        // to 'mimic' behavior
        
-       int profile_indent = 64;
+       int profile_indent = 72;
 
        float tottime = m_logger->GetAverage();
        if (tottime < 1e-6f) {
@@ -1481,7 +1481,7 @@ void KX_KetsjiEngine::RenderDebugProperties()
                                            m_canvas->GetWidth() /* RdV, TODO ?? */,
                                            m_canvas->GetHeight() /* RdV, TODO ?? */);
                
-               debugtxt.Format("%5.1fms (%5.1f fps)", tottime * 1000.f, 1.0/tottime);
+               debugtxt.Format("%5.1fms (%.1ffps)", tottime * 1000.f, 1.0/tottime);
                m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
                                            debugtxt.ReadPtr(),
                                            xcoord + const_xindent + profile_indent,
@@ -1504,12 +1504,14 @@ void KX_KetsjiEngine::RenderDebugProperties()
 
                        double time = m_logger->GetAverage((KX_TimeCategory)j);
 
-                       debugtxt.Format("%5.2fms (%2d%%)", time*1000.f, (int)(time/tottime * 100.f));
+                       debugtxt.Format("%5.2fms | %d%%", time*1000.f, (int)(time/tottime * 100.f));
                        m_rendertools->RenderText2D(RAS_IRenderTools::RAS_TEXT_PADDED,
                                                    debugtxt.ReadPtr(),
                                                    xcoord + const_xindent + profile_indent, ycoord,
                                                    m_canvas->GetWidth(),
                                                    m_canvas->GetHeight());
+
+                       m_rendertools->RenderBox2D(xcoord + (int)(2.2 * profile_indent), ycoord, m_canvas->GetWidth(), m_canvas->GetHeight(), time/tottime);
                        ycoord += const_ysize;
                }
        }
index bccda63422294c90f7f330feb46a24995d8c45cd..6131abc06509b3e6030e4fbe122736c0518e9071 100644 (file)
@@ -100,6 +100,22 @@ public:
                double* oglmatrix,
                int drawingmode
        )=0;
+       
+       /**
+        * Renders 2D boxes.
+        * \param xco                   Position on the screen (origin in lower left corner).
+        * \param yco                   Position on the screen (origin in lower left corner).
+        * \param width                 Width of the canvas to draw to.
+        * \param height                Height of the canvas to draw to.
+        * \param percentage    Percentage of bar.
+        */
+       virtual
+               void
+               RenderBox2D(int xco,
+                                       int yco,
+                                       int width,
+                                       int height,
+                                       float percentage) = 0;
 
        /**
         * Renders 3D text string using BFL.