diff options
author | Rohan Rathi <rohanrathi08@gmail.com> | 2018-02-14 11:33:55 +0300 |
---|---|---|
committer | Rohan Rathi <rohanrathi08@gmail.com> | 2018-02-14 11:33:55 +0300 |
commit | d17d562ad07dda529c27e7e9f00dbf7e276b033c (patch) | |
tree | 9ea3bea635e6dc5a9f24e99f8b932450ef3a34df /source/blender/makesrna/intern | |
parent | dd6642bb80acedc601244ed841576c9082e90af3 (diff) | |
parent | b48815a9b75708d158cf7931357904ac8f6b189a (diff) |
Merge branch 'master' into soc-2017-normal-tools
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_dynamicpaint.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_fluidsim.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 67 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_smoke.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 23 |
10 files changed, 77 insertions, 43 deletions
diff --git a/source/blender/makesrna/intern/rna_dynamicpaint.c b/source/blender/makesrna/intern/rna_dynamicpaint.c index fb8389fc2e9..6d93c56885e 100644 --- a/source/blender/makesrna/intern/rna_dynamicpaint.c +++ b/source/blender/makesrna/intern/rna_dynamicpaint.c @@ -34,7 +34,7 @@ #include "DNA_dynamicpaint_types.h" #include "DNA_modifier_types.h" -#include "DNA_object_force.h" +#include "DNA_object_force_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 29354837449..c7cfde18723 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -26,7 +26,7 @@ #include <stdlib.h> -#include "DNA_object_fluidsim.h" +#include "DNA_object_fluidsim_types.h" #include "BLI_threads.h" #include "BLI_utildefines.h" diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 353f5e366f4..0cc5a33f0ca 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -34,7 +34,7 @@ #include "DNA_mesh_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" -#include "DNA_object_force.h" +#include "DNA_object_force_types.h" #include "DNA_scene_types.h" #include "MEM_guardedalloc.h" @@ -1962,12 +1962,6 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; - static const EnumPropertyItem prop_solver_items[] = { - {eBooleanModifierSolver_BMesh, "BMESH", 0, "BMesh", "Use the BMesh boolean solver"}, - {eBooleanModifierSolver_Carve, "CARVE", 0, "Carve", "Use the Carve boolean solver"}, - {0, NULL, 0, NULL, NULL} - }; - srna = RNA_def_struct(brna, "BooleanModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Boolean Modifier", "Boolean operations modifier"); RNA_def_struct_sdna(srna, "BooleanModifierData"); @@ -1984,11 +1978,6 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Operation", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "solver", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_items(prop, prop_solver_items); - RNA_def_property_ui_text(prop, "Solver", ""); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "double_threshold", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "double_threshold"); RNA_def_property_range(prop, 0, 1.0f); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 33c6cc68763..ccd16e16760 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3293,11 +3293,18 @@ static const EnumPropertyItem node_script_mode_items[] = { }; static const EnumPropertyItem node_principled_distribution_items[] = { - { SHD_GLOSSY_GGX, "GGX", 0, "GGX", "" }, - { SHD_GLOSSY_MULTI_GGX, "MULTI_GGX", 0, "Multiscatter GGX", "" }, + {SHD_GLOSSY_GGX, "GGX", 0, "GGX", ""}, + {SHD_GLOSSY_MULTI_GGX, "MULTI_GGX", 0, "Multiscatter GGX", ""}, + {0, NULL, 0, NULL, NULL} +}; + +static const EnumPropertyItem node_subsurface_method_items[] = { + {SHD_SUBSURFACE_BURLEY, "BURLEY", 0, "Christensen-Burley", "Approximation to physically based volume scattering"}, + {SHD_SUBSURFACE_RANDOM_WALK, "RANDOM_WALK", 0, "Random Walk", "Volumetric approximation to physically based volume scattering"}, { 0, NULL, 0, NULL, NULL } }; + /* -- Common nodes ---------------------------------------------------------- */ static void def_group_input(StructRNA *srna) @@ -4241,6 +4248,12 @@ static void def_principled(StructRNA *srna) RNA_def_property_enum_items(prop, node_principled_distribution_items); RNA_def_property_ui_text(prop, "Distribution", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNodePrincipled_update"); + + prop = RNA_def_property(srna, "subsurface_method", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom2"); + RNA_def_property_enum_items(prop, node_subsurface_method_items); + RNA_def_property_ui_text(prop, "Subsurface Method", "Method for rendering subsurface scattering"); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNodePrincipled_update"); } static void def_refraction(StructRNA *srna) @@ -4328,11 +4341,11 @@ static void def_sh_uvalongstroke(StructRNA *srna) static void def_sh_normal_map(StructRNA *srna) { static const EnumPropertyItem prop_space_items[] = { - {SHD_NORMAL_MAP_TANGENT, "TANGENT", 0, "Tangent Space", "Tangent space normal mapping"}, - {SHD_NORMAL_MAP_OBJECT, "OBJECT", 0, "Object Space", "Object space normal mapping"}, - {SHD_NORMAL_MAP_WORLD, "WORLD", 0, "World Space", "World space normal mapping"}, - {SHD_NORMAL_MAP_BLENDER_OBJECT, "BLENDER_OBJECT", 0, "Blender Object Space", "Object space normal mapping, compatible with Blender render baking"}, - {SHD_NORMAL_MAP_BLENDER_WORLD, "BLENDER_WORLD", 0, "Blender World Space", "World space normal mapping, compatible with Blender render baking"}, + {SHD_SPACE_TANGENT, "TANGENT", 0, "Tangent Space", "Tangent space normal mapping"}, + {SHD_SPACE_OBJECT, "OBJECT", 0, "Object Space", "Object space normal mapping"}, + {SHD_SPACE_WORLD, "WORLD", 0, "World Space", "World space normal mapping"}, + {SHD_SPACE_BLENDER_OBJECT, "BLENDER_OBJECT", 0, "Blender Object Space", "Object space normal mapping, compatible with Blender render baking"}, + {SHD_SPACE_BLENDER_WORLD, "BLENDER_WORLD", 0, "Blender World Space", "World space normal mapping, compatible with Blender render baking"}, {0, NULL, 0, NULL, NULL} }; @@ -4352,6 +4365,45 @@ static void def_sh_normal_map(StructRNA *srna) RNA_def_struct_sdna_from(srna, "bNode", NULL); } +static void def_sh_displacement(StructRNA *srna) +{ + static const EnumPropertyItem prop_space_items[] = { + {SHD_SPACE_OBJECT, "OBJECT", 0, "Object Space", "Displacement is in object space, affected by object scale"}, + {SHD_SPACE_WORLD, "WORLD", 0, "World Space", "Displacement is in world space, not affected by object scale"}, + {0, NULL, 0, NULL, NULL} + }; + + PropertyRNA *prop; + + prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, prop_space_items); + RNA_def_property_ui_text(prop, "Space", "Space of the input height"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + RNA_def_struct_sdna_from(srna, "bNode", NULL); +} + +static void def_sh_vector_displacement(StructRNA *srna) +{ + static const EnumPropertyItem prop_space_items[] = { + {SHD_SPACE_TANGENT, "TANGENT", 0, "Tangent Space", "Tagent space vector displacement mapping"}, + {SHD_SPACE_OBJECT, "OBJECT", 0, "Object Space", "Object space vector displacement mapping"}, + {SHD_SPACE_WORLD, "WORLD", 0, "World Space", "World space vector displacement mapping"}, + {0, NULL, 0, NULL, NULL} + }; + + PropertyRNA *prop; + + prop = RNA_def_property(srna, "space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "custom1"); + RNA_def_property_enum_items(prop, prop_space_items); + RNA_def_property_ui_text(prop, "Space", "Space of the input height"); + RNA_def_property_update(prop, 0, "rna_Node_update"); + + RNA_def_struct_sdna_from(srna, "bNode", NULL); +} + static void def_sh_tangent(StructRNA *srna) { static const EnumPropertyItem prop_direction_type_items[] = { @@ -4405,6 +4457,7 @@ static void def_sh_subsurface(StructRNA *srna) {SHD_SUBSURFACE_CUBIC, "CUBIC", 0, "Cubic", "Simple cubic falloff function"}, {SHD_SUBSURFACE_GAUSSIAN, "GAUSSIAN", 0, "Gaussian", "Normal distribution, multiple can be combined to fit more complex profiles"}, {SHD_SUBSURFACE_BURLEY, "BURLEY", 0, "Christensen-Burley", "Approximation to physically based volume scattering"}, + {SHD_SUBSURFACE_RANDOM_WALK, "RANDOM_WALK", 0, "Random Walk", "Volumetric approximation to physically based volume scattering"}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 52bcb29d21f..7800edc3086 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -33,7 +33,7 @@ #include "DNA_group_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" -#include "DNA_object_force.h" +#include "DNA_object_force_types.h" #include "DNA_object_types.h" #include "DNA_property_types.h" #include "DNA_scene_types.h" diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 1d58a4a6350..836c077aaf3 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -476,10 +476,7 @@ void rna_Object_dm_info(struct Object *ob, int type, char *result) static int rna_Object_update_from_editmode(Object *ob) { - if (ob->mode & OB_MODE_EDIT) { - return ED_object_editmode_load(ob); - } - return false; + return ED_object_editmode_load(ob); } #else /* RNA_RUNTIME */ diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 3fa7eb068d1..b3808e4dde0 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -28,7 +28,7 @@ #include "DNA_cloth_types.h" #include "DNA_object_types.h" -#include "DNA_object_force.h" +#include "DNA_object_force_types.h" #include "DNA_particle_types.h" #include "DNA_scene_types.h" #include "DNA_smoke_types.h" diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 53fe84707d1..9e52457d32a 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -36,7 +36,7 @@ #include "DNA_modifier_types.h" #include "DNA_cloth_types.h" #include "DNA_particle_types.h" -#include "DNA_object_force.h" +#include "DNA_object_force_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_boid_types.h" diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 9b206f3ee12..08665f3007a 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -42,7 +42,7 @@ #include "BKE_pointcache.h" #include "DNA_modifier_types.h" -#include "DNA_object_force.h" +#include "DNA_object_force_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_smoke_types.h" diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 489a841fb0b..0496de4dd6a 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -402,27 +402,22 @@ static void rna_userdef_autosave_update(Main *bmain, Scene *scene, PointerRNA *p static bAddon *rna_userdef_addon_new(void) { ListBase *addons_list = &U.addons; - bAddon *bext = MEM_callocN(sizeof(bAddon), "bAddon"); - BLI_addtail(addons_list, bext); - return bext; + bAddon *addon = BKE_addon_new(); + BLI_addtail(addons_list, addon); + return addon; } -static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *bext_ptr) +static void rna_userdef_addon_remove(ReportList *reports, PointerRNA *addon_ptr) { ListBase *addons_list = &U.addons; - bAddon *bext = bext_ptr->data; - if (BLI_findindex(addons_list, bext) == -1) { + bAddon *addon = addon_ptr->data; + if (BLI_findindex(addons_list, addon) == -1) { BKE_report(reports, RPT_ERROR, "Add-on is no longer valid"); return; } - - if (bext->prop) { - IDP_FreeProperty(bext->prop); - MEM_freeN(bext->prop); - } - - BLI_freelinkN(addons_list, bext); - RNA_POINTER_INVALIDATE(bext_ptr); + BLI_remlink(addons_list, addon); + BKE_addon_free(addon); + RNA_POINTER_INVALIDATE(addon_ptr); } static bPathCompare *rna_userdef_pathcompare_new(void) |