Revision: 37556
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37556
Author:   psy-fi
Date:     2011-06-16 15:20:05 +0000 (Thu, 16 Jun 2011)
Log Message:
-----------
merge with trunk -r37554

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37554

Modified Paths:
--------------
    branches/soc-2011-onion/build_files/cmake/Modules/FindOpenEXR.cmake
    branches/soc-2011-onion/release/scripts/startup/bl_operators/nla.py
    branches/soc-2011-onion/source/blender/blenkernel/intern/armature.c
    branches/soc-2011-onion/source/blender/editors/interface/interface.c
    branches/soc-2011-onion/source/blender/editors/space_file/file_draw.c
    branches/soc-2011-onion/source/blender/editors/space_file/file_ops.c
    branches/soc-2011-onion/source/blender/editors/space_file/filelist.c
    branches/soc-2011-onion/source/blender/editors/space_file/filesel.c
    
branches/soc-2011-onion/source/blender/editors/transform/transform_conversions.c
    branches/soc-2011-onion/source/blender/makesdna/DNA_space_types.h
    branches/soc-2011-onion/source/blender/makesrna/RNA_access.h
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_access.c
    branches/soc-2011-onion/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

Property Changed:
----------------
    branches/soc-2011-onion/


Property changes on: branches/soc-2011-onion
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/trunk/blender:36833-37527
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/trunk/blender:36833-37554

Modified: branches/soc-2011-onion/build_files/cmake/Modules/FindOpenEXR.cmake
===================================================================
--- branches/soc-2011-onion/build_files/cmake/Modules/FindOpenEXR.cmake 
2011-06-16 15:18:56 UTC (rev 37555)
+++ branches/soc-2011-onion/build_files/cmake/Modules/FindOpenEXR.cmake 
2011-06-16 15:20:05 UTC (rev 37556)
@@ -1,4 +1,4 @@
-# - Find OpenEXR library (copied from FindTIFF.cmake, v 2.8.5)
+# - Find OpenEXR library
 # Find the native OpenEXR includes and library
 # This module defines
 #  OPENEXR_INCLUDE_DIRS, where to find ImfXdr.h, etc. Set when
@@ -7,6 +7,14 @@
 #  OPENEXR_ROOT_DIR, The base directory to search for OpenEXR.
 #                    This can also be an environment variable.
 #  OPENEXR_FOUND, If false, do not try to use OpenEXR.
+#
+# For indervidual library access these advanced settings are available
+#  OPENEXR_HALF_LIBRARY, Path to Half library
+#  OPENEXR_IEX_LIBRARY, Path to Half library
+#  OPENEXR_ILMIMF_LIBRARY, Path to Ilmimf library
+#  OPENEXR_ILMTHREAD_LIBRARY, Path to IlmThread library
+#  OPENEXR_IMATH_LIBRARY, Path to Imath library
+#
 # also defined, but not for general use are
 #  OPENEXR_LIBRARY, where to find the OpenEXR library.
 
@@ -30,15 +38,18 @@
 
 SET(_openexr_FIND_COMPONENTS
   Half
+  Iex
   IlmImf
-  Iex
+  IlmThread
   Imath
 )
 
 SET(_openexr_SEARCH_DIRS
   ${OPENEXR_ROOT_DIR}
   /usr/local
-  /opt/csw
+  /sw # Fink
+  /opt/local # DarwinPorts
+  /opt/csw # Blastwave
 )
 
 FIND_PATH(OPENEXR_INCLUDE_DIR ImfXdr.h
@@ -54,7 +65,7 @@
 
   FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY NAMES ${COMPONENT}
       HINTS ${_openexr_SEARCH_DIRS}
-      PATH_SUFFIXES lib
+      PATH_SUFFIXES lib64 lib
       )
   LIST(APPEND _openexr_LIBRARIES "${OPENEXR_${UPPERCOMPONENT}_LIBRARY}")
 ENDFOREACH()
@@ -63,14 +74,15 @@
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenEXR  DEFAULT_MSG
-    ${_openexr_LIBRARIES} OPENEXR_INCLUDE_DIR)
+    _openexr_LIBRARIES OPENEXR_INCLUDE_DIR)
 
 IF(OPENEXR_FOUND)
   SET(OPENEXR_LIBRARIES ${_openexr_LIBRARIES})
   SET(OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR})
 ENDIF(OPENEXR_FOUND)
 
-MARK_AS_ADVANCED(
-  ${_openexr_LIBRARIES}
-  OPENEXR_INCLUDE_DIR
-)
+MARK_AS_ADVANCED(OPENEXR_INCLUDE_DIR)
+FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
+  STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+  MARK_AS_ADVANCED(OPENEXR_${UPPERCOMPONENT}_LIBRARY)
+ENDFOREACH()

Modified: branches/soc-2011-onion/release/scripts/startup/bl_operators/nla.py
===================================================================
--- branches/soc-2011-onion/release/scripts/startup/bl_operators/nla.py 
2011-06-16 15:18:56 UTC (rev 37555)
+++ branches/soc-2011-onion/release/scripts/startup/bl_operators/nla.py 
2011-06-16 15:20:05 UTC (rev 37556)
@@ -118,8 +118,10 @@
     # -------------------------------------------------------------------------
     # Create action
 
+    # incase animation data hassnt been created
+    atd = obj.animation_data_create()
     action = bpy.data.actions.new("Action")
-    obj.animation_data.action = action
+    atd.action = action
 
     if do_pose:
         pose_items = pose.bones.items()

Modified: branches/soc-2011-onion/source/blender/blenkernel/intern/armature.c
===================================================================
--- branches/soc-2011-onion/source/blender/blenkernel/intern/armature.c 
2011-06-16 15:18:56 UTC (rev 37555)
+++ branches/soc-2011-onion/source/blender/blenkernel/intern/armature.c 
2011-06-16 15:20:05 UTC (rev 37556)
@@ -1343,8 +1343,12 @@
        cross_v3_v3v3(axis,target,nor);
 
        /* was 0.0000000000001, caused bug [#23954], smaller values give 
unstable
-        * roll when toggling editmode */
-       if (dot_v3v3(axis,axis) > 0.00001f) {
+        * roll when toggling editmode.
+        *
+        * was 0.00001, causes bug [#27675], with 0.00000495,
+        * so a value inbetween these is needed.
+        */
+       if (dot_v3v3(axis,axis) > 0.000001f) {
                /* if nor is *not* a multiple of target ... */
                normalize_v3(axis);
                

Modified: branches/soc-2011-onion/source/blender/editors/interface/interface.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/interface/interface.c        
2011-06-16 15:18:56 UTC (rev 37555)
+++ branches/soc-2011-onion/source/blender/editors/interface/interface.c        
2011-06-16 15:20:05 UTC (rev 37556)
@@ -77,6 +77,10 @@
 #define PRECISION_FLOAT_MAX 7
 #define PRECISION_FLOAT_MAX_POW 10000000 /* pow(10, PRECISION_FLOAT_MAX)  */
 
+/* avoid unneeded calls to ui_get_but_val */
+#define UI_BUT_VALUE_UNSET DBL_MAX
+#define UI_GET_BUT_VALUE_INIT(_but, _value) if(_value == DBL_MAX) {  (_value)= 
ui_get_but_val(_but); }
+
 /* 
  * a full doc with API notes can be found in 
bf-blender/trunk/blender/doc/guides/interface_API.txt
  * 
@@ -967,17 +971,16 @@
 
 /* ************* EVENTS ************* */
 
-static void ui_is_but_sel(uiBut *but)
+static void ui_is_but_sel(uiBut *but, double *value)
 {
-       double value; /* only initialized when needed, to avoid calling when 
not used */
        short push=0, true=1;
 
        if(ELEM3(but->type, TOGN, ICONTOGN, OPTIONN)) true= 0;
 
        if( but->bit ) {
                int lvalue;
-               value= ui_get_but_val(but);
-               lvalue= (int)value;
+               UI_GET_BUT_VALUE_INIT(but, *value)
+               lvalue= (int)*value;
                if( BTST(lvalue, (but->bitnr)) ) push= true;
                else push= !true;
        }
@@ -997,24 +1000,24 @@
                case BUT_TOGDUAL:
                case ICONTOG:
                case OPTION:
-                       value= ui_get_but_val(but);
-                       if(value != (double)but->hardmin) push= 1;
+                       UI_GET_BUT_VALUE_INIT(but, *value)
+                       if(*value != (double)but->hardmin) push= 1;
                        break;
                case ICONTOGN:
                case TOGN:
                case OPTIONN:
-                       value= ui_get_but_val(but);
-                       if(value==0.0) push= 1;
+                       UI_GET_BUT_VALUE_INIT(but, *value)
+                       if(*value==0.0) push= 1;
                        break;
                case ROW:
                case LISTROW:
-                       value= ui_get_but_val(but);
+                       UI_GET_BUT_VALUE_INIT(but, *value)
                        /* support for rna enum buts */
                        if(but->rnaprop && (RNA_property_flag(but->rnaprop) & 
PROP_ENUM_FLAG)) {
-                               if((int)value & (int)but->hardmax) push= 1;
+                               if((int)*value & (int)but->hardmax) push= 1;
                        }
                        else {
-                               if(value == (double)but->hardmax) push= 1;
+                               if(*value == (double)but->hardmax) push= 1;
                        }
                        break;
                case COL:
@@ -1385,6 +1388,10 @@
                                        break;
                        }
                }
+
+               /* we can't be sure what RNA set functions actually do,
+                * so leave this unset */
+               value= UI_BUT_VALUE_UNSET;
        }
        else if(but->pointype==0);
        else if(but->type==HSVSLI ) {
@@ -1425,19 +1432,19 @@
                
                /* then set value with possible edit override */
                if(but->editval)
-                       *but->editval= value;
+                       value= *but->editval= value;
                else if(but->pointype==CHA)
-                       *((char *)but->poin)= (char)value;
+                       value= *((char *)but->poin)= (char)value;
                else if(but->pointype==SHO)
-                       *((short *)but->poin)= (short)value;
+                       value= *((short *)but->poin)= (short)value;
                else if(but->pointype==INT)
-                       *((int *)but->poin)= (int)value;
+                       value= *((int *)but->poin)= (int)value;
                else if(but->pointype==FLO)
-                       *((float *)but->poin)= (float)value;
+                       value= *((float *)but->poin)= (float)value;
        }
 
        /* update select flag */
-       ui_is_but_sel(but);
+       ui_is_but_sel(but, &value);
 }
 
 int ui_get_but_string_max_length(uiBut *but)
@@ -1758,50 +1765,70 @@
 
 void ui_set_but_soft_range(uiBut *but, double value)
 {
-       PropertyType type;
-       double softmin, softmax /*, step, precision*/;
-       
+       /* ideally we would not limit this but practially, its more then
+        * enough worst case is very long vectors wont use a smart soft-range
+        * which isnt so bad. */
+
        if(but->rnaprop) {
-               type= RNA_property_type(but->rnaprop);
+               const PropertyType type= RNA_property_type(but->rnaprop);
+               double softmin, softmax /*, step, precision*/;
+               double value_min= value;
+               double value_max= value;
 
                /* clamp button range to something reasonable in case
                 * we get -inf/inf from RNA properties */
                if(type == PROP_INT) {
                        int imin, imax, istep;
+                       const int array_len= 
RNA_property_array_length(&but->rnapoin, but->rnaprop);
 
                        RNA_property_int_ui_range(&but->rnapoin, but->rnaprop, 
&imin, &imax, &istep);
                        softmin= (imin == INT_MIN)? -1e4: imin;
                        softmax= (imin == INT_MAX)? 1e4: imax;
                        /*step= istep;*/ /*UNUSED*/
                        /*precision= 1;*/ /*UNUSED*/
+
+                       if(array_len >= 2) {
+                               int value_range[2];
+                               RNA_property_int_get_array_range(&but->rnapoin, 
but->rnaprop, value_range);
+                               value_min= (double)value_range[0];
+                               value_max= (double)value_range[1];
+                       }
                }
                else if(type == PROP_FLOAT) {
                        float fmin, fmax, fstep, fprecision;
+                       const int array_len= 
RNA_property_array_length(&but->rnapoin, but->rnaprop);
 
                        RNA_property_float_ui_range(&but->rnapoin, 
but->rnaprop, &fmin, &fmax, &fstep, &fprecision);
                        softmin= (fmin == -FLT_MAX)? (float)-1e4: fmin;
                        softmax= (fmax == FLT_MAX)? (float)1e4: fmax;
                        /*step= fstep;*/ /*UNUSED*/
                        /*precision= fprecision;*/ /*UNUSED*/
+
+                       if(array_len >= 2) {
+                               float value_range[2];
+                               
RNA_property_float_get_array_range(&but->rnapoin, but->rnaprop, value_range);
+                               value_min= (double)value_range[0];
+                               value_max= (double)value_range[1];
+                       }
                }
                else
                        return;
 
                /* if the value goes out of the soft/max range, adapt the range 
*/
-               if(value+1e-10 < softmin) {
-                       if(value < 0.0)
-                               softmin= -soft_range_round_up(-value, -softmin);
+               if(value_min+1e-10 < softmin) {
+                       if(value_min < 0.0)
+                               softmin= -soft_range_round_up(-value_min, 
-softmin);
                        else
-                               softmin= soft_range_round_down(value, softmin);
+                               softmin= soft_range_round_down(value_min, 
softmin);
 
                        if(softmin < (double)but->hardmin)
                                softmin= (double)but->hardmin;
                }
-               else if(value-1e-10 > softmax) {
-                       if(value < 0.0)
-                               softmax= -soft_range_round_down(-value, 
-softmax);
+               else if(value_max-1e-10 > softmax) {
+                       if(value_max < 0.0)
+                               softmax= -soft_range_round_down(-value_max, 
-softmax);
                        else
-                               softmax= soft_range_round_up(value, softmax);
+                               softmax= soft_range_round_up(value_max, 
softmax);
 
                        if(softmax > (double)but->hardmax)

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to