* Partially converted constraint template to layout engine

* Removed old code
This commit is contained in:
Matt Ebb 2010-01-28 23:41:34 +00:00
parent 21b7556bf7
commit cb499c9df4
5 changed files with 11 additions and 75 deletions

@ -791,8 +791,7 @@ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
pix_in= ibuf->rect_float;
pix_out= tmpbuf->rect_float;
// pixc= (char *)ibuf->rect;
if(ibuf->channels)
stride= ibuf->channels;
@ -818,7 +817,6 @@ void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
SWAP(unsigned int *, tmpbuf->rect, ibuf->rect);
IMB_freeImBuf(tmpbuf);
curvemapping_premultiply(cumap, 1);
}

@ -106,7 +106,6 @@ struct bConstraint *get_active_constraint(struct Object *ob);
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);

@ -934,18 +934,6 @@ static void constraint_active_func(bContext *C, void *ob_v, void *con_v)
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 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
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,13 +1073,10 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
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, "");
// XXX uiBlockSetCol(block, TH_AUTO);
uiItemL(subrow, con->name, 0);
subrow= uiLayoutRow(row, 0);
uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT);

@ -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 @@ static void image_verify_buffer_float(SpaceImage *sima, Image *ima, ImBuf *ibuf,
if(ibuf->rect_float) {
if(ibuf->rect==NULL) {
if(image_curves_active(sima)) {
curvemapping_do_ibuf(sima->cumap, ibuf);
}
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);
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);
}
}
}

@ -1850,10 +1850,10 @@ void RNA_def_constraint(BlenderRNA *brna)
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);