WIP: Brush assets project #106303
|
@ -8768,6 +8768,7 @@ class VIEW3D_PT_viewport_debug(Panel):
|
|||
class BrushAssetShelf:
|
||||
bl_space_type = "VIEW_3D"
|
||||
bl_options = {'NO_ASSET_DRAG'}
|
||||
bl_default_preview_size = 40
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
|
|
|
@ -525,6 +525,8 @@ struct AssetShelfType {
|
|||
|
||||
AssetShelfTypeFlag flag;
|
||||
|
||||
short default_preview_size;
|
||||
|
||||
/** Determine if asset shelves of this type should be available in current context or not. */
|
||||
bool (*poll)(const bContext *C, const AssetShelfType *shelf_type);
|
||||
|
||||
|
|
|
@ -90,7 +90,8 @@ static AssetShelf *create_shelf_from_type(AssetShelfType &type)
|
|||
{
|
||||
AssetShelf *shelf = MEM_new<AssetShelf>(__func__);
|
||||
*shelf = dna::shallow_zero_initialize();
|
||||
shelf->settings.preview_size = DEFAULT_TILE_SIZE;
|
||||
shelf->settings.preview_size = type.default_preview_size ? type.default_preview_size :
|
||||
DEFAULT_TILE_SIZE;
|
||||
shelf->settings.asset_library_reference = asset_system::all_library_reference();
|
||||
shelf->type = &type;
|
||||
shelf->preferred_row_count = 1;
|
||||
|
|
|
@ -2321,6 +2321,13 @@ static void rna_def_asset_shelf(BlenderRNA *brna)
|
|||
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL | PROP_ENUM_FLAG);
|
||||
RNA_def_property_ui_text(prop, "Options", "Options for this asset shelf type");
|
||||
|
||||
prop = RNA_def_property(srna, "bl_default_preview_size", PROP_INT, PROP_UNSIGNED);
|
||||
RNA_def_property_int_sdna(prop, nullptr, "type->default_preview_size");
|
||||
RNA_def_property_range(prop, 32, 256);
|
||||
RNA_def_property_flag(prop, PROP_REGISTER);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Default Preview Size", "Default size of the asset preview thumbnails in pixels");
|
||||
|
||||
PropertyRNA *parm;
|
||||
FunctionRNA *func;
|
||||
|
||||
|
|
Loading…
Reference in New Issue