[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29791] branches/render25: Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/ blender -r29775:29790

Campbell Barton ideasman42 at gmail.com
Tue Jun 29 15:22:28 CEST 2010


Revision: 29791
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29791
Author:   campbellbarton
Date:     2010-06-29 15:22:28 +0200 (Tue, 29 Jun 2010)

Log Message:
-----------
Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender  -r29775:29790

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_object.py
    branches/render25/source/blender/blenloader/intern/readfile.c
    branches/render25/source/blender/editors/interface/interface_handlers.c
    branches/render25/source/blender/editors/mesh/editmesh_tools.c
    branches/render25/source/blender/editors/sculpt_paint/paint_image.c
    branches/render25/source/blender/makesrna/rna_cleanup/rna_cleaner.py

Property Changed:
----------------
    branches/render25/source/blender/makesrna/rna_cleanup/rna_api_cleanup.txt
    branches/render25/source/blender/makesrna/rna_cleanup/rna_booleans.txt
    branches/render25/source/blender/makesrna/rna_cleanup/rna_cleaner.py

Modified: branches/render25/release/scripts/ui/properties_object.py
===================================================================
--- branches/render25/release/scripts/ui/properties_object.py	2010-06-29 13:20:11 UTC (rev 29790)
+++ branches/render25/release/scripts/ui/properties_object.py	2010-06-29 13:22:28 UTC (rev 29791)
@@ -212,7 +212,7 @@
         col.prop(ob, "draw_name", text="Name")
         col.prop(ob, "draw_axis", text="Axis")
         col.prop(ob, "draw_wire", text="Wire")
-        col.prop(ob, "color", text="")
+        col.prop(ob, "color", text="Object Color")
 
         if wide_ui:
             col = split.column()

Modified: branches/render25/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/render25/source/blender/blenloader/intern/readfile.c	2010-06-29 13:20:11 UTC (rev 29790)
+++ branches/render25/source/blender/blenloader/intern/readfile.c	2010-06-29 13:22:28 UTC (rev 29791)
@@ -4618,6 +4618,7 @@
 		if(sc->id.flag & LIB_NEEDLINK) {
 			sc->id.us= 1;
 			sc->scene= newlibadr(fd, sc->id.lib, sc->scene);
+			sc->animtimer= NULL; /* saved in rare cases */
 			
 			sa= sc->areabase.first;
 			while(sa) {

Modified: branches/render25/source/blender/editors/interface/interface_handlers.c
===================================================================
--- branches/render25/source/blender/editors/interface/interface_handlers.c	2010-06-29 13:20:11 UTC (rev 29790)
+++ branches/render25/source/blender/editors/interface/interface_handlers.c	2010-06-29 13:22:28 UTC (rev 29791)
@@ -24,6 +24,7 @@
  */
 
 #include <float.h>
+#include <limits.h>
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
@@ -2223,7 +2224,6 @@
 	softmax= but->softmax;
 	softrange= softmax - softmin;
 
-
 	if(ui_is_a_warp_but(but)) {
 		/* Mouse location isn't screen clamped to the screen so use a linear mapping
 		 * 2px == 1-int, or 1px == 1-ClickStep */
@@ -2283,15 +2283,18 @@
 		/* Use a non-linear mapping of the mouse drag especially for large floats (normal behavior) */
 		deler= 500;
 		if(!ui_is_but_float(but)) {
-			if((softrange)<100) deler= 200.0;
-			if((softrange)<25) deler= 50.0;
+			/* prevent large ranges from getting too out of control */
+			if (softrange > 600) deler = powf(softrange, 0.75);
+			
+			if (softrange < 100) deler= 200.0;
+			if (softrange < 25) deler= 50.0;
 		}
 		deler /= fac;
 
-		if(ui_is_but_float(but) && softrange > 11) {
+		if(softrange > 11) {
 			/* non linear change in mouse input- good for high precicsion */
 			data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabs(data->dragstartx-mx)*0.002);
-		} else if (!ui_is_but_float(but) && softrange > 129) { /* only scale large int buttons */
+		} else if (softrange > 129) { /* only scale large int buttons */
 			/* non linear change in mouse input- good for high precicsionm ints need less fine tuning */
 			data->dragf+= (((float)(mx-data->draglastx))/deler) * (fabs(data->dragstartx-mx)*0.004);
 		} else {
@@ -2299,8 +2302,7 @@
 			data->dragf+= ((float)(mx-data->draglastx))/deler ;
 		}
 	
-		if(data->dragf>1.0) data->dragf= 1.0;
-		if(data->dragf<0.0) data->dragf= 0.0;
+		CLAMP(data->dragf, 0.0, 1.0);
 		data->draglastx= mx;
 		tempf= (softmin + data->dragf*softrange);
 
@@ -2312,7 +2314,7 @@
 
 			CLAMP(temp, softmin, softmax);
 			lvalue= (int)data->value;
-
+			
 			if(temp != lvalue) {
 				data->dragchange= 1;
 				data->value= (double)temp;

Modified: branches/render25/source/blender/editors/mesh/editmesh_tools.c
===================================================================
--- branches/render25/source/blender/editors/mesh/editmesh_tools.c	2010-06-29 13:20:11 UTC (rev 29790)
+++ branches/render25/source/blender/editors/mesh/editmesh_tools.c	2010-06-29 13:22:28 UTC (rev 29791)
@@ -1030,7 +1030,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
 	/* props */
-	RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, INT_MAX);
+	RNA_def_int(ot->srna, "steps", 9, 0, INT_MAX, "Steps", "Steps", 0, 128);
 	RNA_def_boolean(ot->srna, "dupli", 0, "Dupli", "Make Duplicates");
 	RNA_def_float(ot->srna, "degrees", 90.0f, -FLT_MAX, FLT_MAX, "Degrees", "Degrees", -360.0f, 360.0f);
 

Modified: branches/render25/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/render25/source/blender/editors/sculpt_paint/paint_image.c	2010-06-29 13:20:11 UTC (rev 29790)
+++ branches/render25/source/blender/editors/sculpt_paint/paint_image.c	2010-06-29 13:22:28 UTC (rev 29791)
@@ -3552,16 +3552,18 @@
 	cp[3]= mfac*cp1[3] + fac*cp2[3];
 }
 
-static void blend_color_mix_rgb(unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac)
+static void blend_color_mix_accum(unsigned char *cp, const unsigned char *cp1, const unsigned char *cp2, const int fac)
 {
 	/* this and other blending modes previously used >>8 instead of /255. both
 	   are not equivalent (>>8 is /256), and the former results in rounding
 	   errors that can turn colors black fast after repeated blending */
 	const int mfac= 255-fac;
+	const int alpha= cp1[3] + ((fac * cp2[3]) / 255);
 
 	cp[0]= (mfac*cp1[0]+fac*cp2[0])/255;
 	cp[1]= (mfac*cp1[1]+fac*cp2[1])/255;
 	cp[2]= (mfac*cp1[2]+fac*cp2[2])/255;
+	cp[3]= alpha > 255 ? 255 : alpha;
 }
 
 static void do_projectpaint_clone(ProjPaintState *ps, ProjPixel *projPixel, float *rgba, float alpha, float mask)
@@ -3732,7 +3734,8 @@
 				bicubic_interpolation_color(ps->reproject_ibuf, projPixel->newColor.ch, NULL, projPixel->projCoSS[0], projPixel->projCoSS[1]);
 				if(projPixel->newColor.ch[3]) {
 					mask = ((float)projPixel->mask)/65535.0f;
-					blend_color_mix_rgb(projPixel->pixel.ch_pt,  projPixel->origColor.ch, projPixel->newColor.ch, (mask*projPixel->newColor.ch[3]));
+					blend_color_mix_accum(projPixel->pixel.ch_pt,  projPixel->origColor.ch, projPixel->newColor.ch, (mask*projPixel->newColor.ch[3]));
+
 				}
 			}
 		}


Property changes on: branches/render25/source/blender/makesrna/rna_cleanup/rna_api_cleanup.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native


Property changes on: branches/render25/source/blender/makesrna/rna_cleanup/rna_booleans.txt
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: branches/render25/source/blender/makesrna/rna_cleanup/rna_cleaner.py
===================================================================
--- branches/render25/source/blender/makesrna/rna_cleanup/rna_cleaner.py	2010-06-29 13:20:11 UTC (rev 29790)
+++ branches/render25/source/blender/makesrna/rna_cleanup/rna_cleaner.py	2010-06-29 13:22:28 UTC (rev 29791)
@@ -158,11 +158,7 @@
     """
     If the file is *.py, the script assumes it contains a python list (as "rna_api=[...]")
     This means that this script executes the text in the py file with an exec(text).
-    """
-    file=open(input_filename,'r')
-    file_text=file.read()
-    file.close()
-    
+    """    
     # adds the list "rna_api" to this function's scope
     rna_api = __import__(input_filename[:-3]).rna_api
 
@@ -177,7 +173,7 @@
     return (rna_api,props_length_max)
 
 
-def read_file(input_filename):
+def get_props(input_filename):
     if input_filename[-4:] == '.txt':
         props_list,props_length_max = get_props_from_txt(input_filename)
     elif input_filename[-3:] == '.py':
@@ -210,7 +206,7 @@
       * rna_api.py: unformatted, just as final output
     """
 
-    # horrible :) will use os.path more properly, I'm being lazy
+    # if needed will use os.path
     if input_filename[-4:] == '.txt':
         if input_filename[-9:] == '_work.txt':
             base_filename = input_filename[:-9]
@@ -228,21 +224,25 @@
 
     # reminder: props=[comment, changed, bclass, bfrom, bto, kwcheck, btype, description]
     # [comment *] ToolSettings.snap_align_rotation -> use_snap_align_rotation:    boolean    [Align rotation with the snapping target]
-    rna = '#    "NOTE", "CHANGED", "CLASS", "FROM", "TO", "KEYWORD-CHECK", "TYPE", "DESCRIPTION" \n'
-    py = '#    "NOTE"                     , "CHANGED", "CLASS"                       , "FROM"                              , "TO"                                , "KEYWORD-CHECK"            , "TYPE"    , "DESCRIPTION" \n'
-    txt = 'NOTE * CLASS.FROM -> TO:   TYPE  DESCRIPTION \n'
+    rna = py = txt = ''
+    props_list = [['NOTE', 'CHANGED', 'CLASS', 'FROM', 'TO', 'KEYWORD-CHECK', 'TYPE', 'DESCRIPTION']] + props_list
     for props in props_list:
         #txt
-        txt +=  '%s * %s.%s -> %s:   %s  %s\n' % tuple(props[:1] + props[2:5] + props[6:]) # awful I'll do it smarter later
+        if props[0] != '': txt +=  '%s * ' % props[0]   # comment
+        txt +=  '%s.%s -> %s:   %s  %s\n' % tuple(props[2:5] + props[6:])   # skipping keyword-check
         # rna_api
-        rna += '    ("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s"),\n' % tuple(props)    
+        if props[0] == 'NOTE': indent = '#   '
+        else: indent = '    '
+        rna += indent + '("%s", "%s", "%s", "%s", "%s"),\n' % tuple(props[2:5] + props[6:])    
         # py
+        if props[0] == 'NOTE': indent = '#   '
+        else: indent = '    '
         blanks = [' '* (x[0]-x[1]) for x in zip(props_length_max,list(map(len,props)))]
         props = ['"%s"%s'%(x[0],x[1]) for x in zip(props,blanks)]
-        py += '    (%s, %s, %s, %s, %s, %s, %s, %s),\n' % tuple(props)
+        py += indent + '(%s, %s, %s, %s, %s, %s, %s, %s),\n' % tuple(props)
     f_txt.write(txt)
-    f_py.write("rna_api = [\n%s    ]\n" % py)
-    f_rna.write("rna_api = [\n%s    ]\n" % rna)
+    f_py.write("rna_api = [\n%s]\n" % py)
+    f_rna.write("rna_api = [\n%s]\n" % rna)
 
     print ('\nSaved %s, %s and %s.\n' % (font_bold(f_txt.name), font_bold(f_py.name), font_bold(f_rna.name) ) )
 
@@ -255,11 +255,11 @@
 
     sort_choices = ['note','changed','class','from','to','kw']
     default_sort_choice = sort_choices[0]
-    kw_prefixes = ['invert','is','lock','show','show_only','use','use_only']
-    kw = ['hide', 'select', 'layer', 'state']
+    kw_prefixes = ['invert','is','lock','show','showonly','use','useonly']
+    kw = ['hidden','selected','layer','state']
 
     input_filename, sort_priority = check_commandline()
-    props_list,props_length_max = read_file(input_filename)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list