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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-08-10 14:42:14 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-08-13 17:13:19 +0300
commitaef08fda3ade2d0223b77d4c9c0dd5e9fcabe7b2 (patch)
treeddde62d4cdf7d9896f0c8ac8fe694cf197c3ce7b /source/blender/depsgraph
parent6e7ea807e1e8aa0791a3c1d8875e74d64481973c (diff)
Custom Properties: officially support int and float arrays in the UI.
In some rare cases it is convenient to store a short array value as a custom property, e.g. a vector or color. For example, it may be helpful when importing/exporting certain formats that support custom or nonstandard attributes on objects. The custom property storage already can handle arrays in order to support properties defined via python. The only thing missing is UI support (and some bugs), and this patch fixes that: - Allow editing short array properties via Custom Properties panel. - Fix a UI layout sizing bug triggered by the previous item. - Fix a dependency graph bug with drivers using such properties. - Make RNA_*_get_default_array code robust in case of size mismatch. - Support custom default values for array properties, allowing both an array and a scalar value. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D5457
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc3
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc3
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 986f65df3fc..fd4c1e251e4 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -944,8 +944,9 @@ void DepsgraphNodeBuilder::build_driver_id_property(ID *id, const char *rna_path
}
PointerRNA id_ptr, ptr;
PropertyRNA *prop;
+ int index;
RNA_id_pointer_create(id, &id_ptr);
- if (!RNA_path_resolve_full(&id_ptr, rna_path, &ptr, &prop, NULL)) {
+ if (!RNA_path_resolve_full(&id_ptr, rna_path, &ptr, &prop, &index)) {
return;
}
if (prop == NULL) {
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index 27b519a8551..3c226338bfd 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1531,8 +1531,9 @@ void DepsgraphRelationBuilder::build_driver_id_property(ID *id, const char *rna_
}
PointerRNA id_ptr, ptr;
PropertyRNA *prop;
+ int index;
RNA_id_pointer_create(id, &id_ptr);
- if (!RNA_path_resolve_full(&id_ptr, rna_path, &ptr, &prop, NULL)) {
+ if (!RNA_path_resolve_full(&id_ptr, rna_path, &ptr, &prop, &index)) {
return;
}
if (prop == NULL) {