[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28747] branches/soc-2010-kwk: merge 28720 :28746

Konrad Kleine konrad at konradwilhelm.de
Thu May 13 11:43:01 CEST 2010


Revision: 28747
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28747
Author:   kwk
Date:     2010-05-13 11:43:01 +0200 (Thu, 13 May 2010)

Log Message:
-----------
merge 28720:28746

Modified Paths:
--------------
    branches/soc-2010-kwk/release/scripts/modules/bpy/utils.py
    branches/soc-2010-kwk/release/scripts/ui/properties_particle.py
    branches/soc-2010-kwk/release/scripts/ui/properties_physics_cloth.py
    branches/soc-2010-kwk/release/scripts/ui/properties_physics_common.py
    branches/soc-2010-kwk/release/scripts/ui/properties_physics_smoke.py
    branches/soc-2010-kwk/release/scripts/ui/properties_physics_softbody.py
    branches/soc-2010-kwk/release/scripts/ui/space_node.py
    branches/soc-2010-kwk/release/scripts/ui/space_text.py
    branches/soc-2010-kwk/source/blender/blenkernel/intern/anim_sys.c
    branches/soc-2010-kwk/source/blender/blenkernel/intern/pointcache.c
    branches/soc-2010-kwk/source/blender/blenlib/BLI_bpath.h
    branches/soc-2010-kwk/source/blender/blenloader/intern/readfile.c
    branches/soc-2010-kwk/source/blender/editors/animation/anim_filter.c
    branches/soc-2010-kwk/source/blender/editors/include/UI_view2d.h
    branches/soc-2010-kwk/source/blender/editors/interface/view2d.c
    branches/soc-2010-kwk/source/blender/editors/object/object_edit.c
    branches/soc-2010-kwk/source/blender/editors/object/object_intern.h
    branches/soc-2010-kwk/source/blender/editors/object/object_ops.c
    branches/soc-2010-kwk/source/blender/editors/object/object_select.c
    branches/soc-2010-kwk/source/blender/editors/space_graph/graph_draw.c
    branches/soc-2010-kwk/source/blender/editors/space_logic/logic_window.c
    branches/soc-2010-kwk/source/blender/editors/space_node/node_edit.c
    branches/soc-2010-kwk/source/blender/editors/space_node/node_intern.h
    branches/soc-2010-kwk/source/blender/editors/space_node/node_ops.c
    branches/soc-2010-kwk/source/blender/editors/space_node/node_select.c
    branches/soc-2010-kwk/source/blender/editors/space_node/space_node.c
    branches/soc-2010-kwk/source/blender/editors/space_text/space_text.c
    branches/soc-2010-kwk/source/blender/editors/space_view3d/drawvolume.c
    branches/soc-2010-kwk/source/blender/editors/space_view3d/space_view3d.c
    branches/soc-2010-kwk/source/blender/makesdna/DNA_object_types.h
    branches/soc-2010-kwk/source/blender/makesdna/DNA_sensor_types.h
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_actuator.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_object.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_object_force.c
    branches/soc-2010-kwk/source/blender/makesrna/intern/rna_sensor.c
    branches/soc-2010-kwk/source/blender/python/intern/bpy.c

Modified: branches/soc-2010-kwk/release/scripts/modules/bpy/utils.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/modules/bpy/utils.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/modules/bpy/utils.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -27,7 +27,7 @@
 import os as _os
 import sys as _sys
 
-from _bpy import home_paths
+from _bpy import home_paths, blend_paths
 
 
 def _test_import(module_name, loaded_modules):
@@ -332,3 +332,52 @@
     '''
 
     return (_os.path.join(_presets, subdir), )
+
+
+def smpte_from_seconds(time, fps=None):
+    '''
+    Returns an SMPTE formatted string from the time in seconds: "HH:MM:SS:FF".
+
+    If the fps is not given the current scene is used.
+    '''
+    import math
+
+    if fps is None:
+        fps = _bpy.context.scene.render.fps
+
+    hours = minutes = seconds = frames = 0
+
+    if time < 0:
+        time = -time
+        neg = "-"
+    else:
+        neg = ""
+
+    if time >= 3600.0: # hours
+        hours = int(time / 3600.0)
+        time = time % 3600.0
+    if time >= 60.0: # mins
+        minutes = int(time / 60.0)
+        time = time % 60.0
+
+    seconds = int(time)
+    frames= int(round(math.floor( ((time - seconds) * fps))))
+
+    return "%s%02d:%02d:%02d:%02d" % (neg, hours, minutes, seconds, frames)
+    
+
+def smpte_from_frame(frame, fps=None, fps_base=None):
+    '''
+    Returns an SMPTE formatted string from the frame: "HH:MM:SS:FF".
+
+    If the fps and fps_base are not given the current scene is used.
+    '''
+
+    if fps is None:
+        fps = _bpy.context.scene.render.fps
+
+    if fps_base is None:
+        fps_base = _bpy.context.scene.render.fps_base
+
+    return smpte_from_seconds((frame * fps_base) / fps, fps)
+    
\ No newline at end of file

Modified: branches/soc-2010-kwk/release/scripts/ui/properties_particle.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/ui/properties_particle.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/ui/properties_particle.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -269,10 +269,9 @@
         return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
 
     def draw(self, context):
-
         psys = context.particle_system
 
-        point_cache_ui(self, context, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
+        point_cache_ui(self, context, psys.point_cache, True, 'HAIR' if psys.hair_dynamics else 'PSYS')
 
 
 class PARTICLE_PT_velocity(ParticleButtonsPanel):

Modified: branches/soc-2010-kwk/release/scripts/ui/properties_physics_cloth.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/ui/properties_physics_cloth.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/ui/properties_physics_cloth.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -142,7 +142,7 @@
 
     def draw(self, context):
         md = context.cloth
-        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 0, 0)
+        point_cache_ui(self, context, md.point_cache, cloth_panel_enabled(md), 'CLOTH')
 
 
 class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):

Modified: branches/soc-2010-kwk/release/scripts/ui/properties_physics_common.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/ui/properties_physics_common.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/ui/properties_physics_common.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -22,7 +22,8 @@
 
 import bpy
 
-def point_cache_ui(self, context, cache, enabled, particles, smoke):
+#cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc
+def point_cache_ui(self, context, cache, enabled, cachetype):
     layout = self.layout
 
     wide_ui = context.region.width > narrowui
@@ -35,7 +36,7 @@
     col.operator("ptcache.remove", icon='ZOOMOUT', text="")
 
     row = layout.row()
-    if particles:
+    if cachetype in {'PSYS', 'HAIR'}:
         row.prop(cache, "external")
 
     if cache.external:
@@ -53,17 +54,17 @@
         split = layout.split()
         col = split.column(align=True)
 
-        if not particles:
+        if cachetype != 'PSYS':
             col.enabled = enabled
             col.prop(cache, "frame_start")
             col.prop(cache, "frame_end")
-        if not smoke:
+        if cachetype != 'SMOKE':
             col.prop(cache, "step")
 
         if wide_ui:
             col = split.column()
 
-        if not smoke:
+        if cachetype != 'SMOKE':
             sub = col.column()
             sub.enabled = enabled
             sub.prop(cache, "quick_cache")
@@ -102,7 +103,6 @@
         col.operator("ptcache.free_bake_all", text="Free All Bakes")
         col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
 
-
 def effector_weights_ui(self, context, weights):
     layout = self.layout
 

Modified: branches/soc-2010-kwk/release/scripts/ui/properties_physics_smoke.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/ui/properties_physics_smoke.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/ui/properties_physics_smoke.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -166,7 +166,7 @@
         md = context.smoke.domain_settings
         cache = md.point_cache_low
 
-        point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
+        point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
 
 
 class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
@@ -222,7 +222,7 @@
         md = context.smoke.domain_settings
         cache = md.point_cache_high
 
-        point_cache_ui(self, context, cache, (cache.baked is False), 0, 1)
+        point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE')
 
 
 class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):

Modified: branches/soc-2010-kwk/release/scripts/ui/properties_physics_softbody.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/ui/properties_physics_softbody.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/ui/properties_physics_softbody.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -97,7 +97,7 @@
 
     def draw(self, context):
         md = context.soft_body
-        point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 0, 0)
+        point_cache_ui(self, context, md.point_cache, softbody_panel_enabled(md), 'SOFTBODY')
 
 
 class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):

Modified: branches/soc-2010-kwk/release/scripts/ui/space_node.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/ui/space_node.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/ui/space_node.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -108,6 +108,9 @@
         layout.operator("node.select_all")
         layout.operator("node.select_linked_from")
         layout.operator("node.select_linked_to")
+        layout.operator("node.select_same_type")
+        layout.operator("node.select_same_type_next")
+        layout.operator("node.select_same_type_prev")
 
 
 class NODE_MT_node(bpy.types.Menu):

Modified: branches/soc-2010-kwk/release/scripts/ui/space_text.py
===================================================================
--- branches/soc-2010-kwk/release/scripts/ui/space_text.py	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/release/scripts/ui/space_text.py	2010-05-13 09:43:01 UTC (rev 28747)
@@ -274,6 +274,22 @@
         layout.menu("TEXT_MT_edit_to3d")
 
 
+class TEXT_MT_toolbox(bpy.types.Menu):
+    bl_label = ""
+
+    def draw(self, context):
+        layout = self.layout
+        layout.operator_context = 'INVOKE_DEFAULT'
+
+        layout.operator("text.cut")
+        layout.operator("text.copy")
+        layout.operator("text.paste")
+
+        layout.separator()
+        
+        layout.operator("text.run_script")
+
+
 classes = [
     TEXT_HT_header,
     TEXT_PT_properties,
@@ -285,7 +301,8 @@
     TEXT_MT_edit_view,
     TEXT_MT_edit_select,
     TEXT_MT_edit_markers,
-    TEXT_MT_edit_to3d]
+    TEXT_MT_edit_to3d,
+    TEXT_MT_toolbox]
 
 
 def register():

Modified: branches/soc-2010-kwk/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- branches/soc-2010-kwk/source/blender/blenkernel/intern/anim_sys.c	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/source/blender/blenkernel/intern/anim_sys.c	2010-05-13 09:43:01 UTC (rev 28747)
@@ -1805,9 +1805,10 @@
 	 */
 #define EVAL_ANIM_IDS(first, aflag) \
 	for (id= first; id; id= id->next) { \
-		AnimData *adt= BKE_animdata_from_id(id); \
-		if ( (id->us > 1) || (id->us && !(id->flag & LIB_FAKEUSER)) ) \
+		if (ID_REAL_USERS(id) > 0) { \
+			AnimData *adt= BKE_animdata_from_id(id); \
 			BKE_animsys_evaluate_animdata(id, adt, ctime, aflag); \
+		} \
 	}
 	
 	/* optimisation: 

Modified: branches/soc-2010-kwk/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- branches/soc-2010-kwk/source/blender/blenkernel/intern/pointcache.c	2010-05-13 09:22:05 UTC (rev 28746)
+++ branches/soc-2010-kwk/source/blender/blenkernel/intern/pointcache.c	2010-05-13 09:43:01 UTC (rev 28747)
@@ -812,23 +812,27 @@
 	ptcache_file_read(pf, &compressed, 1, sizeof(unsigned char));
 	if(compressed) {
 		ptcache_file_read(pf, &in_len, 1, sizeof(unsigned int));
-		in = (unsigned char *)MEM_callocN(sizeof(unsigned char)*in_len, "pointcache_compressed_buffer");
-		ptcache_file_read(pf, in, in_len, sizeof(unsigned char));
-
+		if(in_len==0) {
+			/* do nothing */
+		}
+		else {
+			in = (unsigned char *)MEM_callocN(sizeof(unsigned char)*in_len, "pointcache_compressed_buffer");
+			ptcache_file_read(pf, in, in_len, sizeof(unsigned char));
 #ifdef WITH_LZO
-		if(compressed == 1)
-				r = lzo1x_decompress(in, (lzo_uint)in_len, result, (lzo_uint *)&out_len, NULL);
+			if(compressed == 1)
+				r = lzo1x_decompress_safe(in, (lzo_uint)in_len, result, (lzo_uint *)&out_len, NULL);
 #endif
 #ifdef WITH_LZMA
-		if(compressed == 2)
-		{
-			size_t leni = in_len, leno = out_len;

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list