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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-08-06 13:25:24 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-08-06 13:45:03 +0300
commit9843921288307be33fc39450586ff9ad226829a1 (patch)
treede6e0ddd71b48d036bf5525e62edf10a57d3238e /source/blender/editors/space_time
parent4571fdde0ecfdebac6a9374364b05be74233aca5 (diff)
parent28c3bdf50bd62b510fdbd88a5dcb1c40f8726c20 (diff)
Merge branch 'master' into blender2.8
Conflicts: release/scripts/startup/bl_ui/properties_particle.py release/scripts/startup/bl_ui/properties_physics_cloth.py release/scripts/startup/bl_ui/properties_physics_dynamicpaint.py release/scripts/startup/bl_ui/properties_physics_softbody.py source/blender/blenkernel/BKE_library.h source/blender/blenkernel/BKE_particle.h source/blender/blenkernel/intern/cloth.c source/blender/blenkernel/intern/library.c source/blender/blenkernel/intern/library_query.c source/blender/blenkernel/intern/particle_system.c source/blender/blenkernel/intern/scene.c source/blender/blenkernel/intern/softbody.c source/blender/blenloader/intern/readfile.c source/blender/blenloader/intern/versioning_270.c source/blender/editors/space_file/filesel.c source/blender/editors/space_outliner/outliner_intern.h source/blender/makesdna/DNA_ID.h source/blender/makesdna/DNA_object_force.h source/blender/makesdna/DNA_particle_types.h source/blender/makesrna/intern/rna_particle.c source/blender/makesrna/intern/rna_sculpt_paint.c source/blender/makesrna/intern/rna_smoke.c source/blender/makesrna/intern/rna_space.c
Diffstat (limited to 'source/blender/editors/space_time')
-rw-r--r--source/blender/editors/space_time/space_time.c69
1 files changed, 68 insertions, 1 deletions
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index ff9136f3554..46bddc00f0a 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -32,7 +32,10 @@
#include <string.h>
#include <stdio.h>
+#include "DNA_cachefile_types.h"
+#include "DNA_constraint_types.h"
#include "DNA_gpencil_types.h"
+#include "DNA_modifier_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
@@ -42,7 +45,10 @@
#include "BLI_dlrbTree.h"
#include "BLI_utildefines.h"
+#include "BKE_constraint.h"
#include "BKE_context.h"
+#include "BKE_main.h"
+#include "BKE_modifier.h"
#include "BKE_screen.h"
#include "ED_anim_api.h"
@@ -163,6 +169,9 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel)
case ID_GD:
gpencil_to_keylist(&ads, (bGPdata *)id, &keys);
break;
+ case ID_CF:
+ cachefile_to_keylist(&ads, (CacheFile *)id, &keys, NULL);
+ break;
}
/* build linked-list for searching */
@@ -187,6 +196,56 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel)
BLI_dlrbTree_free(&keys);
}
+static void time_draw_caches_keyframes(Main *bmain, Scene *scene, View2D *v2d, bool onlysel)
+{
+ CacheFile *cache_file;
+
+ for (cache_file = bmain->cachefiles.first;
+ cache_file;
+ cache_file = cache_file->id.next)
+ {
+ cache_file->draw_flag &= ~CACHEFILE_KEYFRAME_DRAWN;
+ }
+
+ for (Base *base = scene->base.first; base; base = base->next) {
+ Object *ob = base->object;
+
+ ModifierData *md = modifiers_findByType(ob, eModifierType_MeshSequenceCache);
+
+ if (md) {
+ MeshSeqCacheModifierData *mcmd = (MeshSeqCacheModifierData *)md;
+
+ cache_file = mcmd->cache_file;
+
+ if (!cache_file || (cache_file->draw_flag & CACHEFILE_KEYFRAME_DRAWN) != 0) {
+ continue;
+ }
+
+ cache_file->draw_flag |= CACHEFILE_KEYFRAME_DRAWN;
+
+ time_draw_idblock_keyframes(v2d, (ID *)cache_file, onlysel);
+ }
+
+ for (bConstraint *con = ob->constraints.first; con; con = con->next) {
+ if (con->type != CONSTRAINT_TYPE_TRANSFORM_CACHE) {
+ continue;
+ }
+
+ bTransformCacheConstraint *data = con->data;
+
+ cache_file = data->cache_file;
+
+ if (!cache_file || (cache_file->draw_flag & CACHEFILE_KEYFRAME_DRAWN) != 0) {
+ continue;
+ }
+
+ cache_file->draw_flag |= CACHEFILE_KEYFRAME_DRAWN;
+
+ time_draw_idblock_keyframes(v2d, (ID *)cache_file, onlysel);
+ }
+ }
+}
+
/* draw keyframe lines for timeline */
static void time_draw_keyframes(const bContext *C, ARegion *ar)
{
@@ -197,7 +256,11 @@ static void time_draw_keyframes(const bContext *C, ARegion *ar)
/* set this for all keyframe lines once and for all */
glLineWidth(1.0);
-
+
+ /* draw cache files keyframes (if available) */
+ UI_ThemeColor(TH_TIME_KEYFRAME);
+ time_draw_caches_keyframes(CTX_data_main(C), scene, v2d, onlysel);
+
/* draw grease pencil keyframes (if available) */
UI_ThemeColor(TH_TIME_GP_KEYFRAME);
if (scene->gpd) {
@@ -423,6 +486,10 @@ static void time_main_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa),
break;
}
break;
+ case NC_GPENCIL:
+ if (wmn->data == ND_DATA)
+ ED_region_tag_redraw(ar);
+ break;
}
}