[Bf-blender-cvs] [f4fd5dc] soc-2016-multiview: fix error in ED_space_clip_get_clip_in_region

Tianwei Shen noreply at git.blender.org
Thu Aug 11 19:28:22 CEST 2016


Commit: f4fd5dc6e19864761c8be2465071a7439f10e87c
Author: Tianwei Shen
Date:   Fri Aug 12 01:25:55 2016 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rBf4fd5dc6e19864761c8be2465071a7439f10e87c

fix error in ED_space_clip_get_clip_in_region

didn't consider the case that regiondata may be a NULL pointer. Since
dopesheet and graph are also Movie Editors and they don't have
regiondata. Other drawing code also has this problem, so it is not fully
solved. Will need to initialize regiondata for dopesheet and graph.

===================================================================

M	source/blender/editors/space_clip/clip_editor.c

===================================================================

diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 59f20e2..83d0019 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -588,7 +588,12 @@ MovieClip *ED_space_clip_get_secondary_clip(SpaceClip *sc)
 MovieClip *ED_space_clip_get_clip_in_region(SpaceClip *sc, ARegion *ar)
 {
 	RegionSpaceClip *rsc = ar->regiondata;
-	if (rsc->flag == RSC_MAIN_CLIP) {
+
+	/* dopsheet and graph don't have regiondata, so just return the main clip */
+	if (!rsc) {
+		return ED_space_clip_get_clip(sc);
+	}
+	else if (rsc->flag == RSC_MAIN_CLIP) {
 		return ED_space_clip_get_clip(sc);
 	}
 	else {	//rsc->flag == RSC_SECONDARY_CLIP




More information about the Bf-blender-cvs mailing list