diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-12-23 20:05:00 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-12-23 20:05:26 +0300 |
commit | 43f5e761a66e87fed664a199cda867639f8daf3e (patch) | |
tree | 58f60abb03ed87df10d69f7d9cc6a1955f599760 /source/blender/editors/include | |
parent | 7a71a95f32e57d8df51619e2e52384e5d217c439 (diff) |
Cache File: use panels to organize UI
This adds interface panels to organize the Cache File UI parameters for
modifiers and constraints into related components: velocity, time, and
render procedural.
Properties relating to the three aforementioned components are separated
from `uiTemplateCacheFile` into their own functions (e.g.
`uiTemplateCacheFileVelocity` for the velocity one), which are in turn
called from the specific panel creation routines of the modifiers and
constraints (for constraints, the functions are exposed to the RNA).
`uiTemplateCacheFile` now only shows the properties for the file path,
and in the case of constraints, the scale property.
The properties that are only defined per modifier (like the velocity
scale), are shown in the proper modifier layout panel if applicable.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D13652
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 9df5b17975a..ba9e56256af 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -2544,11 +2544,42 @@ void uiTemplateComponentMenu(uiLayout *layout, const char *propname, const char *name); void uiTemplateNodeSocket(uiLayout *layout, struct bContext *C, float color[4]); + +/** + * Draw the main CacheFile properties and operators (file path, scale, etc.), that is those which + * do not have their own dedicated template functions. + */ void uiTemplateCacheFile(uiLayout *layout, const struct bContext *C, struct PointerRNA *ptr, const char *propname); +/** + * Lookup the CacheFile PointerRNA of the given pointer and return it in the output parameter. + * Returns true if `ptr` has a RNACacheFile, false otherwise. If false, the output parameter is not + * initialized. + */ +bool uiTemplateCacheFilePointer(struct PointerRNA *ptr, + const char *propname, + struct PointerRNA *r_file_ptr); + +/** + * Draw the velocity related properties of the CacheFile. + */ +void uiTemplateCacheFileVelocity(uiLayout *layout, struct PointerRNA *fileptr); + +/** + * Draw the render procedural related properties of the CacheFile. + */ +void uiTemplateCacheFileProcedural(uiLayout *layout, + const struct bContext *C, + struct PointerRNA *fileptr); + +/** + * Draw the time related properties of the CacheFile. + */ +void uiTemplateCacheFileTimeSettings(uiLayout *layout, struct PointerRNA *fileptr); + /* Default UIList class name, keep in sync with its declaration in bl_ui/__init__.py */ #define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list" enum uiTemplateListFlags { |