2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-06-18 19:48:55 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2012-03-18 09:27:36 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2009-06-18 19:48:55 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-06-18 19:48:55 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2009 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup RNA
|
2011-02-27 20:20:01 +00:00
|
|
|
*/
|
|
|
|
|
|
2010-07-03 17:47:06 +00:00
|
|
|
#include <errno.h>
|
2020-03-19 09:33:03 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2012-06-04 16:42:58 +00:00
|
|
|
#include "DNA_ID.h"
|
2013-02-05 12:46:15 +00:00
|
|
|
#include "DNA_modifier_types.h"
|
2015-08-31 21:37:38 +03:00
|
|
|
#include "DNA_object_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_space_types.h"
|
2012-06-04 16:42:58 +00:00
|
|
|
|
2013-02-10 13:44:18 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2012-09-03 22:04:14 +00:00
|
|
|
|
2010-02-22 00:07:46 +00:00
|
|
|
#include "RNA_access.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "RNA_define.h"
|
2009-09-22 17:50:29 +00:00
|
|
|
#include "RNA_enum_types.h"
|
2009-06-18 19:48:55 +00:00
|
|
|
|
2012-09-03 22:04:14 +00:00
|
|
|
#include "rna_internal.h"
|
2010-01-11 00:41:31 +00:00
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_action.h"
|
|
|
|
|
# include "BKE_armature.h"
|
|
|
|
|
# include "BKE_brush.h"
|
2011-11-05 13:00:39 +00:00
|
|
|
# include "BKE_camera.h"
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
# include "BKE_collection.h"
|
2010-02-22 00:07:46 +00:00
|
|
|
# include "BKE_curve.h"
|
2013-02-05 12:46:15 +00:00
|
|
|
# include "BKE_displist.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_font.h"
|
|
|
|
|
# include "BKE_gpencil.h"
|
2020-03-17 14:41:48 +01:00
|
|
|
# include "BKE_hair.h"
|
2015-05-11 16:29:12 +02:00
|
|
|
# include "BKE_icons.h"
|
2020-03-19 19:37:00 +01:00
|
|
|
# include "BKE_idtype.h"
|
2009-07-03 17:44:20 +00:00
|
|
|
# include "BKE_image.h"
|
2010-05-14 21:16:37 +00:00
|
|
|
# include "BKE_lattice.h"
|
2020-02-10 12:58:59 +01:00
|
|
|
# include "BKE_lib_remap.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "BKE_light.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_lightprobe.h"
|
|
|
|
|
# include "BKE_linestyle.h"
|
|
|
|
|
# include "BKE_mask.h"
|
|
|
|
|
# include "BKE_material.h"
|
2010-05-14 21:16:37 +00:00
|
|
|
# include "BKE_mball.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_mesh.h"
|
|
|
|
|
# include "BKE_movieclip.h"
|
2010-05-15 13:30:14 +00:00
|
|
|
# include "BKE_node.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_object.h"
|
|
|
|
|
# include "BKE_paint.h"
|
|
|
|
|
# include "BKE_particle.h"
|
2020-03-17 14:41:48 +01:00
|
|
|
# include "BKE_pointcloud.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_scene.h"
|
2020-04-20 10:37:38 +02:00
|
|
|
# include "BKE_simulation.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_sound.h"
|
2011-08-04 07:12:03 +00:00
|
|
|
# include "BKE_speaker.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_text.h"
|
|
|
|
|
# include "BKE_texture.h"
|
2020-03-17 14:41:48 +01:00
|
|
|
# include "BKE_volume.h"
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
# include "BKE_workspace.h"
|
2018-11-07 18:00:24 +01:00
|
|
|
# include "BKE_world.h"
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-25 14:20:33 +02:00
|
|
|
# include "DEG_depsgraph_build.h"
|
2017-06-08 10:14:53 +02:00
|
|
|
# include "DEG_depsgraph_query.h"
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-12-02 15:37:07 +00:00
|
|
|
# include "DNA_armature_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_brush_types.h"
|
2010-01-09 23:44:01 +00:00
|
|
|
# include "DNA_camera_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_collection_types.h"
|
2010-03-23 14:58:36 +00:00
|
|
|
# include "DNA_curve_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_gpencil_types.h"
|
2020-03-17 14:41:48 +01:00
|
|
|
# include "DNA_hair_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_lattice_types.h"
|
2019-02-27 12:34:56 +11:00
|
|
|
# include "DNA_light_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_lightprobe_types.h"
|
|
|
|
|
# include "DNA_mask_types.h"
|
2009-12-02 15:37:07 +00:00
|
|
|
# include "DNA_material_types.h"
|
|
|
|
|
# include "DNA_mesh_types.h"
|
2010-05-14 21:16:37 +00:00
|
|
|
# include "DNA_meta_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_movieclip_types.h"
|
|
|
|
|
# include "DNA_node_types.h"
|
2016-12-28 17:30:58 +01:00
|
|
|
# include "DNA_particle_types.h"
|
2020-03-17 14:41:48 +01:00
|
|
|
# include "DNA_pointcloud_types.h"
|
2020-04-20 10:37:38 +02:00
|
|
|
# include "DNA_simulation_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_sound_types.h"
|
|
|
|
|
# include "DNA_speaker_types.h"
|
|
|
|
|
# include "DNA_text_types.h"
|
|
|
|
|
# include "DNA_texture_types.h"
|
2010-05-15 13:30:14 +00:00
|
|
|
# include "DNA_vfont_types.h"
|
2020-03-17 14:41:48 +01:00
|
|
|
# include "DNA_volume_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
# include "DNA_world_types.h"
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-01-11 00:41:31 +00:00
|
|
|
# include "ED_screen.h"
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-08-16 17:32:01 +10:00
|
|
|
# include "BLT_translation.h"
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2014-02-17 19:29:37 +11:00
|
|
|
# ifdef WITH_PYTHON
|
|
|
|
|
# include "BPY_extern.h"
|
|
|
|
|
# endif
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
# include "WM_api.h"
|
2019-01-24 17:44:13 +01:00
|
|
|
# include "WM_types.h"
|
2016-06-25 17:01:36 +02:00
|
|
|
|
2016-12-27 16:39:19 +01:00
|
|
|
static void rna_idname_validate(const char *name, char *r_name)
|
|
|
|
|
{
|
|
|
|
|
BLI_strncpy(r_name, name, MAX_ID_NAME - 2);
|
|
|
|
|
BLI_utf8_invalid_strip(r_name, strlen(r_name));
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-01 15:47:09 +02:00
|
|
|
static void rna_Main_ID_remove(Main *bmain,
|
|
|
|
|
ReportList *reports,
|
|
|
|
|
PointerRNA *id_ptr,
|
|
|
|
|
bool do_unlink,
|
|
|
|
|
bool do_id_user,
|
|
|
|
|
bool do_ui_user)
|
2016-06-25 17:01:36 +02:00
|
|
|
{
|
|
|
|
|
ID *id = id_ptr->data;
|
2019-05-17 10:35:03 +02:00
|
|
|
if (id->tag & LIB_TAG_NO_MAIN) {
|
|
|
|
|
BKE_reportf(reports,
|
|
|
|
|
RPT_ERROR,
|
|
|
|
|
"%s '%s' is outside of main database and can not be removed from it",
|
2020-03-19 19:37:00 +01:00
|
|
|
BKE_idtype_idcode_to_name(GS(id->name)),
|
2019-05-17 10:35:03 +02:00
|
|
|
id->name + 2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-06-25 17:01:36 +02:00
|
|
|
if (do_unlink) {
|
2019-01-14 21:24:25 +01:00
|
|
|
BKE_id_delete(bmain, id);
|
2016-06-25 17:01:36 +02:00
|
|
|
RNA_POINTER_INVALIDATE(id_ptr);
|
2019-01-24 17:44:13 +01:00
|
|
|
/* Force full redraw, mandatory to avoid crashes when running this from UI... */
|
|
|
|
|
WM_main_add_notifier(NC_WINDOW, NULL);
|
2016-06-25 17:01:36 +02:00
|
|
|
}
|
|
|
|
|
else if (ID_REAL_USERS(id) <= 0) {
|
2019-01-14 16:15:15 +01:00
|
|
|
const int flag = (do_id_user ? 0 : LIB_ID_FREE_NO_USER_REFCOUNT) |
|
|
|
|
|
(do_ui_user ? 0 : LIB_ID_FREE_NO_UI_USER);
|
|
|
|
|
/* Still using ID flags here, this is in-between commit anyway... */
|
|
|
|
|
BKE_id_free_ex(bmain, id, flag, true);
|
2016-06-25 17:01:36 +02:00
|
|
|
RNA_POINTER_INVALIDATE(id_ptr);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
BKE_reportf(
|
|
|
|
|
reports,
|
|
|
|
|
RPT_ERROR,
|
2016-07-06 11:32:46 -03:00
|
|
|
"%s '%s' must have zero users to be removed, found %d (try with do_unlink=True parameter)",
|
2020-03-19 19:37:00 +01:00
|
|
|
BKE_idtype_idcode_to_name(GS(id->name)),
|
2016-06-25 17:01:36 +02:00
|
|
|
id->name + 2,
|
|
|
|
|
ID_REAL_USERS(id));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Camera *rna_Main_cameras_new(Main *bmain, const char *name)
|
2009-12-02 15:37:07 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
ID *id = BKE_camera_add(bmain, safe_name);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-09-11 06:27:38 +00:00
|
|
|
return (Camera *)id;
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2009-12-02 15:37:07 +00:00
|
|
|
|
2012-12-13 01:17:22 +00:00
|
|
|
static Scene *rna_Main_scenes_new(Main *bmain, const char *name)
|
2009-12-02 15:37:07 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2021-01-07 14:06:43 +01:00
|
|
|
Scene *scene = BKE_scene_add(bmain, safe_name);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
|
|
|
|
return scene;
|
2009-08-13 11:14:06 +00:00
|
|
|
}
|
2018-07-01 15:47:09 +02:00
|
|
|
static void rna_Main_scenes_remove(
|
|
|
|
|
Main *bmain, bContext *C, ReportList *reports, PointerRNA *scene_ptr, bool do_unlink)
|
2009-08-13 11:14:06 +00:00
|
|
|
{
|
2019-01-14 15:47:11 +01:00
|
|
|
/* don't call BKE_id_free(...) directly */
|
2012-11-01 17:16:24 +00:00
|
|
|
Scene *scene = scene_ptr->data;
|
|
|
|
|
|
2021-01-08 16:30:44 +01:00
|
|
|
if (BKE_scene_can_be_removed(bmain, scene)) {
|
|
|
|
|
Scene *scene_new = scene->id.prev ? scene->id.prev : scene->id.next;
|
2016-06-25 17:01:36 +02:00
|
|
|
if (do_unlink) {
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
wmWindow *win = CTX_wm_window(C);
|
|
|
|
|
|
|
|
|
|
if (WM_window_get_active_scene(win) == scene) {
|
2014-02-17 19:29:37 +11:00
|
|
|
|
|
|
|
|
# ifdef WITH_PYTHON
|
2016-06-25 17:01:36 +02:00
|
|
|
BPy_BEGIN_ALLOW_THREADS;
|
2014-02-17 19:29:37 +11:00
|
|
|
# endif
|
|
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
WM_window_set_active_scene(bmain, C, win, scene_new);
|
2014-02-17 19:29:37 +11:00
|
|
|
|
|
|
|
|
# ifdef WITH_PYTHON
|
2016-06-25 17:01:36 +02:00
|
|
|
BPy_END_ALLOW_THREADS;
|
2019-04-17 06:17:24 +02:00
|
|
|
# endif
|
2012-11-01 17:16:24 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2017-09-13 20:12:19 +05:00
|
|
|
rna_Main_ID_remove(bmain, reports, scene_ptr, do_unlink, true, true);
|
2012-11-01 17:16:24 +00:00
|
|
|
}
|
2010-01-11 00:41:31 +00:00
|
|
|
else {
|
2021-01-08 16:30:44 +01:00
|
|
|
BKE_reportf(reports,
|
|
|
|
|
RPT_ERROR,
|
|
|
|
|
"Scene '%s' is the last local one, cannot be removed",
|
|
|
|
|
scene->id.name + 2);
|
2010-01-11 00:41:31 +00:00
|
|
|
}
|
2009-08-13 11:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Object *rna_Main_objects_new(Main *bmain, ReportList *reports, const char *name, ID *data)
|
2009-06-20 16:32:52 +00:00
|
|
|
{
|
2019-05-17 13:59:59 +02:00
|
|
|
if (data != NULL && (data->tag & LIB_TAG_NO_MAIN)) {
|
|
|
|
|
BKE_report(reports,
|
|
|
|
|
RPT_ERROR,
|
|
|
|
|
"Can not create object in main database with an evaluated data data-block");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-02-22 00:07:46 +00:00
|
|
|
Object *ob;
|
2012-03-05 23:30:41 +00:00
|
|
|
int type = OB_EMPTY;
|
2020-09-03 16:23:49 +10:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
if (data) {
|
2020-09-03 16:23:49 +10:00
|
|
|
type = BKE_object_obdata_to_type(data);
|
|
|
|
|
if (type == -1) {
|
|
|
|
|
const char *idname;
|
|
|
|
|
if (RNA_enum_id_from_value(rna_enum_id_type_items, GS(data->name), &idname) == 0) {
|
|
|
|
|
idname = "UNKNOWN";
|
2010-02-22 00:07:46 +00:00
|
|
|
}
|
2020-09-03 16:23:49 +10:00
|
|
|
|
|
|
|
|
BKE_reportf(reports, RPT_ERROR, "ID type '%s' is not valid for an object", idname);
|
|
|
|
|
return NULL;
|
2010-02-22 00:07:46 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_plus(data);
|
2010-02-22 00:07:46 +00:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-12-27 16:39:19 +01:00
|
|
|
ob = BKE_object_add_only_object(bmain, type, safe_name);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
ob->data = data;
|
2020-02-05 11:23:58 +01:00
|
|
|
BKE_object_materials_test(bmain, ob, ob->data);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-01-07 14:06:43 +01:00
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2009-06-24 19:23:34 +00:00
|
|
|
return ob;
|
|
|
|
|
}
|
2010-02-22 00:07:46 +00:00
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Material *rna_Main_materials_new(Main *bmain, const char *name)
|
2009-06-24 19:23:34 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
ID *id = (ID *)BKE_material_add(bmain, safe_name);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-09-11 06:27:38 +00:00
|
|
|
return (Material *)id;
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2009-06-20 16:32:52 +00:00
|
|
|
|
2018-08-02 17:45:17 +02:00
|
|
|
static void rna_Main_materials_gpencil_data(Main *UNUSED(bmain), PointerRNA *id_ptr)
|
2018-07-31 10:22:19 +02:00
|
|
|
{
|
2018-08-02 17:45:17 +02:00
|
|
|
ID *id = id_ptr->data;
|
|
|
|
|
Material *ma = (Material *)id;
|
2020-02-05 11:23:58 +01:00
|
|
|
BKE_gpencil_material_attr_init(ma);
|
2018-07-31 10:22:19 +02:00
|
|
|
}
|
|
|
|
|
|
2019-05-02 16:26:57 +02:00
|
|
|
static void rna_Main_materials_gpencil_remove(Main *UNUSED(bmain), PointerRNA *id_ptr)
|
|
|
|
|
{
|
|
|
|
|
ID *id = id_ptr->data;
|
|
|
|
|
Material *ma = (Material *)id;
|
|
|
|
|
if (ma->gp_style) {
|
|
|
|
|
MEM_SAFE_FREE(ma->gp_style);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem *rna_Main_nodetree_type_itemf(bContext *UNUSED(C),
|
|
|
|
|
PointerRNA *UNUSED(ptr),
|
|
|
|
|
PropertyRNA *UNUSED(prop),
|
|
|
|
|
bool *r_free)
|
2010-05-15 13:30:14 +00:00
|
|
|
{
|
2014-01-04 18:08:43 +11:00
|
|
|
return rna_node_tree_type_itemf(NULL, NULL, r_free);
|
2013-03-18 16:34:57 +00:00
|
|
|
}
|
|
|
|
|
static struct bNodeTree *rna_Main_nodetree_new(Main *bmain, const char *name, int type)
|
|
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
bNodeTreeType *typeinfo = rna_node_tree_type_from_enum(type);
|
|
|
|
|
if (typeinfo) {
|
2019-08-22 16:00:59 +02:00
|
|
|
bNodeTree *ntree = ntreeAddTree(bmain, safe_name, typeinfo->idname);
|
2016-02-15 19:33:34 +01:00
|
|
|
|
2013-03-18 16:34:57 +00:00
|
|
|
id_us_min(&ntree->id);
|
|
|
|
|
return ntree;
|
|
|
|
|
}
|
2016-12-27 16:39:19 +01:00
|
|
|
else {
|
2013-03-18 16:34:57 +00:00
|
|
|
return NULL;
|
2016-12-27 16:39:19 +01:00
|
|
|
}
|
2010-05-15 13:30:14 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Mesh *rna_Main_meshes_new(Main *bmain, const char *name)
|
2009-07-02 20:46:35 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Mesh *me = BKE_mesh_add(bmain, safe_name);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&me->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
return me;
|
2009-07-02 20:46:35 +00:00
|
|
|
}
|
2013-02-05 12:46:15 +00:00
|
|
|
|
|
|
|
|
/* copied from Mesh_getFromObject and adapted to RNA interface */
|
2019-05-24 14:37:47 +02:00
|
|
|
static Mesh *rna_Main_meshes_new_from_object(Main *bmain,
|
|
|
|
|
ReportList *reports,
|
|
|
|
|
Object *object,
|
|
|
|
|
bool preserve_all_data_layers,
|
|
|
|
|
Depsgraph *depsgraph)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
Dependency graph API changes
Main goal here is to make it obvious and predictable about
what is going on.
Summary of changes.
- Access to dependency graph is now only possible to a fully evaluated
graph. This is now done via context.evaluated_depsgraph_get().
The call will ensure both relations and datablocks are updated.
This way we don't allow access to some known bad state of the graph,
and also making explicit that getting update dependency graph is not
cheap.
- Access to evaluated ID is now possible via id.evaluated_get().
It was already possible to get evaluated ID via dependency graph,
but that was a bit confusing why access to original is done via ID
and to evaluated via depsgraph.
If datablock is not covered by dependency graph it will be returned
as-is.
- Similarly, request for original from an ID which is not evaluated
will return ID as-is.
- Removed scene.update().
This is very expensive to update all the view layers.
- Added depsgraph.update().
Now when temporary changes to objects are to be done, this is to
happen on original object and then dependency graph is to be
updated.
- Changed object.to_mesh() to behave the following way:
* When is used for original object modifiers are ignored.
For meshes this acts similar to mesh-copy, not very useful but
allows to keep code paths similar (i.e. for exporter which has
Apply Modifiers option it's only matter choosing between original
and evaluated object, the to_mesh() part can stay the same).
For curves this gives a mesh which is constructed from displist
without taking own modifiers and modifiers of bevel/taper objects
into account.
For metaballs this gives empty mesh.
Polygonization of metaball is not possible from a single object.
* When is used for evaluated object modifiers are always applied.
In fact, no evaluation is happening, the mesh is either copied
as-is, or constructed from current state of curve cache.
Arguments to apply modifiers and calculate original coordinates (ORCO,
aka undeformed coordinates) are removed. The ORCO is to be calculated
as part of dependency graph evaluation.
File used to regression-test (a packed Python script into .blend):
{F7033464}
Patch to make addons tests to pass:
{F7033466}
NOTE: I've included changes to FBX exporter, and those are addressing
report T63689.
NOTE: All the enabled-by-default addons are to be ported still, but
first want to have agreement on this part of changes.
NOTE: Also need to work on documentation for Python API, but, again,
better be done after having agreement on this work.
Reviewers: brecht, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D4834
2019-05-09 11:26:49 +02:00
|
|
|
switch (object->type) {
|
2013-02-05 12:46:15 +00:00
|
|
|
case OB_FONT:
|
|
|
|
|
case OB_CURVE:
|
|
|
|
|
case OB_SURF:
|
|
|
|
|
case OB_MBALL:
|
|
|
|
|
case OB_MESH:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
BKE_report(reports, RPT_ERROR, "Object does not have geometry data");
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-01-07 14:06:43 +01:00
|
|
|
Mesh *mesh = BKE_mesh_new_from_object_to_bmain(
|
|
|
|
|
bmain, depsgraph, object, preserve_all_data_layers);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
|
|
|
|
return mesh;
|
2013-02-05 12:46:15 +00:00
|
|
|
}
|
|
|
|
|
|
2019-02-27 10:46:48 +11:00
|
|
|
static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
|
2009-07-02 20:46:35 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2019-02-27 10:46:48 +11:00
|
|
|
Light *lamp = BKE_light_add(bmain, safe_name);
|
2012-03-05 23:30:41 +00:00
|
|
|
lamp->type = type;
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&lamp->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
return lamp;
|
2009-07-02 20:46:35 +00:00
|
|
|
}
|
|
|
|
|
|
2018-07-01 15:47:09 +02:00
|
|
|
static Image *rna_Main_images_new(Main *bmain,
|
|
|
|
|
const char *name,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
bool alpha,
|
|
|
|
|
bool float_buffer,
|
2019-06-26 15:04:44 +02:00
|
|
|
bool stereo3d,
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
bool is_data,
|
|
|
|
|
bool tiled)
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
float color[4] = {0.0, 0.0, 0.0, 1.0};
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
Image *image = BKE_image_add_generated(bmain,
|
|
|
|
|
width,
|
|
|
|
|
height,
|
|
|
|
|
safe_name,
|
|
|
|
|
alpha ? 32 : 24,
|
|
|
|
|
float_buffer,
|
|
|
|
|
0,
|
|
|
|
|
color,
|
|
|
|
|
stereo3d,
|
|
|
|
|
is_data,
|
|
|
|
|
tiled);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&image->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
return image;
|
|
|
|
|
}
|
2018-07-01 15:47:09 +02:00
|
|
|
static Image *rna_Main_images_load(Main *bmain,
|
|
|
|
|
ReportList *reports,
|
|
|
|
|
const char *filepath,
|
|
|
|
|
bool check_existing)
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
{
|
2010-07-03 17:47:06 +00:00
|
|
|
Image *ima;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
errno = 0;
|
2015-10-05 18:49:20 +02:00
|
|
|
if (check_existing) {
|
2018-06-11 15:40:37 +02:00
|
|
|
ima = BKE_image_load_exists(bmain, filepath);
|
2015-10-05 18:49:20 +02:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
ima = BKE_image_load(bmain, filepath);
|
|
|
|
|
}
|
2010-07-03 17:47:06 +00:00
|
|
|
|
2012-11-01 17:16:24 +00:00
|
|
|
if (!ima) {
|
2012-10-20 10:28:34 +00:00
|
|
|
BKE_reportf(reports,
|
|
|
|
|
RPT_ERROR,
|
|
|
|
|
"Cannot read '%s': %s",
|
|
|
|
|
filepath,
|
|
|
|
|
errno ? strerror(errno) : TIP_("unsupported image format"));
|
2012-11-01 17:16:24 +00:00
|
|
|
}
|
2010-07-03 17:47:06 +00:00
|
|
|
|
2015-11-19 06:20:02 +11:00
|
|
|
id_us_min((ID *)ima);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-07-03 17:47:06 +00:00
|
|
|
return ima;
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Lattice *rna_Main_lattices_new(Main *bmain, const char *name)
|
2010-05-14 21:16:37 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Lattice *lt = BKE_lattice_add(bmain, safe_name);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(<->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-05-14 21:16:37 +00:00
|
|
|
return lt;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Curve *rna_Main_curves_new(Main *bmain, const char *name, int type)
|
2010-03-23 14:58:36 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Curve *cu = BKE_curve_add(bmain, safe_name, type);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&cu->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-03-23 14:58:36 +00:00
|
|
|
return cu;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static MetaBall *rna_Main_metaballs_new(Main *bmain, const char *name)
|
2010-05-14 21:16:37 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
MetaBall *mb = BKE_mball_add(bmain, safe_name);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&mb->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-05-14 21:16:37 +00:00
|
|
|
return mb;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-01 15:47:09 +02:00
|
|
|
static VFont *rna_Main_fonts_load(Main *bmain,
|
|
|
|
|
ReportList *reports,
|
|
|
|
|
const char *filepath,
|
|
|
|
|
bool check_existing)
|
2010-05-15 13:30:14 +00:00
|
|
|
{
|
2010-07-03 17:47:06 +00:00
|
|
|
VFont *font;
|
2012-03-05 23:30:41 +00:00
|
|
|
errno = 0;
|
2015-10-06 19:40:15 +11:00
|
|
|
|
|
|
|
|
if (check_existing) {
|
|
|
|
|
font = BKE_vfont_load_exists(bmain, filepath);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
font = BKE_vfont_load(bmain, filepath);
|
|
|
|
|
}
|
2010-07-03 17:47:06 +00:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (!font) {
|
2012-10-20 10:28:34 +00:00
|
|
|
BKE_reportf(reports,
|
|
|
|
|
RPT_ERROR,
|
|
|
|
|
"Cannot read '%s': %s",
|
|
|
|
|
filepath,
|
|
|
|
|
errno ? strerror(errno) : TIP_("unsupported font format"));
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-07-03 17:47:06 +00:00
|
|
|
return font;
|
2010-05-15 13:30:14 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Tex *rna_Main_textures_new(Main *bmain, const char *name, int type)
|
2010-01-17 20:06:34 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Tex *tex = BKE_texture_add(bmain, safe_name);
|
2015-03-29 03:16:55 +11:00
|
|
|
BKE_texture_type_set(tex, type);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&tex->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-01-17 20:06:34 +00:00
|
|
|
return tex;
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-31 21:37:38 +03:00
|
|
|
static Brush *rna_Main_brushes_new(Main *bmain, const char *name, int mode)
|
2010-05-14 21:16:37 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Brush *brush = BKE_brush_add(bmain, safe_name, mode);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&brush->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-05-14 21:16:37 +00:00
|
|
|
return brush;
|
|
|
|
|
}
|
2015-08-31 21:37:38 +03:00
|
|
|
|
2018-08-05 16:19:24 +02:00
|
|
|
static void rna_Main_brush_gpencil_data(Main *UNUSED(bmain), PointerRNA *id_ptr)
|
|
|
|
|
{
|
|
|
|
|
ID *id = id_ptr->data;
|
|
|
|
|
Brush *brush = (Brush *)id;
|
|
|
|
|
BKE_brush_init_gpencil_settings(brush);
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static World *rna_Main_worlds_new(Main *bmain, const char *name)
|
2010-05-15 13:30:14 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2018-01-11 09:55:41 +11:00
|
|
|
World *world = BKE_world_add(bmain, safe_name);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&world->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-05-15 13:30:14 +00:00
|
|
|
return world;
|
|
|
|
|
}
|
|
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
static Collection *rna_Main_collections_new(Main *bmain, const char *name)
|
2010-01-11 23:40:01 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2021-01-07 14:06:43 +01:00
|
|
|
Collection *collection = BKE_collection_add(bmain, NULL, safe_name);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
|
|
|
|
return collection;
|
2010-01-11 23:40:01 +00:00
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Speaker *rna_Main_speakers_new(Main *bmain, const char *name)
|
2011-08-01 11:44:20 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Speaker *speaker = BKE_speaker_add(bmain, safe_name);
|
2011-08-01 11:44:20 +00:00
|
|
|
id_us_min(&speaker->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2011-08-01 11:44:20 +00:00
|
|
|
return speaker;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-01 15:47:09 +02:00
|
|
|
static bSound *rna_Main_sounds_load(Main *bmain, const char *name, bool check_existing)
|
2015-05-01 00:57:12 +10:00
|
|
|
{
|
2015-10-06 19:40:15 +11:00
|
|
|
bSound *sound;
|
|
|
|
|
|
|
|
|
|
if (check_existing) {
|
|
|
|
|
sound = BKE_sound_new_file_exists(bmain, name);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
sound = BKE_sound_new_file(bmain, name);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-01 00:57:12 +10:00
|
|
|
id_us_min(&sound->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2015-05-01 00:57:12 +10:00
|
|
|
return sound;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Text *rna_Main_texts_new(Main *bmain, const char *name)
|
2010-01-11 00:41:31 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2021-01-07 14:06:43 +01:00
|
|
|
Text *text = BKE_text_add(bmain, safe_name);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
|
|
|
|
return text;
|
2010-01-11 00:41:31 +00:00
|
|
|
}
|
2010-07-03 17:47:06 +00:00
|
|
|
|
2018-07-01 15:47:09 +02:00
|
|
|
static Text *rna_Main_texts_load(Main *bmain,
|
|
|
|
|
ReportList *reports,
|
|
|
|
|
const char *filepath,
|
|
|
|
|
bool is_internal)
|
2010-01-11 00:41:31 +00:00
|
|
|
{
|
2010-07-03 17:47:06 +00:00
|
|
|
Text *txt;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
errno = 0;
|
2018-06-05 15:10:33 +02:00
|
|
|
txt = BKE_text_load_ex(bmain, filepath, BKE_main_blendfile_path(bmain), is_internal);
|
2010-07-03 17:47:06 +00:00
|
|
|
|
2019-06-04 00:21:57 +10:00
|
|
|
if (!txt) {
|
2012-10-20 10:28:34 +00:00
|
|
|
BKE_reportf(reports,
|
|
|
|
|
RPT_ERROR,
|
|
|
|
|
"Cannot read '%s': %s",
|
|
|
|
|
filepath,
|
|
|
|
|
errno ? strerror(errno) : TIP_("unable to load text"));
|
2019-06-04 00:21:57 +10:00
|
|
|
}
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-01-11 00:41:31 +00:00
|
|
|
return txt;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static bArmature *rna_Main_armatures_new(Main *bmain, const char *name)
|
2009-07-03 17:44:20 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
bArmature *arm = BKE_armature_add(bmain, safe_name);
|
2010-12-19 16:34:58 +00:00
|
|
|
id_us_min(&arm->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
return arm;
|
|
|
|
|
}
|
2009-07-03 17:44:20 +00:00
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static bAction *rna_Main_actions_new(Main *bmain, const char *name)
|
2010-01-11 23:40:01 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2018-01-11 09:55:41 +11:00
|
|
|
bAction *act = BKE_action_add(bmain, safe_name);
|
2015-11-09 20:59:42 +01:00
|
|
|
id_fake_user_clear(&act->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-01-11 23:40:01 +00:00
|
|
|
return act;
|
2016-06-27 16:07:38 +02:00
|
|
|
}
|
2010-01-11 23:40:01 +00:00
|
|
|
|
2016-12-28 17:30:58 +01:00
|
|
|
static ParticleSettings *rna_Main_particles_new(Main *bmain, const char *name)
|
|
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2018-01-11 09:55:41 +11:00
|
|
|
ParticleSettings *part = BKE_particlesettings_add(bmain, safe_name);
|
2016-12-28 17:30:58 +01:00
|
|
|
id_us_min(&part->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2016-12-28 17:30:58 +01:00
|
|
|
return part;
|
|
|
|
|
}
|
|
|
|
|
|
2015-03-12 23:47:48 +11:00
|
|
|
static Palette *rna_Main_palettes_new(Main *bmain, const char *name)
|
|
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Palette *palette = BKE_palette_add(bmain, safe_name);
|
2015-03-12 23:47:48 +11:00
|
|
|
id_us_min(&palette->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2015-03-12 23:47:48 +11:00
|
|
|
return (Palette *)palette;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-01 15:47:09 +02:00
|
|
|
static MovieClip *rna_Main_movieclip_load(Main *bmain,
|
|
|
|
|
ReportList *reports,
|
|
|
|
|
const char *filepath,
|
|
|
|
|
bool check_existing)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
|
|
|
|
MovieClip *clip;
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
errno = 0;
|
2015-10-06 19:40:15 +11:00
|
|
|
|
|
|
|
|
if (check_existing) {
|
|
|
|
|
clip = BKE_movieclip_file_add_exists(bmain, filepath);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
clip = BKE_movieclip_file_add(bmain, filepath);
|
|
|
|
|
}
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2017-10-25 14:18:21 +02:00
|
|
|
if (clip != NULL) {
|
2017-10-25 14:20:33 +02:00
|
|
|
DEG_relations_tag_update(bmain);
|
2017-10-25 14:18:21 +02:00
|
|
|
}
|
|
|
|
|
else {
|
2012-10-20 10:28:34 +00:00
|
|
|
BKE_reportf(reports,
|
|
|
|
|
RPT_ERROR,
|
|
|
|
|
"Cannot read '%s': %s",
|
|
|
|
|
filepath,
|
|
|
|
|
errno ? strerror(errno) : TIP_("unable to load movie clip"));
|
2017-10-25 14:18:21 +02:00
|
|
|
}
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2015-11-19 06:20:02 +11:00
|
|
|
id_us_min((ID *)clip);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
return clip;
|
|
|
|
|
}
|
|
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
static Mask *rna_Main_mask_new(Main *bmain, const char *name)
|
2012-06-04 16:42:58 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
2012-06-04 16:42:58 +00:00
|
|
|
|
2021-01-07 14:06:43 +01:00
|
|
|
Mask *mask = BKE_mask_new(bmain, safe_name);
|
|
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
|
|
|
|
return mask;
|
2012-06-04 16:42:58 +00:00
|
|
|
}
|
|
|
|
|
|
2014-08-13 08:37:41 +10:00
|
|
|
static FreestyleLineStyle *rna_Main_linestyles_new(Main *bmain, const char *name)
|
2010-06-25 22:45:42 +00:00
|
|
|
{
|
2016-12-27 16:39:19 +01:00
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
FreestyleLineStyle *linestyle = BKE_linestyle_new(bmain, safe_name);
|
2011-11-25 01:10:55 +00:00
|
|
|
id_us_min(&linestyle->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2010-06-25 22:45:42 +00:00
|
|
|
return linestyle;
|
|
|
|
|
}
|
2011-11-25 01:10:55 +00:00
|
|
|
|
2020-01-17 19:14:23 +01:00
|
|
|
static LightProbe *rna_Main_lightprobe_new(Main *bmain, const char *name, int type)
|
2017-06-06 22:47:41 +02:00
|
|
|
{
|
|
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
2017-06-12 20:59:54 +10:00
|
|
|
LightProbe *probe = BKE_lightprobe_add(bmain, safe_name);
|
2020-01-17 19:14:23 +01:00
|
|
|
|
2020-01-20 17:54:38 +11:00
|
|
|
BKE_lightprobe_type_set(probe, type);
|
2020-01-17 19:14:23 +01:00
|
|
|
|
2017-06-06 22:47:41 +02:00
|
|
|
id_us_min(&probe->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2017-06-06 22:47:41 +02:00
|
|
|
return probe;
|
|
|
|
|
}
|
|
|
|
|
|
2019-06-25 18:52:22 +02:00
|
|
|
static bGPdata *rna_Main_gpencils_new(Main *bmain, const char *name)
|
|
|
|
|
{
|
|
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
bGPdata *gpd = BKE_gpencil_data_addnew(bmain, safe_name);
|
|
|
|
|
id_us_min(&gpd->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2019-06-25 18:52:22 +02:00
|
|
|
return gpd;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-17 09:47:10 +02:00
|
|
|
# ifdef WITH_HAIR_NODES
|
2020-03-17 14:41:48 +01:00
|
|
|
static Hair *rna_Main_hairs_new(Main *bmain, const char *name)
|
|
|
|
|
{
|
|
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Hair *hair = BKE_hair_add(bmain, safe_name);
|
|
|
|
|
id_us_min(&hair->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2020-03-17 14:41:48 +01:00
|
|
|
return hair;
|
|
|
|
|
}
|
2020-08-17 09:47:10 +02:00
|
|
|
# endif
|
2020-03-17 14:41:48 +01:00
|
|
|
|
2020-12-15 13:07:02 +01:00
|
|
|
# ifdef WITH_POINT_CLOUD
|
2020-03-17 14:41:48 +01:00
|
|
|
static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name)
|
|
|
|
|
{
|
|
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
PointCloud *pointcloud = BKE_pointcloud_add(bmain, safe_name);
|
|
|
|
|
id_us_min(&pointcloud->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2020-03-17 14:41:48 +01:00
|
|
|
return pointcloud;
|
|
|
|
|
}
|
2020-12-15 13:07:02 +01:00
|
|
|
# endif
|
2020-03-17 14:41:48 +01:00
|
|
|
|
|
|
|
|
static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
|
|
|
|
|
{
|
|
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Volume *volume = BKE_volume_add(bmain, safe_name);
|
|
|
|
|
id_us_min(&volume->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2020-03-17 14:41:48 +01:00
|
|
|
return volume;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-21 13:47:50 +02:00
|
|
|
# ifdef WITH_GEOMETRY_NODES
|
2020-04-20 10:37:38 +02:00
|
|
|
static Simulation *rna_Main_simulations_new(Main *bmain, const char *name)
|
|
|
|
|
{
|
|
|
|
|
char safe_name[MAX_ID_NAME - 2];
|
|
|
|
|
rna_idname_validate(name, safe_name);
|
|
|
|
|
|
|
|
|
|
Simulation *simulation = BKE_simulation_add(bmain, safe_name);
|
|
|
|
|
id_us_min(&simulation->id);
|
2021-01-07 14:06:43 +01:00
|
|
|
|
|
|
|
|
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
|
|
|
|
|
|
2020-04-20 10:37:38 +02:00
|
|
|
return simulation;
|
|
|
|
|
}
|
2020-08-17 09:47:10 +02:00
|
|
|
# endif
|
2020-04-20 10:37:38 +02:00
|
|
|
|
2018-05-29 15:57:14 +02:00
|
|
|
/* tag functions, all the same */
|
2016-02-15 19:33:34 +01:00
|
|
|
# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
|
2018-07-01 15:47:09 +02:00
|
|
|
static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \
|
|
|
|
|
{ \
|
2016-02-15 19:35:35 +01:00
|
|
|
BKE_main_id_tag_listbase(&bmain->_listbase_name, LIB_TAG_DOIT, value); \
|
2016-02-15 19:33:34 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(cameras, cameras, ID_CA)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(scenes, scenes, ID_SCE)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(objects, objects, ID_OB)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(materials, materials, ID_MA)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetrees, ID_NT)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, meshes, ID_ME)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lights, ID_LA)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, libraries, ID_LI)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screens, ID_SCR)
|
2016-02-15 19:33:34 +01:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)
|
2019-03-08 09:29:17 +11:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(images, images, ID_IM)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(lattices, lattices, ID_LT)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(curves, curves, ID_CU)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(metaballs, metaballs, ID_MB)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(fonts, fonts, ID_VF)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(textures, textures, ID_TE)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(brushes, brushes, ID_BR)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(worlds, worlds, ID_WO)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(collections, collections, ID_GR)
|
2019-05-01 11:09:22 +10:00
|
|
|
// RNA_MAIN_ID_TAG_FUNCS_DEF(shape_keys, key, ID_KE)
|
2019-03-08 09:29:17 +11:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(texts, texts, ID_TXT)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(speakers, speakers, ID_SPK)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(sounds, sounds, ID_SO)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(armatures, armatures, ID_AR)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(actions, actions, ID_AC)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(particles, particles, ID_PA)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(palettes, palettes, ID_PAL)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(gpencils, gpencils, ID_GD)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(movieclips, movieclips, ID_MC)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(masks, masks, ID_MSK)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(linestyle, linestyles, ID_LS)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS)
|
|
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP)
|
2020-08-17 09:47:10 +02:00
|
|
|
# ifdef WITH_HAIR_NODES
|
2020-03-17 14:41:48 +01:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(hairs, hairs, ID_HA)
|
2020-08-17 09:47:10 +02:00
|
|
|
# endif
|
2020-12-15 13:07:02 +01:00
|
|
|
# ifdef WITH_POINT_CLOUD
|
2020-03-17 14:41:48 +01:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
|
2020-12-15 13:07:02 +01:00
|
|
|
# endif
|
2020-03-17 14:41:48 +01:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
|
2020-10-21 13:47:50 +02:00
|
|
|
# ifdef WITH_GEOMETRY_NODES
|
2020-04-20 10:37:38 +02:00
|
|
|
RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SIM)
|
2020-08-17 09:47:10 +02:00
|
|
|
# endif
|
2016-02-15 19:33:34 +01:00
|
|
|
|
|
|
|
|
# undef RNA_MAIN_ID_TAG_FUNCS_DEF
|
2011-11-02 20:56:52 +00:00
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
#else
|
|
|
|
|
|
2015-05-11 16:29:12 +02:00
|
|
|
void RNA_api_main(StructRNA *UNUSED(srna))
|
2009-06-18 19:48:55 +00:00
|
|
|
{
|
2012-04-22 11:54:53 +00:00
|
|
|
# if 0
|
2009-06-18 19:48:55 +00:00
|
|
|
FunctionRNA *func;
|
2009-06-20 16:32:52 +00:00
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
/* maybe we want to add functions in 'bpy.data' still?
|
|
|
|
|
* for now they are all in collections bpy.data.images.new(...) */
|
2012-05-12 11:01:29 +00:00
|
|
|
func = RNA_def_function(srna, "add_image", "rna_Main_add_image");
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new image");
|
2014-01-16 21:43:22 +11:00
|
|
|
parm = RNA_def_string_file_path(func, "filepath", NULL, 0, "", "File path to load image from");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-05-12 11:01:29 +00:00
|
|
|
parm = RNA_def_pointer(func, "image", "Image", "", "New image");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2012-04-22 11:54:53 +00:00
|
|
|
# endif
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RNA_def_main_cameras(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataCameras");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataCameras", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Cameras", "Collection of cameras");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_cameras_new");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new camera to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Camera", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "camera", "Camera", "", "New camera data-block");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "camera", "Camera", "", "Camera to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2016-06-25 17:01:36 +02:00
|
|
|
"Unlink all usages of this camera before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that camera data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this camera");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this camera");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_cameras_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RNA_def_main_scenes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataScenes");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataScenes", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Scenes", "Collection of scenes");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_scenes_new");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new scene to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Scene", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "scene", "Scene", "", "New scene data-block");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_scenes_remove");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a scene from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this scene before deleting it");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-04-23 07:26:08 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_scenes_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void RNA_def_main_objects(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataObjects");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataObjects", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Objects", "Collection of objects");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_objects_new");
|
2010-02-22 00:07:46 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new object to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "object_data", "ID", "", "Object data or None for an empty object");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "object", "Object", "", "New object data-block");
|
2009-06-20 16:32:52 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a object from the current blendfile");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this object before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this object");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this object");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_objects_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2009-06-24 19:23:34 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_materials(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataMaterials");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataMaterials", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2011-09-30 08:10:53 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Materials", "Collection of materials");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_materials_new");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new material to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Material", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "material", "Material", "", "New material data-block");
|
2009-06-20 16:32:52 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-07-31 10:22:19 +02:00
|
|
|
func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_materials_gpencil_data");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add grease pencil material settings");
|
|
|
|
|
parm = RNA_def_pointer(func, "material", "Material", "", "Material");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-05-02 16:26:57 +02:00
|
|
|
func = RNA_def_function(srna, "remove_gpencil_data", "rna_Main_materials_gpencil_remove");
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove grease pencil material settings");
|
|
|
|
|
parm = RNA_def_pointer(func, "material", "Material", "", "Material");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a material from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "material", "Material", "", "Material to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this material before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this material");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this material");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_materials_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_node_groups(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-05-15 13:30:14 +00:00
|
|
|
StructRNA *srna;
|
2010-12-03 03:44:39 +00:00
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem dummy_items[] = {
|
2013-03-18 16:34:57 +00:00
|
|
|
{0, "DUMMY", 0, "", ""},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataNodeTrees");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataNodeTrees", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Node Trees", "Collection of node trees");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_nodetree_new");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new node tree to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "NodeGroup", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2013-03-18 16:34:57 +00:00
|
|
|
parm = RNA_def_enum(func, "type", dummy_items, 0, "Type", "The type of node_group to add");
|
|
|
|
|
RNA_def_property_enum_funcs(parm, NULL, NULL, "rna_Main_nodetree_type_itemf");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-05-15 13:30:14 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "tree", "NodeTree", "", "New node tree data-block");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a node tree from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "tree", "NodeTree", "", "Node tree to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this node tree before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this node tree");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this node tree");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_node_groups_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_meshes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataMeshes");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataMeshes", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Meshes", "Collection of meshes");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_meshes_new");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new mesh to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Mesh", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "mesh", "Mesh", "", "New mesh data-block");
|
2009-12-02 15:37:07 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-02-05 12:46:15 +00:00
|
|
|
func = RNA_def_function(srna, "new_from_object", "rna_Main_meshes_new_from_object");
|
Dependency graph API changes
Main goal here is to make it obvious and predictable about
what is going on.
Summary of changes.
- Access to dependency graph is now only possible to a fully evaluated
graph. This is now done via context.evaluated_depsgraph_get().
The call will ensure both relations and datablocks are updated.
This way we don't allow access to some known bad state of the graph,
and also making explicit that getting update dependency graph is not
cheap.
- Access to evaluated ID is now possible via id.evaluated_get().
It was already possible to get evaluated ID via dependency graph,
but that was a bit confusing why access to original is done via ID
and to evaluated via depsgraph.
If datablock is not covered by dependency graph it will be returned
as-is.
- Similarly, request for original from an ID which is not evaluated
will return ID as-is.
- Removed scene.update().
This is very expensive to update all the view layers.
- Added depsgraph.update().
Now when temporary changes to objects are to be done, this is to
happen on original object and then dependency graph is to be
updated.
- Changed object.to_mesh() to behave the following way:
* When is used for original object modifiers are ignored.
For meshes this acts similar to mesh-copy, not very useful but
allows to keep code paths similar (i.e. for exporter which has
Apply Modifiers option it's only matter choosing between original
and evaluated object, the to_mesh() part can stay the same).
For curves this gives a mesh which is constructed from displist
without taking own modifiers and modifiers of bevel/taper objects
into account.
For metaballs this gives empty mesh.
Polygonization of metaball is not possible from a single object.
* When is used for evaluated object modifiers are always applied.
In fact, no evaluation is happening, the mesh is either copied
as-is, or constructed from current state of curve cache.
Arguments to apply modifiers and calculate original coordinates (ORCO,
aka undeformed coordinates) are removed. The ORCO is to be calculated
as part of dependency graph evaluation.
File used to regression-test (a packed Python script into .blend):
{F7033464}
Patch to make addons tests to pass:
{F7033466}
NOTE: I've included changes to FBX exporter, and those are addressing
report T63689.
NOTE: All the enabled-by-default addons are to be ported still, but
first want to have agreement on this part of changes.
NOTE: Also need to work on documentation for Python API, but, again,
better be done after having agreement on this work.
Reviewers: brecht, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D4834
2019-05-09 11:26:49 +02:00
|
|
|
RNA_def_function_ui_description(
|
|
|
|
|
func,
|
|
|
|
|
"Add a new mesh created from given object (undeformed geometry if object is original, and "
|
|
|
|
|
"final evaluated geometry, with all modifiers etc., if object is evaluated)");
|
2013-02-05 12:46:15 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
parm = RNA_def_pointer(func, "object", "Object", "", "Object to create mesh from");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
|
2019-05-24 14:37:47 +02:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"preserve_all_data_layers",
|
|
|
|
|
false,
|
|
|
|
|
"",
|
|
|
|
|
"Preserve all data layers in the mesh, like UV maps and vertex groups. "
|
|
|
|
|
"By default Blender only computes the subset of data layers needed for viewport "
|
|
|
|
|
"display and rendering, for better performance");
|
|
|
|
|
RNA_def_pointer(
|
|
|
|
|
func,
|
|
|
|
|
"depsgraph",
|
|
|
|
|
"Depsgraph",
|
|
|
|
|
"Dependency Graph",
|
|
|
|
|
"Evaluated dependency graph which is required when preserve_all_data_layers is true");
|
2013-02-05 12:46:15 +00:00
|
|
|
parm = RNA_def_pointer(func,
|
|
|
|
|
"mesh",
|
|
|
|
|
"Mesh",
|
|
|
|
|
"",
|
|
|
|
|
"Mesh created from object, remove it if it is only used for export");
|
|
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a mesh from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2016-06-25 17:01:36 +02:00
|
|
|
"Unlink all usages of this mesh before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that mesh data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this mesh data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this mesh data");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_meshes_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2018-06-27 14:41:53 +02:00
|
|
|
|
|
|
|
|
void RNA_def_main_lights(BlenderRNA *brna, PropertyRNA *cprop)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-27 14:41:53 +02:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataLights");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataLights", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2018-06-27 14:41:53 +02:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Lights", "Collection of lights");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-27 14:41:53 +02:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_lights_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new light to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "Light", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2018-06-27 14:41:53 +02:00
|
|
|
parm = RNA_def_enum(
|
|
|
|
|
func, "type", rna_enum_light_type_items, 0, "Type", "The type of texture to add");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
2018-06-27 14:41:53 +02:00
|
|
|
parm = RNA_def_pointer(func, "light", "Light", "", "New light data-block");
|
2009-08-13 11:14:06 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2018-06-27 14:41:53 +02:00
|
|
|
RNA_def_function_ui_description(func, "Remove a light from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "light", "Light", "", "Light to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2018-06-27 14:41:53 +02:00
|
|
|
"Unlink all usages of this Light before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that light data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2018-06-27 14:41:53 +02:00
|
|
|
"Decrement user counter of all datablocks used by this light data");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
2018-06-27 14:41:53 +02:00
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this light data");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-27 14:41:53 +02:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_lights_tag");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2011-01-05 05:33:27 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_libraries(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2011-01-05 05:33:27 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataLibraries");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataLibraries", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2011-01-05 05:33:27 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Libraries", "Collection of libraries");
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_libraries_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2020-06-12 17:51:58 +02:00
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a camera from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "library", "Library", "", "Library to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this library before deleting it");
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this object");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this object");
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2011-01-05 05:33:27 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_screens(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2011-01-05 05:33:27 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2009-07-02 20:46:35 +00:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataScreens");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataScreens", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2011-01-05 05:33:27 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Screens", "Collection of screens");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_screens_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2011-01-05 05:33:27 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_window_managers(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2011-01-05 05:33:27 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataWindowManagers");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataWindowManagers", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2011-01-05 05:33:27 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Window Managers", "Collection of window managers");
|
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_window_managers_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_images(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataImages");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataImages", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Images", "Collection of images");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_images_new");
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new image to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Image", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-10-11 23:46:12 +00:00
|
|
|
parm = RNA_def_int(func, "width", 1024, 1, INT_MAX, "", "Width of the image", 1, INT_MAX);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-10-11 23:46:12 +00:00
|
|
|
parm = RNA_def_int(func, "height", 1024, 1, INT_MAX, "", "Height of the image", 1, INT_MAX);
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2011-01-10 03:58:07 +00:00
|
|
|
RNA_def_boolean(func, "alpha", 0, "Alpha", "Use alpha channel");
|
|
|
|
|
RNA_def_boolean(
|
2020-12-24 13:11:22 -06:00
|
|
|
func, "float_buffer", 0, "Float Buffer", "Create an image with floating-point color");
|
2015-04-06 10:40:12 -03:00
|
|
|
RNA_def_boolean(func, "stereo3d", 0, "Stereo 3D", "Create left and right views");
|
2019-06-26 15:04:44 +02:00
|
|
|
RNA_def_boolean(func, "is_data", 0, "Is Data", "Create image with non-color data color space");
|
Add support for tiled images and the UDIM naming scheme
This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.
With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.
The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.
The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles
There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images
Thanks to Brecht for the review and to all who tested the intermediate versions!
Differential Revision: https://developer.blender.org/D3509
2019-12-12 16:06:08 +01:00
|
|
|
RNA_def_boolean(func, "tiled", 0, "Tiled", "Create a tiled image");
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "load", "rna_Main_images_load");
|
2010-07-03 17:47:06 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Load a new image into the main database");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_string_file_path(
|
|
|
|
|
func, "filepath", "File Path", 0, "", "path of the file to load");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-10-06 19:40:15 +11:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"check_existing",
|
|
|
|
|
false,
|
|
|
|
|
"",
|
|
|
|
|
"Using existing data-block if this file is already loaded");
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "image", "Image", "", "New image data-block");
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove an image from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "image", "Image", "", "Image to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this image before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this image");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this image");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_images_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_lattices(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-05-14 21:16:37 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataLattices");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataLattices", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Lattices", "Collection of lattices");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_lattices_new");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new lattice to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Lattice", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-05-14 21:16:37 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "lattice", "Lattice", "", "New lattices data-block");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a lattice from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "lattice", "Lattice", "", "Lattice to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2016-06-25 17:01:36 +02:00
|
|
|
"Unlink all usages of this lattice before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that lattice data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this lattice data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this lattice data");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_lattices_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_curves(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-03-23 14:58:36 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataCurves");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataCurves", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-03-23 14:58:36 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Curves", "Collection of curves");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_curves_new");
|
2010-03-23 14:58:36 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new curve to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Curve", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-11-23 13:49:52 +11:00
|
|
|
parm = RNA_def_enum(
|
|
|
|
|
func, "type", rna_enum_object_type_curve_items, 0, "Type", "The type of curve to add");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-03-23 14:58:36 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "curve", "Curve", "", "New curve data-block");
|
2010-03-23 14:58:36 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-03-23 14:58:36 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a curve from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "curve", "Curve", "", "Curve to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2016-06-25 17:01:36 +02:00
|
|
|
"Unlink all usages of this curve before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that curve data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this curve data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this curve data");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_curves_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_metaballs(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-05-14 21:16:37 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataMetaBalls");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataMetaBalls", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2012-03-02 21:14:37 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Metaballs", "Collection of metaballs");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_metaballs_new");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new metaball to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "MetaBall", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-05-14 21:16:37 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "New metaball data-block");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a metaball from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "metaball", "MetaBall", "", "Metaball to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2016-06-25 17:01:36 +02:00
|
|
|
"Unlink all usages of this metaball before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that metaball data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this metaball data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this metaball data");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_metaballs_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2010-05-08 07:25:26 +00:00
|
|
|
void RNA_def_main_fonts(BlenderRNA *brna, PropertyRNA *cprop)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
2010-05-15 13:30:14 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataFonts");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataFonts", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Fonts", "Collection of fonts");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "load", "rna_Main_fonts_load");
|
2010-07-03 17:47:06 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_ui_description(func, "Load a new font into the main database");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_string_file_path(
|
|
|
|
|
func, "filepath", "File Path", 0, "", "path of the font to load");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-10-06 19:40:15 +11:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"check_existing",
|
|
|
|
|
false,
|
|
|
|
|
"",
|
|
|
|
|
"Using existing data-block if this file is already loaded");
|
2010-05-15 13:30:14 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "New font data-block");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a font from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "vfont", "VectorFont", "", "Font to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this font before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this font");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this font");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_fonts_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_textures(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-01-17 20:06:34 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataTextures");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataTextures", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Textures", "Collection of textures");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_textures_new");
|
2010-01-17 20:06:34 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new texture to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Texture", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-11-23 13:49:52 +11:00
|
|
|
parm = RNA_def_enum(
|
|
|
|
|
func, "type", rna_enum_texture_type_items, 0, "Type", "The type of texture to add");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-17 20:06:34 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "texture", "Texture", "", "New texture data-block");
|
2010-01-17 20:06:34 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-01-17 20:06:34 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a texture from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "texture", "Texture", "", "Texture to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this texture before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this texture");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this texture");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_textures_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_brushes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-05-14 21:16:37 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataBrushes");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataBrushes", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Brushes", "Collection of brushes");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_brushes_new");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new brush to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Brush", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-11-23 13:49:52 +11:00
|
|
|
parm = RNA_def_enum(func,
|
|
|
|
|
"mode",
|
|
|
|
|
rna_enum_object_mode_items,
|
|
|
|
|
OB_MODE_TEXTURE_PAINT,
|
|
|
|
|
"",
|
|
|
|
|
"Paint Mode for the new brush");
|
2010-05-14 21:16:37 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "brush", "Brush", "", "New brush data-block");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-05-14 21:16:37 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a brush from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this brush before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this brush");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this brush");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_brushes_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-08-05 16:19:24 +02:00
|
|
|
func = RNA_def_function(srna, "create_gpencil_data", "rna_Main_brush_gpencil_data");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add grease pencil brush settings");
|
|
|
|
|
parm = RNA_def_pointer(func, "brush", "Brush", "", "Brush");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2010-05-15 13:30:14 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_worlds(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-05-15 13:30:14 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataWorlds");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataWorlds", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Worlds", "Collection of worlds");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_worlds_new");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new world to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "World", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-05-15 13:30:14 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "world", "World", "", "New world data-block");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-05-15 13:30:14 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a world from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "world", "World", "", "World to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this world before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this world");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this world");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_worlds_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2010-05-15 13:30:14 +00:00
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
void RNA_def_main_collections(BlenderRNA *brna, PropertyRNA *cprop)
|
2010-01-09 23:44:01 +00:00
|
|
|
{
|
2010-01-11 23:40:01 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataCollections");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataCollections", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Collections", "Collection of collections");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_collections_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new collection to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "Collection", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-11 23:40:01 +00:00
|
|
|
/* return type */
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
parm = RNA_def_pointer(func, "collection", "Collection", "", "New collection data-block");
|
2010-01-11 23:40:01 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
RNA_def_function_ui_description(func, "Remove a collection from the current blendfile");
|
2016-06-25 17:01:36 +02:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
parm = RNA_def_pointer(func, "collection", "Collection", "", "Collection to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this collection before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
"Decrement user counter of all datablocks used by this collection");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this collection");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_collections_tag");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2011-08-01 11:44:20 +00:00
|
|
|
|
|
|
|
|
void RNA_def_main_speakers(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-08-01 11:44:20 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataSpeakers");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataSpeakers", NULL);
|
2011-08-01 11:44:20 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Speakers", "Collection of speakers");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_speakers_new");
|
2011-08-01 11:44:20 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new speaker to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Speaker", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2011-08-01 11:44:20 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "speaker", "Speaker", "", "New speaker data-block");
|
2011-08-01 11:44:20 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2011-08-01 11:44:20 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a speaker from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "speaker", "Speaker", "", "Speaker to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2016-06-25 17:01:36 +02:00
|
|
|
"Unlink all usages of this speaker before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that speaker data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this speaker data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this speaker data");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_speakers_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2011-08-01 11:44:20 +00:00
|
|
|
}
|
|
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-01-11 00:41:31 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataTexts");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataTexts", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Texts", "Collection of texts");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_texts_new");
|
2010-01-11 00:41:31 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new text to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Text", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-11 00:41:31 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
|
2010-01-11 00:41:31 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a text from the current blendfile");
|
2016-06-25 17:01:36 +02:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "text", "Text", "", "Text to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this text before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this text");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this text");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2010-01-11 00:41:31 +00:00
|
|
|
/* load func */
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "load", "rna_Main_texts_load");
|
2010-01-11 00:41:31 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new text to the main database from a file");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string_file_path(
|
|
|
|
|
func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2013-06-02 17:52:06 +00:00
|
|
|
parm = RNA_def_boolean(
|
|
|
|
|
func, "internal", 0, "Make internal", "Make text file internal after loading");
|
2010-01-11 00:41:31 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "text", "Text", "", "New text data-block");
|
2010-01-11 00:41:31 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_texts_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2011-01-05 05:33:27 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_sounds(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2011-01-05 05:33:27 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataSounds");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataSounds", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2011-01-05 05:33:27 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Sounds", "Collection of sounds");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-05-01 00:57:12 +10:00
|
|
|
/* load func */
|
|
|
|
|
func = RNA_def_function(srna, "load", "rna_Main_sounds_load");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new sound to the main database from a file");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string_file_path(
|
|
|
|
|
func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-10-06 19:40:15 +11:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"check_existing",
|
|
|
|
|
false,
|
|
|
|
|
"",
|
|
|
|
|
"Using existing data-block if this file is already loaded");
|
2015-05-01 00:57:12 +10:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "sound", "Sound", "", "New text data-block");
|
2015-05-01 00:57:12 +10:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2015-05-01 00:57:12 +10:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a sound from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "sound", "Sound", "", "Sound to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this sound before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this sound");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this sound");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_sounds_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2011-01-05 05:33:27 +00:00
|
|
|
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_armatures(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataArmatures");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataArmatures", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Armatures", "Collection of armatures");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_armatures_new");
|
2010-01-09 23:44:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new armature to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Armature", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "armature", "Armature", "", "New armature data-block");
|
2009-07-03 17:44:20 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-01-10 15:20:22 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a armature from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "armature", "Armature", "", "Armature to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
2016-06-25 17:01:36 +02:00
|
|
|
"Unlink all usages of this armature before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that armature data)");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this armature data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this armature data");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_armatures_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2010-01-11 23:40:01 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataActions");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataActions", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-02-10 21:15:44 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Actions", "Collection of actions");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_actions_new");
|
2010-01-11 23:40:01 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new action to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Action", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-11 23:40:01 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "action", "Action", "", "New action data-block");
|
2010-01-11 23:40:01 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-01-11 23:40:01 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-09-19 13:23:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a action from the current blendfile");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "action", "Action", "", "Action to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this action before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this action");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this action");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_actions_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-01-09 23:44:01 +00:00
|
|
|
}
|
2016-12-28 17:30:58 +01:00
|
|
|
void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-12-28 17:30:58 +01:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataParticles");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataParticles", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Particle Settings", "Collection of particle settings");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-12-28 17:30:58 +01:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_particles_new");
|
|
|
|
|
RNA_def_function_ui_description(func,
|
|
|
|
|
"Add a new particle settings instance to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "ParticleSettings", 0, "", "New name for the data-block");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
/* return type */
|
|
|
|
|
parm = RNA_def_pointer(
|
|
|
|
|
func, "particle", "ParticleSettings", "", "New particle settings data-block");
|
|
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-12-28 17:30:58 +01:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(
|
|
|
|
|
func, "Remove a particle settings instance from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "particle", "ParticleSettings", "", "Particle Settings to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Unlink all usages of those particle settings before deleting them");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this particle settings");
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_ui_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Make sure interface does not reference this particle settings");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-12-28 17:30:58 +01:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_particles_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
}
|
2010-01-09 23:44:01 +00:00
|
|
|
|
2015-03-12 23:47:48 +11:00
|
|
|
void RNA_def_main_palettes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-03-12 23:47:48 +11:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataPalettes");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataPalettes", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Palettes", "Collection of palettes");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-03-12 23:47:48 +11:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_palettes_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new palette to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "Palette", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-03-12 23:47:48 +11:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "palette", "Palette", "", "New palette data-block");
|
2015-03-12 23:47:48 +11:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2015-03-12 23:47:48 +11:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a palette from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "palette", "Palette", "", "Palette to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this palette before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this palette");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this palette");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-03-12 23:47:48 +11:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_palettes_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-03-12 23:47:48 +11:00
|
|
|
}
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
void RNA_def_main_cachefiles(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataCacheFiles");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataCacheFiles", NULL);
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Cache Files", "Collection of cache files");
|
|
|
|
|
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_cachefiles_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
}
|
2016-09-14 16:13:21 +02:00
|
|
|
void RNA_def_main_paintcurves(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
2016-09-14 16:13:21 +02:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataPaintCurves");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataPaintCurves", NULL);
|
2016-09-14 16:13:21 +02:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Paint Curves", "Collection of paint curves");
|
|
|
|
|
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_paintcurves_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2016-09-14 16:13:21 +02:00
|
|
|
}
|
2010-01-09 23:44:01 +00:00
|
|
|
void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
2011-01-05 05:33:27 +00:00
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataGreasePencils");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataGreasePencils", NULL);
|
2011-03-13 13:01:02 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2011-01-05 05:33:27 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Grease Pencils", "Collection of grease pencils");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-03-08 09:29:17 +11:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_gpencils_tag");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-06-25 18:52:22 +02:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_gpencils_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new grease pencil datablock to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "GreasePencil", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-10-07 20:07:30 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(
|
|
|
|
|
func, "grease_pencil", "GreasePencil", "", "New grease pencil data-block");
|
2012-10-07 20:07:30 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2012-10-07 20:07:30 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func,
|
|
|
|
|
"Remove a grease pencil instance from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "grease_pencil", "GreasePencil", "", "Grease Pencil to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this grease pencil before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this grease pencil");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this grease pencil");
|
2009-06-18 19:48:55 +00:00
|
|
|
}
|
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
void RNA_def_main_movieclips(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataMovieClips");
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataMovieClips", NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Movie Clips", "Collection of movie clips");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_movieclips_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a movie clip from the current blendfile.");
|
2012-03-05 23:30:41 +00:00
|
|
|
parm = RNA_def_pointer(func, "clip", "MovieClip", "", "Movie clip to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this movie clip before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this movie clip");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this movie clip");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
/* load func */
|
2012-03-05 23:30:41 +00:00
|
|
|
func = RNA_def_function(srna, "load", "rna_Main_movieclip_load");
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2016-02-01 11:55:59 +11:00
|
|
|
RNA_def_function_ui_description(
|
|
|
|
|
func,
|
|
|
|
|
"Add a new movie clip to the main database from a file "
|
|
|
|
|
"(while ``check_existing`` is disabled for consistency with other load functions, "
|
|
|
|
|
"behavior with multiple movie-clips using the same file may incorrectly generate proxies)");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string_file_path(
|
|
|
|
|
func, "filepath", "Path", FILE_MAX, "", "path for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2015-10-06 19:40:15 +11:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"check_existing",
|
|
|
|
|
false,
|
|
|
|
|
"",
|
|
|
|
|
"Using existing data-block if this file is already loaded");
|
2011-11-07 12:55:18 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "clip", "MovieClip", "", "New movie clip data-block");
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2009-06-18 19:48:55 +00:00
|
|
|
}
|
2011-10-30 09:05:47 +00:00
|
|
|
|
2012-06-04 16:42:58 +00:00
|
|
|
void RNA_def_main_masks(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-04 16:42:58 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataMasks");
|
2012-06-27 18:29:47 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataMasks", NULL);
|
2012-06-04 16:42:58 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Masks", "Collection of masks");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-27 18:29:47 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_masks_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-04 16:42:58 +00:00
|
|
|
/* new func */
|
|
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_mask_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new mask with a given name to the main database");
|
2018-09-25 12:01:43 +02:00
|
|
|
parm = RNA_def_string(
|
|
|
|
|
func, "name", NULL, MAX_ID_NAME - 2, "Mask", "Name of new mask data-block");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2012-06-04 16:42:58 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "mask", "Mask", "", "New mask data-block");
|
2012-06-04 16:42:58 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-04 16:42:58 +00:00
|
|
|
/* remove func */
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2012-06-04 16:42:58 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a masks from the current blendfile.");
|
2012-06-27 18:29:47 +00:00
|
|
|
parm = RNA_def_pointer(func, "mask", "Mask", "", "Mask to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this mask before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_id_user", true, "", "Decrement user counter of all datablocks used by this mask");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this mask");
|
2012-06-04 16:42:58 +00:00
|
|
|
}
|
|
|
|
|
|
2010-06-25 22:45:42 +00:00
|
|
|
void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-02-23 03:08:11 +00:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataLineStyles");
|
2012-12-11 22:00:22 +00:00
|
|
|
srna = RNA_def_struct(brna, "BlendDataLineStyles", NULL);
|
2011-03-19 00:05:30 +00:00
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2010-06-25 22:45:42 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Line Styles", "Collection of line styles");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2013-04-07 01:38:03 +00:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_linestyle_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-12-11 22:00:22 +00:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_linestyles_new");
|
2010-06-25 22:45:42 +00:00
|
|
|
RNA_def_function_ui_description(func, "Add a new line style instance to the main database");
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_string(func, "name", "FreestyleLineStyle", 0, "", "New name for the data-block");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2010-06-25 22:45:42 +00:00
|
|
|
/* return type */
|
2015-10-24 02:44:43 +11:00
|
|
|
parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "New line style data-block");
|
2010-06-25 22:45:42 +00:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-06-25 17:01:36 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
2010-06-25 22:45:42 +00:00
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
2011-10-30 09:05:47 +00:00
|
|
|
RNA_def_function_ui_description(func, "Remove a line style instance from the current blendfile");
|
2012-12-11 22:00:22 +00:00
|
|
|
parm = RNA_def_pointer(func, "linestyle", "FreestyleLineStyle", "", "Line style to remove");
|
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
2016-12-12 15:23:55 +01:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
2016-11-15 17:12:18 +01:00
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this line style before deleting it");
|
2017-09-13 20:12:19 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this line style");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this line style");
|
2010-06-25 22:45:42 +00:00
|
|
|
}
|
2009-06-18 19:48:55 +00:00
|
|
|
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataWorkSpaces", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-12 20:59:54 +10:00
|
|
|
void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop)
|
2017-06-06 22:47:41 +02:00
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-06 22:47:41 +02:00
|
|
|
RNA_def_property_srna(cprop, "BlendDataProbes");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataProbes", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
2017-06-12 20:59:54 +10:00
|
|
|
RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-12 20:59:54 +10:00
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
|
2017-06-06 22:47:41 +02:00
|
|
|
RNA_def_function_ui_description(func, "Add a new probe to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2020-01-17 19:14:23 +01:00
|
|
|
parm = RNA_def_enum(
|
|
|
|
|
func, "type", rna_enum_lightprobes_type_items, 0, "Type", "The type of lightprobe to add");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
2017-06-06 22:47:41 +02:00
|
|
|
/* return type */
|
2017-06-12 20:59:54 +10:00
|
|
|
parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
|
2017-06-06 22:47:41 +02:00
|
|
|
RNA_def_function_return(func, parm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-06 22:47:41 +02:00
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a probe from the current blendfile");
|
2017-06-12 20:59:54 +10:00
|
|
|
parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Probe to remove");
|
2017-06-06 22:47:41 +02:00
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Unlink all usages of this probe before deleting it "
|
2017-06-12 20:59:54 +10:00
|
|
|
"(WARNING: will also delete objects instancing that light probe data)");
|
2017-09-15 12:30:58 +05:00
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this light probe");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this light probe");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2017-06-12 20:59:54 +10:00
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
|
2017-06-06 22:47:41 +02:00
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-17 09:47:10 +02:00
|
|
|
# ifdef WITH_HAIR_NODES
|
2020-03-17 14:41:48 +01:00
|
|
|
void RNA_def_main_hairs(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "BlendDataHairs");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataHairs", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Hairs", "Collection of hairs");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_hairs_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new hair to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "Hair", 0, "", "New name for the data-block");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
/* return type */
|
|
|
|
|
parm = RNA_def_pointer(func, "hair", "Hair", "", "New hair data-block");
|
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a hair from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "hair", "Hair", "", "Hair to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Unlink all usages of this hair before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that hair data)");
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this hair data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this hair data");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_hairs_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
}
|
2020-08-17 09:47:10 +02:00
|
|
|
# endif
|
2020-03-17 14:41:48 +01:00
|
|
|
|
2020-12-15 13:07:02 +01:00
|
|
|
# ifdef WITH_POINT_CLOUD
|
2020-03-17 14:41:48 +01:00
|
|
|
void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "BlendDataPointClouds");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataPointClouds", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Point Clouds", "Collection of point clouds");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_pointclouds_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new point cloud to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "PointCloud", 0, "", "New name for the data-block");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
/* return type */
|
|
|
|
|
parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "New point cloud data-block");
|
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a point cloud from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "pointcloud", "PointCloud", "", "Point cloud to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Unlink all usages of this point cloud before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that point cloud data)");
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this point cloud data");
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_ui_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Make sure interface does not reference this point cloud data");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_pointclouds_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
}
|
2020-12-15 13:07:02 +01:00
|
|
|
# endif
|
2020-03-17 14:41:48 +01:00
|
|
|
|
|
|
|
|
void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "BlendDataVolumes");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataVolumes", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Volumes", "Collection of volumes");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_volumes_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new volume to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "Volume", 0, "", "New name for the data-block");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
/* return type */
|
|
|
|
|
parm = RNA_def_pointer(func, "volume", "Volume", "", "New volume data-block");
|
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a volume from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "volume", "Volume", "", "Volume to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_unlink",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Unlink all usages of this volume before deleting it "
|
|
|
|
|
"(WARNING: will also delete objects instancing that volume data)");
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this volume data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this volume data");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_volumes_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-21 13:47:50 +02:00
|
|
|
# ifdef WITH_GEOMETRY_NODES
|
2020-04-20 10:37:38 +02:00
|
|
|
void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop)
|
|
|
|
|
{
|
|
|
|
|
StructRNA *srna;
|
|
|
|
|
FunctionRNA *func;
|
|
|
|
|
PropertyRNA *parm;
|
|
|
|
|
|
|
|
|
|
RNA_def_property_srna(cprop, "BlendDataSimulations");
|
|
|
|
|
srna = RNA_def_struct(brna, "BlendDataSimulations", NULL);
|
|
|
|
|
RNA_def_struct_sdna(srna, "Main");
|
|
|
|
|
RNA_def_struct_ui_text(srna, "Main Simulations", "Collection of simulations");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "new", "rna_Main_simulations_new");
|
|
|
|
|
RNA_def_function_ui_description(func, "Add a new simulation to the main database");
|
|
|
|
|
parm = RNA_def_string(func, "name", "Simulation", 0, "", "New name for the data-block");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
/* return type */
|
|
|
|
|
parm = RNA_def_pointer(func, "simulation", "Simulation", "", "New simulation data-block");
|
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
|
|
|
|
|
RNA_def_function_flag(func, FUNC_USE_REPORTS);
|
|
|
|
|
RNA_def_function_ui_description(func, "Remove a simulation from the current blendfile");
|
|
|
|
|
parm = RNA_def_pointer(func, "simulation", "Simulation", "", "Simulation to remove");
|
|
|
|
|
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
|
|
|
|
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_unlink", true, "", "Unlink all usages of this simulation before deleting it");
|
|
|
|
|
RNA_def_boolean(func,
|
|
|
|
|
"do_id_user",
|
|
|
|
|
true,
|
|
|
|
|
"",
|
|
|
|
|
"Decrement user counter of all datablocks used by this simulation data");
|
|
|
|
|
RNA_def_boolean(
|
|
|
|
|
func, "do_ui_user", true, "", "Make sure interface does not reference this simulation data");
|
|
|
|
|
|
|
|
|
|
func = RNA_def_function(srna, "tag", "rna_Main_simulations_tag");
|
|
|
|
|
parm = RNA_def_boolean(func, "value", 0, "Value", "");
|
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
|
|
|
|
|
}
|
2020-08-17 09:47:10 +02:00
|
|
|
# endif
|
2020-04-20 10:37:38 +02:00
|
|
|
|
2009-06-18 19:48:55 +00:00
|
|
|
#endif
|