Revision: 26381
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26381
Author:   broken
Date:     2010-01-29 00:41:34 +0100 (Fri, 29 Jan 2010)

Log Message:
-----------
* Partially converted constraint template to layout engine
* Removed old code

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/colortools.c
    trunk/blender/source/blender/editors/include/ED_object.h
    trunk/blender/source/blender/editors/interface/interface_templates.c
    trunk/blender/source/blender/editors/space_image/image_draw.c
    trunk/blender/source/blender/makesrna/intern/rna_constraint.c

Modified: trunk/blender/source/blender/blenkernel/intern/colortools.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/colortools.c 2010-01-28 
22:23:56 UTC (rev 26380)
+++ trunk/blender/source/blender/blenkernel/intern/colortools.c 2010-01-28 
23:41:34 UTC (rev 26381)
@@ -791,8 +791,7 @@
        
        pix_in= ibuf->rect_float;
        pix_out= tmpbuf->rect_float;
-//     pixc= (char *)ibuf->rect;
-       
+
        if(ibuf->channels)
                stride= ibuf->channels;
        
@@ -818,7 +817,6 @@
        SWAP(unsigned int *, tmpbuf->rect, ibuf->rect);
        IMB_freeImBuf(tmpbuf);
        
-       
        curvemapping_premultiply(cumap, 1);
 }
 

Modified: trunk/blender/source/blender/editors/include/ED_object.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_object.h    2010-01-28 
22:23:56 UTC (rev 26380)
+++ trunk/blender/source/blender/editors/include/ED_object.h    2010-01-28 
23:41:34 UTC (rev 26381)
@@ -106,7 +106,6 @@
 
 void object_test_constraints(struct Object *ob);
 
-void ED_object_constraint_rename(struct Object *ob, struct bConstraint *con, 
char *oldname);
 void ED_object_constraint_set_active(struct Object *ob, struct bConstraint 
*con);
 void ED_object_constraint_update(struct Object *ob);
 void ED_object_constraint_dependency_update(struct Scene *scene, struct Object 
*ob);

Modified: trunk/blender/source/blender/editors/interface/interface_templates.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_templates.c        
2010-01-28 22:23:56 UTC (rev 26380)
+++ trunk/blender/source/blender/editors/interface/interface_templates.c        
2010-01-28 23:41:34 UTC (rev 26381)
@@ -934,18 +934,6 @@
        ED_object_constraint_set_active(ob_v, con_v);
 }
 
-static void verify_constraint_name_func (bContext *C, void *con_v, void *dummy)
-{
-       Object *ob= CTX_data_active_object(C);
-       bConstraint *con= con_v;
-       
-       if (!con)
-               return;
-       
-       ED_object_constraint_rename(ob, con, NULL);
-       ED_object_constraint_set_active(ob, con);
-       // XXX allqueue(REDRAWACTION, 0); 
-}
 
 /* some commonly used macros in the constraints drawing code */
 #define is_armature_target(target) (target && target->type==OB_ARMATURE)
@@ -1074,7 +1062,7 @@
        rb_col= (con->flag & CONSTRAINT_ACTIVE)?50:20;
        
        /* open/close */
-       uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, B_CONSTRAINT_TEST, 
ICON_TRIA_RIGHT, xco-10, yco, 20, 20, &con->flag, 0.0, 0.0, 0.0, 0.0, 
"Collapse/Expand Constraint");
+       uiItemR(subrow, NULL, 0, &ptr, "expand", UI_ITEM_R_ICON_ONLY);
        
        /* name */      
        uiBlockSetEmboss(block, UI_EMBOSS);
@@ -1085,14 +1073,11 @@
        uiDefBut(block, LABEL, B_CONSTRAINT_TEST, typestr, xco+10, yco, 100, 
18, NULL, 0.0, 0.0, 0.0, 0.0, ""); 
        
        if(proxy_protected == 0) {
-               but = uiDefBut(block, TEX, B_CONSTRAINT_TEST, "", xco+120, yco, 
85, 18, con->name, 0.0, 29.0, 0.0, 0.0, "Constraint name"); 
-               uiButSetFunc(but, verify_constraint_name_func, con, con->name);
+               uiItemR(subrow, "", 0, &ptr, "name", 0);
        }
        else
-               uiDefBut(block, LABEL, B_CONSTRAINT_TEST, con->name, xco+120, 
yco-1, 135, 19, NULL, 0.0, 0.0, 0.0, 0.0, ""); 
+               uiItemL(subrow, con->name, 0);
 
-       // XXX uiBlockSetCol(block, TH_AUTO);   
-
        subrow= uiLayoutRow(row, 0);
        uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);
        

Modified: trunk/blender/source/blender/editors/space_image/image_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_draw.c       
2010-01-28 22:23:56 UTC (rev 26380)
+++ trunk/blender/source/blender/editors/space_image/image_draw.c       
2010-01-28 23:41:34 UTC (rev 26381)
@@ -68,47 +68,6 @@
 
 #define HEADER_HEIGHT 18
 
-#if 0
-static int image_preview_active(SpaceImage *sima, Scene *scene, float *xim, 
float *yim)
-{
-       /* only when compositor shows, and image handler set */
-       if(sima->image && sima->image->type==IMA_TYPE_COMPOSITE) {
-               /* XXX panels .. */
-#if 0
-               short a;
-       
-               for(a=0; a<SPACE_MAXHANDLER; a+=2) {
-                       if(sima->blockhandler[a] == IMAGE_HANDLER_PREVIEW) {
-                               if(xim) *xim= (scene->r.size*scene->r.xsch)/100;
-                               if(yim) *yim= (scene->r.size*scene->r.ysch)/100;
-                               return 1;
-                       }
-               }
-#endif
-       }
-       return 0;
-}
-#endif
-
-/* are there curves? curves visible? and curves do something? */
-static int image_curves_active(SpaceImage *sima)
-{
-       if(sima->cumap) {
-               if(curvemapping_RGBA_does_something(sima->cumap)) {
-                       /* XXX panels .. */
-#if 0
-                       short a;
-                       for(a=0; a<SPACE_MAXHANDLER; a+=2) {
-                               if(sima->blockhandler[a] == 
IMAGE_HANDLER_CURVES)
-                                       return 1;
-                       }
-#endif
-               }
-       }
-
-       return 0;
-}
-
 static void image_verify_buffer_float(SpaceImage *sima, Image *ima, ImBuf 
*ibuf, int color_manage)
 {
        /* detect if we need to redo the curve map.
@@ -120,18 +79,13 @@
 
        if(ibuf->rect_float) {
                if(ibuf->rect==NULL) {
-                       if(image_curves_active(sima)) {
-                               curvemapping_do_ibuf(sima->cumap, ibuf);
+                       if (color_manage) {
+                                       if (ima && ima->source == 
IMA_SRC_VIEWER)
+                                               ibuf->profile = 
IB_PROFILE_LINEAR_RGB;
+                       } else {
+                               ibuf->profile = IB_PROFILE_NONE;
                        }
-                       else {
-                               if (color_manage) {
-                                               if (ima && ima->source == 
IMA_SRC_VIEWER)
-                                                       ibuf->profile = 
IB_PROFILE_LINEAR_RGB;
-                               } else {
-                                       ibuf->profile = IB_PROFILE_NONE;
-                               }
-                               IMB_rect_from_float(ibuf);
-                       }
+                       IMB_rect_from_float(ibuf);
                }
        }
 }

Modified: trunk/blender/source/blender/makesrna/intern/rna_constraint.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_constraint.c       
2010-01-28 22:23:56 UTC (rev 26380)
+++ trunk/blender/source/blender/makesrna/intern/rna_constraint.c       
2010-01-28 23:41:34 UTC (rev 26381)
@@ -1850,10 +1850,10 @@
        RNA_def_property_ui_text(prop, "Target Space", "Space that target is 
evaluated in.");
 
        /* flags */
-               // XXX do we want to wrap this?
        prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND);
        RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is 
expanded in UI.");
+       RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1);
        
                // XXX this is really an internal flag, but it may be useful 
for some tools to be able to access this...
        prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to