Change to text3d: When back or front is enabled, the bevel rim on the other side...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 14 Jul 2010 17:47:58 +0000 (17:47 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 14 Jul 2010 17:47:58 +0000 (17:47 +0000)
when both are off the behavior is unchanged.

This is needed when rendering alpha text so its possible to have a single layer of faces but use the bevel option to make text thicker.
adding a rim on the back when back is disabled also doesnt make much sense IMHO.

minor python edits too.

doc/blender.1.py
release/scripts/op/console_python.py
source/blender/blenkernel/intern/curve.c
source/blender/python/doc/examples/bpy.data.py

index 576b58758cdc50e0eec0254bc3dcf0d5f81e4c78..05b491cf21ef01ba5a894e5024abdeefe4f1a5e7 100644 (file)
@@ -53,7 +53,7 @@ blender_version = blender_version.split("Build")[0]
 
 date_string = datetime.date.fromtimestamp(time.time()).strftime("%B %d, %Y")
 
-filepath = __file__.replace(".py", "")
+filepath = os.path.splitext(__file__)[0] + ".1"
 
 file = open(filepath, "w")
 
index 83a3130f80e89924aa25d31691c38bf0e55e57e6..d3a90cb7accdc089a7e98a3d02a13c87856d5463 100644 (file)
@@ -68,7 +68,7 @@ def get_console(console_id):
         stderr = io.StringIO()
     else:
         namespace = {'__builtins__': __builtins__, 'bpy': bpy}
-        console = InteractiveConsole(namespace)
+        console = InteractiveConsole(locals=namespace, filename="<blender_console>")
 
         import io
         stdout = io.StringIO()
index 2e645592229cb39e895096477d8070d726b09659..aa7b44aecda04bdff014498e3d3060c09145037c 100644 (file)
@@ -1318,30 +1318,33 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
                short dnr;
                
                /* bevel now in three parts, for proper vertex normals */
-               /* part 1 */
-               dnr= nr= 2+ cu->bevresol;
-               if( (cu->flag & (CU_FRONT|CU_BACK))==0)
-                       nr= 3+ 2*cu->bevresol;
-                  
-               dl= MEM_callocN(sizeof(DispList), "makebevelcurve p1");
-               dl->verts= MEM_mallocN(nr*3*sizeof(float), "makebevelcurve p1");
-               BLI_addtail(disp, dl);
-               dl->type= DL_SEGM;
-               dl->parts= 1;
-               dl->flag= DL_BACK_CURVE;
-               dl->nr= nr;
+               /* part 1, back */
 
-               /* half a circle */
-               fp= dl->verts;
-               dangle= (0.5*M_PI/(dnr-1));
-               angle= -(nr-1)*dangle;
-               
-               for(a=0; a<nr; a++) {
-                       fp[0]= 0.0;
-                       fp[1]= (float)(cos(angle)*(cu->ext2));
-                       fp[2]= (float)(sin(angle)*(cu->ext2)) - cu->ext1;
-                       angle+= dangle;
-                       fp+= 3;
+               if((cu->flag & CU_BACK) || !(cu->flag & CU_FRONT)) {
+                       dnr= nr= 2+ cu->bevresol;
+                       if( (cu->flag & (CU_FRONT|CU_BACK))==0)
+                               nr= 3+ 2*cu->bevresol;
+
+                       dl= MEM_callocN(sizeof(DispList), "makebevelcurve p1");
+                       dl->verts= MEM_mallocN(nr*3*sizeof(float), "makebevelcurve p1");
+                       BLI_addtail(disp, dl);
+                       dl->type= DL_SEGM;
+                       dl->parts= 1;
+                       dl->flag= DL_BACK_CURVE;
+                       dl->nr= nr;
+
+                       /* half a circle */
+                       fp= dl->verts;
+                       dangle= (0.5*M_PI/(dnr-1));
+                       angle= -(nr-1)*dangle;
+
+                       for(a=0; a<nr; a++) {
+                               fp[0]= 0.0;
+                               fp[1]= (float)(cos(angle)*(cu->ext2));
+                               fp[2]= (float)(sin(angle)*(cu->ext2)) - cu->ext1;
+                               angle+= dangle;
+                               fp+= 3;
+                       }
                }
                
                /* part 2, sidefaces */
@@ -1374,30 +1377,32 @@ void makebevelcurve(Scene *scene, Object *ob, ListBase *disp, int forRender)
                        }
                }
                
-               /* part 3 */
-               dnr= nr= 2+ cu->bevresol;
-               if( (cu->flag & (CU_FRONT|CU_BACK))==0)
-                       nr= 3+ 2*cu->bevresol;
-               
-               dl= MEM_callocN(sizeof(DispList), "makebevelcurve p3");
-               dl->verts= MEM_mallocN(nr*3*sizeof(float), "makebevelcurve p3");
-               BLI_addtail(disp, dl);
-               dl->type= DL_SEGM;
-               dl->flag= DL_FRONT_CURVE;
-               dl->parts= 1;
-               dl->nr= nr;
-               
-               /* half a circle */
-               fp= dl->verts;
-               angle= 0.0;
-               dangle= (0.5*M_PI/(dnr-1));
-               
-               for(a=0; a<nr; a++) {
-                       fp[0]= 0.0;
-                       fp[1]= (float)(cos(angle)*(cu->ext2));
-                       fp[2]= (float)(sin(angle)*(cu->ext2)) + cu->ext1;
-                       angle+= dangle;
-                       fp+= 3;
+               /* part 3, front */
+               if((cu->flag & CU_FRONT) || !(cu->flag & CU_BACK)) {
+                       dnr= nr= 2+ cu->bevresol;
+                       if( (cu->flag & (CU_FRONT|CU_BACK))==0)
+                               nr= 3+ 2*cu->bevresol;
+
+                       dl= MEM_callocN(sizeof(DispList), "makebevelcurve p3");
+                       dl->verts= MEM_mallocN(nr*3*sizeof(float), "makebevelcurve p3");
+                       BLI_addtail(disp, dl);
+                       dl->type= DL_SEGM;
+                       dl->flag= DL_FRONT_CURVE;
+                       dl->parts= 1;
+                       dl->nr= nr;
+
+                       /* half a circle */
+                       fp= dl->verts;
+                       angle= 0.0;
+                       dangle= (0.5*M_PI/(dnr-1));
+
+                       for(a=0; a<nr; a++) {
+                               fp[0]= 0.0;
+                               fp[1]= (float)(cos(angle)*(cu->ext2));
+                               fp[2]= (float)(sin(angle)*(cu->ext2)) + cu->ext1;
+                               angle+= dangle;
+                               fp+= 3;
+                       }
                }
        }
 }
index 0c2a463c01be472ac6bdbbc7a4f4bc92d667fac5..fc1145a523fec788b8acab11fff68aadd64bdccf 100644 (file)
@@ -18,7 +18,8 @@ if "Cube" in bpy.data.meshes:
 
 
 # write images into a file next to the blend
-file = open(bpy.data.filepath.replace(".blend", ".txt"), 'w')
+import os
+file = open(os.path.splitext(bpy.data.filepath)[0] + ".txt", 'w')
 
 for image in bpy.data.images:
     file.write("%s %dx%d\n" % (image.filepath, image.size[0], image.size[1]))