Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-17 01:37:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-17 01:39:17 +0400
commit5b1330e99d5a281efa448b64880dfa24be67d8f2 (patch)
treea56e13396d3f14f00b08ba63622a48f41c2276b9 /source/blender/editors/space_clip/clip_dopesheet_draw.c
parente9227c76d480c5e7973b6bce03cce3ad414b0348 (diff)
Outliner: minor speedup for drawing, avoid 3 rna lookups per object
also for movie-clip dope-sheet
Diffstat (limited to 'source/blender/editors/space_clip/clip_dopesheet_draw.c')
-rw-r--r--source/blender/editors/space_clip/clip_dopesheet_draw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index e85b055bc59..d15a61d6430 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -293,6 +293,7 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
int fontid = style->widget.uifont_id;
int height;
float y;
+ PropertyRNA *chan_prop_lock;
if (!clip)
return;
@@ -355,6 +356,10 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
y = (float) CHANNEL_FIRST;
+ /* get RNA properties (once) */
+ chan_prop_lock = RNA_struct_type_find_property(&RNA_MovieTrackingTrack, "lock");
+ BLI_assert(chan_prop_lock);
+
glEnable(GL_BLEND);
for (channel = dopesheet->channels.first; channel; channel = channel->next) {
float yminc = (float)(y - CHANNEL_HEIGHT_HALF);
@@ -371,9 +376,9 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
RNA_pointer_create(&clip->id, &RNA_MovieTrackingTrack, track, &ptr);
uiBlockSetEmboss(block, UI_EMBOSSN);
- uiDefIconButR(block, ICONTOG, 1, icon,
- v2d->cur.xmax - UI_UNIT_X - CHANNEL_PAD, y - UI_UNIT_Y / 2.0f,
- UI_UNIT_X, UI_UNIT_Y, &ptr, "lock", 0, 0, 0, 0, 0, NULL);
+ uiDefIconButR_prop(block, ICONTOG, 1, icon,
+ v2d->cur.xmax - UI_UNIT_X - CHANNEL_PAD, y - UI_UNIT_Y / 2.0f,
+ UI_UNIT_X, UI_UNIT_Y, &ptr, chan_prop_lock, 0, 0, 0, 0, 0, NULL);
uiBlockSetEmboss(block, UI_EMBOSS);
}