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
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2015-08-19 09:37:58 +0300
committerDalai Felinto <dfelinto@gmail.com>2015-08-19 09:41:02 +0300
commitbb479704d06218b94de431b60eb47ee15bf62c98 (patch)
tree1bf1b0a7157f726c515b771b72e8c36c9772c086 /source
parentcd8581af8ebe236fe59d659ef27c31f139f038f7 (diff)
Multi-View: fix Multi-View camera suffix test
If we had ambiguity in the SceneRenderView > Suffix matching test, the first match would be used. And this would happen everytime a SceneRenderView had an empty camera suffix. We now take the longest matching suffix instead.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/camera.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index b308dc7a262..af3608901f8 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -846,18 +846,20 @@ static Object *camera_multiview_advanced(Scene *scene, Object *camera, const cha
char name[MAX_NAME];
const char *camera_name = camera->id.name + 2;
const int len_name = strlen(camera_name);
+ int len_suffix_max = -1;
name[0] = '\0';
+ /* we need to take the better match, thus the len_suffix_max test */
for (srv = scene->r.views.first; srv; srv = srv->next) {
const int len_suffix = strlen(srv->suffix);
- if (len_name < len_suffix)
+ if ((len_suffix < len_suffix_max) || (len_name < len_suffix))
continue;
if (STREQ(camera_name + (len_name - len_suffix), srv->suffix)) {
BLI_snprintf(name, sizeof(name), "%.*s%s", (len_name - len_suffix), camera_name, suffix);
- break;
+ len_suffix_max = len_suffix;
}
}