Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-03-30 18:01:23 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-03-30 18:01:23 +0300
commitce3c7e8ff515e5bfbf70d0f4f60557e26c9d98a1 (patch)
tree1062bd45d22a2a0aff4e4a227079154b78c42263 /source/blender/makesdna
parent98e69631b0cf31b5b73c1d9afb9bd9fc81fc42be (diff)
Layers: use IDProperty and override collection properties system
First this replace a custom data struct with IDProperty, and use IDProperty group merge and copying functions. Which means that a collection property setting is only created if necessary. This implements the "Layer Collection settings" override system, as suggested in the "Override Manifesto" document. The core is working, with Scene, LayerCollection and Object using a single IDProperty to store all the render settings data. Next step is to migrate this to depsgraph. Note: Clay engine "ssao_samples" was hardcoded to 32 for now. It will come back as part of "Workspace Settings" later. Many thanks for Bastien Montagne for the help with the UI template nightmare ;) Differential Revision: https://developer.blender.org/D2563
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_ID.h9
-rw-r--r--source/blender/makesdna/DNA_layer_types.h48
-rw-r--r--source/blender/makesdna/DNA_material_types.h30
-rw-r--r--source/blender/makesdna/DNA_object_types.h3
-rw-r--r--source/blender/makesdna/DNA_scene_types.h40
5 files changed, 12 insertions, 118 deletions
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index 2c6f3d2fc66..9c3e194b78c 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -98,6 +98,15 @@ enum {
IDP_STRING_SUB_BYTE = 1, /* arbitrary byte array, _not_ null terminated */
};
+/* IDP_GROUP */
+enum {
+ IDP_GROUP_SUB_NONE = 0, /* default */
+ IDP_GROUP_SUB_MODE_OBJECT = 1, /* object mode settings */
+ IDP_GROUP_SUB_MODE_EDIT = 2, /* mesh edit mode settings */
+ IDP_GROUP_SUB_ENGINE_RENDER = 3, /* render engine settings */
+ IDP_GROUP_SUB_OVERRIDE = 4, /* data override */
+};
+
/*->flag*/
enum {
IDP_FLAG_GHOST = 1 << 7, /* this means the property is set but RNA will return false when checking
diff --git a/source/blender/makesdna/DNA_layer_types.h b/source/blender/makesdna/DNA_layer_types.h
index de2bd51f647..2ea0638acfb 100644
--- a/source/blender/makesdna/DNA_layer_types.h
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -61,6 +61,7 @@ typedef struct LayerCollection {
ListBase layer_collections; /* synced with collection->collections */
ListBase engine_settings; /* CollectionEngineSettings */
ListBase mode_settings; /* CollectionModeSettings */
+ struct IDProperty *properties; /* overrides */
} LayerCollection;
typedef struct SceneLayer {
@@ -112,53 +113,6 @@ enum {
/* *************************************************************** */
/* Engine Settings */
-typedef struct CollectionEngineProperty {
- struct CollectionEngineProperty *next, *prev;
- char name[64]; /* MAX_NAME */
- short type;
- short pad;
- char flag;
- char pad2[3];
-} CollectionEngineProperty;
-
-typedef struct CollectionEnginePropertyInt {
- struct CollectionEngineProperty data;
- int value;
- int pad;
-} CollectionEnginePropertyInt;
-
-typedef struct CollectionEnginePropertyBool {
- struct CollectionEngineProperty data;
- int value;
- int pad;
-} CollectionEnginePropertyBool;
-
-typedef struct CollectionEnginePropertyFloat {
- struct CollectionEngineProperty data;
- float value;
- float pad;
-} CollectionEnginePropertyFloat;
-
-typedef struct CollectionEngineSettings {
- struct CollectionEngineSettings *next, *prev;
- char name[32]; /* engine name - MAX_NAME */
- ListBase properties; /* CollectionProperty */
- int type; /* CollectionEngineSettingsType */
- int pad;
-} CollectionEngineSettings;
-
-/* CollectionEngineProperty->flag */
-enum {
- COLLECTION_PROP_USE = (1 << 0),
-};
-
-/* CollectionEngineProperty.type */
-typedef enum CollectionEnginePropertyType {
- COLLECTION_PROP_TYPE_FLOAT = 0,
- COLLECTION_PROP_TYPE_INT = 1,
- COLLECTION_PROP_TYPE_BOOL = 2,
-} CollectionEnginePropertyType;
-
/* CollectionEngineSettings->type */
typedef enum CollectionEngineSettingsType {
COLLECTION_MODE_NONE = 0,
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index bd8278f897a..67bc49032d5 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -90,38 +90,11 @@ typedef struct TexPaintSlot {
int pad;
} TexPaintSlot;
-/* Material Engine Settings */
-typedef struct MaterialEngineSettings {
- struct MaterialEngineSettings *next, *prev;
- char name[32]; /* engine name - MAX_NAME */
- void *data;
-} MaterialEngineSettings;
-
/* Clay engine */
/* MaterialRuntimeClay.flag */
#define CLAY_OUTDATED 1
-typedef struct MaterialEngineSettingsClay {
- short type;
- short matcap_icon; /* Icon ID */
-
- float matcap_rot;
- float matcap_hue;
- float matcap_sat;
- float matcap_val;
-
- float ssao_distance;
- float ssao_attenuation;
- float ssao_factor_cavity;
- float ssao_factor_edge;
-
- /* Runtime */
- short flag;
- short pad;
- int ubo_index;
-} MaterialEngineSettingsClay;
-
/* MaterialEngineSettingsClay.type */
#define CLAY_MATCAP_NONE 0
#define CLAY_MATCAP_SIMPLE 1
@@ -240,9 +213,6 @@ typedef struct Material {
struct TexPaintSlot *texpaintslot; /* cached slot for painting. Make sure to recalculate before use
* with refresh_texpaint_image_cache */
- /* Engine Settings */
- ListBase engines_settings; /* MaterialEngineSettings */
-
ListBase gpumaterial; /* runtime */
} Material;
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index fb0a02e92ae..59ed6f1222f 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -46,7 +46,6 @@ struct Object;
struct AnimData;
struct Ipo;
struct BoundBox;
-struct CollectionEngineSettings;
struct Path;
struct Material;
struct PartDeflect;
@@ -304,7 +303,7 @@ typedef struct Object {
struct PreviewImage *preview;
- ListBase collection_settings; /* used by depsgraph, flushed from collection-tree */
+ struct IDProperty *collection_properties; /* used by depsgraph, flushed from collection-tree */
} Object;
/* Warning, this is not used anymore because hooks are now modifiers */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index eac599eefc4..e3e97b94304 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -539,44 +539,6 @@ typedef enum BakePassFilter {
#define R_BAKE_PASS_FILTER_ALL (~0)
-/* *************************************************************** */
-/* Engine Settings */
-
-typedef struct RenderEngineSettings {
- struct RenderEngineSettings *next, *prev;
- char name[32]; /* engine name */
- void *data;
-} RenderEngineSettings;
-
-/* Render Data */
-typedef struct RenderEngineSettingsClay {
- /* Use same layout as MaterialEngineSettingsClay so this struct
- * can be used as Material Settings. */
- short type;
- short matcap_icon; /* Icon ID */
-
- float matcap_rot;
- float matcap_hue;
- float matcap_sat;
- float matcap_val;
-
- float ssao_distance;
- float ssao_attenuation;
- float ssao_factor_cavity;
- float ssao_factor_edge;
-
- short flag;
- short pad;
- int ubo_index;
- /* end of MaterialEngineSettingsClay */
-
- /* Global Settings */
- short options;
- short pad1;
- int ssao_samples;
- int pad2[2];
-} RenderEngineSettingsClay;
-
/* RenderEngineSettingsClay.options */
typedef enum ClayFlagSettings {
CLAY_USE_AO = (1 << 0),
@@ -1754,7 +1716,7 @@ typedef struct Scene {
int active_layer;
int pad4;
- ListBase engines_settings; /* RenderEngineSettings */
+ IDProperty *collection_properties; /* settings to be overriden by layer collections */
int pad5[2];
} Scene;