diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-08 09:43:08 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-08 09:43:08 +0300 |
commit | 10900f1de816a22a616d9626523d181fb982ec0a (patch) | |
tree | c556ad10debfdfbcef096989e80c7d1267ad5bae /source/blender/editors/animation | |
parent | fac2ca1c7ca26b9e7019d5c3367b1cb758ba8ca4 (diff) |
Graph Editor Drawing Tweaks:
* When there is only a single keyframe for a F-Curve, the handles aren't shown anymore. This looks nicer than the fat orange blobs that appeared
* Tweaked the management of GL_BLEND when drawing animation channels in the Graph Editor in an attempt to fix some of the missing text drawn issues.
* Converted the properties panel to use layout engine + added color selectors
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 3 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_ipo_utils.c | 60 | ||||
-rw-r--r-- | source/blender/editors/animation/drivers.c | 6 |
3 files changed, 30 insertions, 39 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index efbdd505bcb..e8bfbf7fe52 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2200,6 +2200,9 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float UI_icon_draw(offset, ymid, acf->icon(ale)); offset += ICON_WIDTH; } + + /* turn off blending, since not needed anymore... */ + glDisable(GL_BLEND); /* step 4) draw special toggles ................................. * - in Graph Editor, checkboxes for visibility in curves area diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 088fddd2e7e..d707ea0a2c4 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -61,53 +61,24 @@ /* ----------------------- Getter functions ----------------------- */ -/* gets the appropriate icon for the given blocktype */ -// XXX some of these will be depreceated? -int geticon_anim_blocktype(short blocktype) -{ - switch (blocktype) { - case ID_OB: - return ICON_OBJECT_DATA; - case ID_PO: - return ICON_POSE_HLT; - case ID_KE: - return ICON_SHAPEKEY_DATA; - case ID_MA: - return ICON_MATERIAL; - case ID_WO: - return ICON_WORLD; - case ID_CU: - return ICON_CURVE_DATA; - case ID_CA: - return ICON_CAMERA; - case ID_LA: - return ICON_LAMP; - case ID_TE: - return ICON_TEXTURE; - case ID_CO: - return ICON_CONSTRAINT; - case ID_FLUIDSIM: - return ICON_WORLD; // uggh - default: - return 0; // what about blank icon? - } -} - -/* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings) +/* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings), + * and return the icon used for the struct that this property refers to * WARNING: name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.c for details) */ -void getname_anim_fcurve(char *name, ID *id, FCurve *fcu) +int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) { + int icon = 0; + /* sanity checks */ if (name == NULL) - return; + return icon; else if ELEM3(NULL, id, fcu, fcu->rna_path) { if (fcu == NULL) sprintf(name, "<invalid>"); else if (fcu->rna_path == NULL) sprintf(name, "<no path>"); else /* id == NULL */ - BLI_snprintf(name, 128, "%s[%d]", fcu->rna_path, fcu->array_index); + BLI_snprintf(name, 256, "%s[%d]", fcu->rna_path, fcu->array_index); } else { PointerRNA id_ptr, ptr; @@ -182,17 +153,30 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu) /* putting this all together into the buffer */ // XXX we need to check for invalid names... - BLI_snprintf(name, 128, "%s%s (%s)", arrayname, propname, structname); + BLI_snprintf(name, 256, "%s%s (%s)", arrayname, propname, structname); /* free temp name if nameprop is set */ if (free_structname) MEM_freeN(structname); + + + /* Icon for this property's owner: + * use the struct's icon if it is set + */ + icon= RNA_struct_ui_icon(ptr.type); } else { /* invalid path */ - BLI_snprintf(name, 128, "\"%s[%d]\"", fcu->rna_path, fcu->array_index); + BLI_snprintf(name, 256, "\"%s[%d]\"", fcu->rna_path, fcu->array_index); + + /* icon for this should be the icon for the base ID */ + // TODO: or should we just use the error icon? + icon= RNA_struct_ui_icon(id_ptr.type); } } + + /* return the icon that the active data had */ + return icon; } /* ------------------------------- Color Codes for F-Curve Channels ---------------------------- */ diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index c08bf443851..13f38dae6ea 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -148,6 +148,7 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla PropertyRNA *prop; FCurve *fcu; int array_index_max = array_index+1; + int done = 0; /* validate pointer first - exit if failure */ RNA_id_pointer_create(id, &id_ptr); @@ -198,10 +199,13 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla } } } + + /* set the done status */ + done += (fcu != NULL); } /* done */ - return (fcu != NULL); + return done; } /* Main Driver Management API calls: |