[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30287] branches/render25: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/ blender -r30274:30286

Campbell Barton ideasman42 at gmail.com
Wed Jul 14 00:26:46 CEST 2010


Revision: 30287
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30287
Author:   campbellbarton
Date:     2010-07-14 00:26:45 +0200 (Wed, 14 Jul 2010)

Log Message:
-----------
svn merge  https://svn.blender.org/svnroot/bf-blender/trunk/blender -r30274:30286

Modified Paths:
--------------
    branches/render25/release/scripts/ui/properties_data_curve.py
    branches/render25/release/scripts/ui/space_sequencer.py
    branches/render25/source/blender/blenkernel/intern/anim.c
    branches/render25/source/blender/blenkernel/intern/curve.c
    branches/render25/source/blender/blenkernel/intern/font.c
    branches/render25/source/blender/blenkernel/intern/material.c
    branches/render25/source/blender/blenkernel/intern/object.c
    branches/render25/source/blender/blenloader/intern/readfile.c
    branches/render25/source/blender/editors/object/object_add.c
    branches/render25/source/blender/editors/object/object_edit.c
    branches/render25/source/blender/editors/object/object_relations.c
    branches/render25/source/blender/editors/space_outliner/outliner.c
    branches/render25/source/blender/makesdna/DNA_curve_types.h
    branches/render25/source/blender/makesrna/intern/rna_curve.c
    branches/render25/source/blender/makesrna/intern/rna_main_api.c
    branches/render25/source/blender/makesrna/intern/rna_object.c
    branches/render25/source/blender/makesrna/intern/rna_particle.c
    branches/render25/source/blender/makesrna/intern/rna_space.c
    branches/render25/source/blender/makesrna/rna_cleanup/rna_booleans.txt
    branches/render25/source/blender/render/intern/source/pipeline.c

Modified: branches/render25/release/scripts/ui/properties_data_curve.py
===================================================================
--- branches/render25/release/scripts/ui/properties_data_curve.py	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/release/scripts/ui/properties_data_curve.py	2010-07-13 22:26:45 UTC (rev 30287)
@@ -44,7 +44,7 @@
 
     def poll(self, context):
         curve = context.curve
-        return (curve and curve.splines.active)
+        return (curve and type(curve) is not bpy.types.TextCurve and curve.splines.active)
 
 
 class DATA_PT_context_curve(DataButtonsPanel):
@@ -308,10 +308,13 @@
 
         split = layout.split()
 
-        col = split.column(align=True)
-        col.label(text="Underline:")
-        col.prop(text, "ul_position", text="Position")
-        col.prop(text, "ul_height", text="Thickness")
+        col = split.column()
+        colsub = col.column(align=True)
+        colsub.label(text="Underline:")
+        colsub.prop(text, "ul_position", text="Position")
+        colsub.prop(text, "ul_height", text="Thickness")
+        col.label(text="")
+        col.prop(text, "small_caps_scale", text="Small Caps")
 
         if wide_ui:
             col = split.column()
@@ -319,6 +322,7 @@
         col.prop(char, "bold")
         col.prop(char, "italic")
         col.prop(char, "underline")
+        col.prop(char, "use_small_caps")
 #       col.prop(char, "style")
 #       col.prop(char, "wrap")
 

Modified: branches/render25/release/scripts/ui/space_sequencer.py
===================================================================
--- branches/render25/release/scripts/ui/space_sequencer.py	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/release/scripts/ui/space_sequencer.py	2010-07-13 22:26:45 UTC (rev 30287)
@@ -373,7 +373,7 @@
         row.label(text="Final Length: %s" % bpy.utils.smpte_from_frame(strip.frame_final_length))
         row = col.row()
         row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_length)
-        row.label(text="Strip Position: %d" % (frame_current - strip.frame_start))
+        row.label(text="Playhead: %d" % (frame_current - strip.frame_start))
 
         col.label(text="Frame Offset %d:%d" % (strip.frame_offset_start, strip.frame_offset_end))
         col.label(text="Frame Still %d:%d" % (strip.frame_still_start, strip.frame_still_end))

Modified: branches/render25/source/blender/blenkernel/intern/anim.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/anim.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/blenkernel/intern/anim.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -741,7 +741,7 @@
 
 			if(go->ob->transflag & OB_DUPLI) {
 				copy_m4_m4(dob->ob->obmat, dob->mat);
-				object_duplilist_recursive((ID *)group, scene, go->ob, lb, ob->obmat, level+1, animated);
+				object_duplilist_recursive(&group->id, scene, go->ob, lb, ob->obmat, level+1, animated);
 				copy_m4_m4(dob->ob->obmat, dob->omat);
 			}
 		}

Modified: branches/render25/source/blender/blenkernel/intern/curve.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/curve.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/blenkernel/intern/curve.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -138,6 +138,7 @@
 	cu->fsize= 1.0;
 	cu->ulheight = 0.05;	
 	cu->texflag= CU_AUTOSPACE;
+	cu->smallcaps_scale= 0.75f;
 	cu->twist_mode= CU_TWIST_MINIMUM;	// XXX: this one seems to be the best one in most cases, at least for curve deform...
 	
 	cu->bb= unit_boundbox();

Modified: branches/render25/source/blender/blenkernel/intern/font.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/font.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/blenkernel/intern/font.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -1,4 +1,4 @@
-/*  font.c     
+/*  font.c
  *  
  * 
  * $Id$
@@ -34,6 +34,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include <wchar.h>
+#include <wctype.h>
 
 #include "MEM_guardedalloc.h"
 
@@ -597,9 +598,23 @@
 			}
 			bezt2 = nu2->bezt;
 
+			if(info->flag & CU_SMALLCAPS) {
+				const float sca= cu->smallcaps_scale;
+				for (i= nu2->pntsu; i > 0; i--) {
+					fp= bezt2->vec[0];
+					fp[0] *= sca;
+					fp[1] *= sca;
+					fp[3] *= sca;
+					fp[4] *= sca;
+					fp[6] *= sca;
+					fp[7] *= sca;
+					bezt2++;
+				}
+			}
+			bezt2 = nu2->bezt;
+
 			for (i= nu2->pntsu; i > 0; i--) {
 				fp= bezt2->vec[0];
-
 				fp[0]= (fp[0]+ofsx)*fsize;
 				fp[1]= (fp[1]+ofsy)*fsize;
 				fp[3]= (fp[3]+ofsx)*fsize;
@@ -635,6 +650,20 @@
 	}
 }
 
+static float char_width(Curve *cu, VChar *che, CharInfo *info)
+{
+	// The character wasn't found, propably ascii = 0, then the width shall be 0 as well
+	if(che == NULL) {
+		return 0.0f;
+	}
+	else if(info->flag & CU_SMALLCAPS) {
+		return che->width * cu->smallcaps_scale;
+	}
+	else {
+		return che->width;
+	}
+}
+
 struct chartrans *BKE_text_to_curve(Scene *scene, Object *ob, int mode) 
 {
 	VFont *vfont, *oldvfont;
@@ -729,8 +758,18 @@
 	makebreak:
 		// Characters in the list
 		che = vfd->characters.first;
+		info = &(custrinfo[i]);
 		ascii = mem[i];
-		info = &(custrinfo[i]);
+		if(info->flag & CU_SMALLCAPS) {
+			ascii = towupper(ascii);
+			if(mem[i] != ascii) {
+				mem[i]= ascii;
+			}
+			else {
+				info->flag &= ~CU_SMALLCAPS; /* could have a different way to not scale caps */
+			}
+		}
+
 		vfont = which_vfont(cu, info);
 		
 		if(vfont==NULL) break;
@@ -780,11 +819,7 @@
 			return 0;
 		}
 
-		// The character wasn't found, propably ascii = 0, then the width shall be 0 as well
-		if(!che)
-			twidth = 0;
-		else
-			twidth = che->width;
+		twidth = char_width(cu, che, info);
 
 		// Calculate positions
 		if((tb->w != 0.0) && (ct->dobreak==0) && ((xof-(tb->x/cu->fsize)+twidth)*cu->fsize) > tb->w) {
@@ -881,10 +916,7 @@
 			else wsfac = 1.0;
 			
 			// Set the width of the character
-			if(!che)
-				twidth = 0;
-			else 
-				twidth = che->width;
+			twidth = char_width(cu, che, info);
 
 			xof += (twidth*wsfac*(1.0+(info->kern/40.0)) ) + xtrax;
 			
@@ -1024,10 +1056,7 @@
 					che = che->next;
 				}
 	
-				if(che)
-					twidth = che->width;
-				else
-					twidth = 0;
+				twidth = char_width(cu, che, info);
 				
 				dtime= distfac*0.35f*twidth;	/* why not 0.5? */
 				dtime= distfac*0.5f*twidth;	/* why not 0.5? */
@@ -1167,8 +1196,8 @@
 							break;
 						che = che->next;
 					}
-					
-					if(!che) twidth =0; else twidth=che->width;
+
+					twidth = char_width(cu, che, info);
 					ulwidth = cu->fsize * ((twidth* (1.0+(info->kern/40.0)))+uloverlap);
 					build_underline(cu, ct->xof*cu->fsize, ct->yof*cu->fsize + (cu->ulpos-0.05)*cu->fsize, 
 									ct->xof*cu->fsize + ulwidth, 

Modified: branches/render25/source/blender/blenkernel/intern/material.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/material.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/blenkernel/intern/material.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -211,7 +211,7 @@
 #if 0 // XXX old animation system
 	id_us_plus((ID *)man->ipo);
 #endif // XXX old animation system
-	id_us_plus((ID *)man->group);
+	id_lib_extern((ID *)man->group);
 	
 	for(a=0; a<MAX_MTEX; a++) {
 		if(ma->mtex[a]) {

Modified: branches/render25/source/blender/blenkernel/intern/object.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/object.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/blenkernel/intern/object.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -283,7 +283,6 @@
 	ob->path= 0;
 	if(ob->adt) BKE_free_animdata((ID *)ob);
 	if(ob->poselib) ob->poselib->id.us--;
-	if(ob->dup_group) ob->dup_group->id.us--;
 	if(ob->gpd) ob->gpd->id.us--;
 	if(ob->defbase.first)
 		BLI_freelistN(&ob->defbase);
@@ -1326,7 +1325,7 @@
 
 	/* increase user numbers */
 	id_us_plus((ID *)obn->data);
-	id_us_plus((ID *)obn->dup_group);
+	id_lib_extern((ID *)obn->dup_group);
 	
 
 	for(a=0; a<obn->totcol; a++) id_us_plus((ID *)obn->mat[a]);

Modified: branches/render25/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/render25/source/blender/blenloader/intern/readfile.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/blenloader/intern/readfile.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -11097,6 +11097,13 @@
 				tex->saturation= 1.0f;
 		}
 
+		{
+			Curve *cu;
+			for(cu= main->curve.first; cu; cu= cu->id.next) {
+				cu->smallcaps_scale= 0.75f;
+			}
+		}
+
 		for (scene= main->scene.first; scene; scene=scene->id.next) {
 			if(scene) {
 				Sequence *seq;

Modified: branches/render25/source/blender/editors/object/object_add.c
===================================================================
--- branches/render25/source/blender/editors/object/object_add.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/editors/object/object_add.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -754,9 +754,8 @@
 		rename_id(&ob->id, group->id.name+2);
 		ob->dup_group= group;
 		ob->transflag |= OB_DUPLIGROUP;
-		id_us_plus(&group->id);
+		id_lib_extern(&group->id);
 
-
 		WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob);
 
 		return OPERATOR_FINISHED;
@@ -1009,6 +1008,7 @@
 	DAG_scene_sort(scene);
 	DAG_ids_flush_update(0);
 	WM_event_add_notifier(C, NC_SCENE, scene);
+	WM_main_add_notifier(NC_OBJECT|ND_DRAW, NULL);
 	
 	return OPERATOR_FINISHED;
 }

Modified: branches/render25/source/blender/editors/object/object_edit.c
===================================================================
--- branches/render25/source/blender/editors/object/object_edit.c	2010-07-13 22:21:59 UTC (rev 30286)
+++ branches/render25/source/blender/editors/object/object_edit.c	2010-07-13 22:26:45 UTC (rev 30287)
@@ -1408,7 +1408,7 @@
 
 					base->object->dup_group= ob->dup_group;
 					if(ob->dup_group)
-						id_us_plus((ID *)ob->dup_group);
+						id_lib_extern(&ob->dup_group->id);
 				}
 				else if(event==7) {	/* mass */
 					base->object->mass= ob->mass;

Modified: branches/render25/source/blender/editors/object/object_relations.c
===================================================================

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list