2fbf206491171789a5685145a8eee6ef7c8cb7a3
Sometimes it is necessary to pass additional data through generic UI entities, to specific implementations. For example to pass additional options to panel polling & drawing when instantiating a panel through its panel type. Or storing additional data in a button, without hardcoding it in the button struct/class. Passing data via context is a simple solution to this, however so far this only works using hardcoded context queries or RNA pointers. For passing arbitrary strings we've used workarounds like creating an RNA type to wrap it already. For example `RNA_AssetCatalogPath`, which is used to dynamically populate menu items based on an asset catalog path, via a generic menu type. type instantiation. This makes it possible to invoke specific asset shelves as popover panels. Idea is simply to let `bContextStore` entries hold copies of the string (as `std::string`), avoiding lifetime issues. Context APIs are extended to support setting/querying strings via a context member name. Pull Request: https://projects.blender.org/blender/blender/pulls/122113
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
