51 WorkSpace *workspace = id_cast<WorkSpace *>(ptr->owner_id);
67 wmOwnerID *owner_id = MEM_new<wmOwnerID>(__func__);
74static void rna_WorkSpace_owner_ids_remove(
WorkSpace *workspace,
82 "wmOwnerID '%s' not in workspace '%s'",
84 workspace->id.name + 2);
89 wstag_ptr->invalidate();
94static void rna_WorkSpace_owner_ids_clear(
WorkSpace *workspace)
96 workspace->owner_ids.free_no_destruct();
100static int rna_WorkSpace_asset_library_get(
PointerRNA *ptr)
106static void rna_WorkSpace_asset_library_set(
PointerRNA *ptr,
int value)
131 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
141 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
144static bToolRef *rna_WorkSpace_tools_from_space_node(
WorkSpace *workspace,
bool create)
149 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
158 return rna_WorkSpace_tools_from_tkey(workspace, &key, create);
166 switch (tref->space_type) {
177static bool rna_WorkSpaceTool_use_paint_canvas_get(
PointerRNA *ptr)
183static int rna_WorkSpaceTool_index_get(
PointerRNA *ptr)
189static bool rna_WorkSpaceTool_has_datablock_get(
PointerRNA *ptr)
192 return (tref->runtime) ? (tref->runtime->data_block[0] !=
'\0') :
false;
195static bool rna_WorkSpaceTool_use_brushes_get(
PointerRNA *ptr)
201static int rna_WorkSpaceTool_brush_type_get(
PointerRNA *ptr)
214 if (ptr->type == RNA_WorkSpaceTool) {
225 -1,
"ANY", 0,
"Any",
"Do not limit this tool to a specific brush type"};
239static void rna_WorkSpaceTool_widget_get(
PointerRNA *ptr,
char *value)
242 strcpy(value, tref->runtime ? tref->runtime->gizmo_group :
"");
245static int rna_WorkSpaceTool_widget_length(
PointerRNA *ptr)
248 return tref->
runtime ? strlen(tref->runtime->gizmo_group) : 0;
291 parm =
RNA_def_string(func,
"name",
"Name", 0,
"",
"New name for the tag");
303 parm =
RNA_def_pointer(func,
"owner_id",
"wmOwnerID",
"",
"Tag to remove");
368 "If the tool uses brushes and is limited to a specific brush type, the "
369 "identifier of the brush type");
372 prop,
"rna_WorkSpaceTool_brush_type_get",
nullptr,
"rna_WorkSpaceTool_brush_type_itemf");
380 prop,
"rna_WorkSpaceTool_widget_get",
"rna_WorkSpaceTool_widget_length",
nullptr);
399 srna,
"from_space_view3d_mode",
"rna_WorkSpace_tools_from_space_view3d_mode");
409 srna,
"from_space_image_mode",
"rna_WorkSpace_tools_from_space_image_mode");
419 func =
RNA_def_function(srna,
"from_space_node",
"rna_WorkSpace_tools_from_space_node");
427 srna,
"from_space_sequencer",
"rna_WorkSpace_tools_from_space_sequencer");
446 srna,
"Workspace",
"Workspace data-block, defining the working environment for the user");
454 "rna_workspace_screens_begin",
457 "rna_workspace_screens_item_get",
478 prop,
"Object Mode",
"Switch to this object mode when activating the workspace");
484 "Remember the last used scene for the workspace and switch to it "
485 "whenever this workspace is activated again");
496 srna,
"rna_WorkSpace_asset_library_get",
"rna_WorkSpace_asset_library_set");
499 "Active asset library to show in the UI, not used by the Asset Browser "
500 "(which has its own active asset library)");
512 prop,
"Sync Scene Time",
"Set the active scene and time based on the current scene strip");
#define ND_ASSET_LIST_READING
int library_reference_to_enum_value(const AssetLibraryReference *library)
AssetLibraryReference library_reference_from_enum_value(int value)
void sync_active_scene_and_time_with_scene_strip(bContext &C)
void WM_main_add_notifier(uint type, void *reference)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_workspace(BlenderRNA *brna)
@ WORKSPACE_USE_PIN_SCENE
@ WORKSPACE_USE_FILTER_BY_ORIGIN
@ WORKSPACE_SYNC_SCENE_TIME
void RNA_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
char * STRNCPY(char(&dst)[N], const char *src)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_space_type_items[]
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
static void rna_def_workspace_owner(BlenderRNA *brna)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static void rna_def_workspace(BlenderRNA *brna)
bToolRef * WM_toolsystem_ref_find(WorkSpace *workspace, const bToolKey *tkey)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
@ TOOLREF_FLAG_USE_BRUSHES
const EnumPropertyItem rna_enum_context_mode_items[]
static void rna_def_workspace_tool(BlenderRNA *brna)
bool ED_paint_brush_type_use_canvas(bContext *C, bToolRef *tref)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier_c_str, int type, int subtype)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_parameter_clear_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
const EnumPropertyItem * rna_WorkSpaceTool_brush_type_itemf(bContext *C, PointerRNA *ptr, PropertyRNA *prop, bool *r_free)
void RNA_api_workspace(StructRNA *srna)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
PropertyRNA * rna_def_asset_library_ui_reference_common(StructRNA *srna, const char *get, const char *set)
void RNA_enum_items_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range)
const EnumPropertyItem rna_enum_space_sequencer_view_type_items[]
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
void RNA_api_workspace_tool(StructRNA *srna)
PaintMode BKE_paintmode_get_from_tool(const bToolRef *tref)
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
void RNA_enum_item_end(EnumPropertyItem **items, int *totitem)
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
const EnumPropertyItem rna_enum_workspace_object_mode_items[]
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier_c_str, const char *call)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
const EnumPropertyItem * BKE_paint_get_tool_enum_from_paintmode(PaintMode mode)
void RNA_def_function_flag(FunctionRNA *func, FunctionFlag flag)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
void * rna_iterator_listbase_get(CollectionPropertyIterator *iter)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
bScreen * BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
static void rna_def_workspace_tools(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
bool BLI_remlink_safe(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
bool WM_toolsystem_ref_ensure(WorkSpace *workspace, const bToolKey *tkey, bToolRef **r_tref)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_define_verify_sdna(bool verify)
static void rna_def_workspace_owner_ids(BlenderRNA *brna, PropertyRNA *cprop)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
const EnumPropertyItem rna_enum_space_image_mode_all_items[]
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop, const bool allow_replace)
PaintMode BKE_paintmode_get_active_from_context(const bContext *C)
AssetLibraryReference asset_library_ref