diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-09-05 13:47:20 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-09-11 13:19:44 +0300 |
commit | 7e61e597253f3ca75f2fb86a57212ca750ffbbe8 (patch) | |
tree | 6dbe0bf05fc3380f9729bf719ed1223997d5b0e3 /source/blender/makesrna | |
parent | d4f8bc80a4bd69707a92e7141a2fb67d3f668c58 (diff) |
Cycles: Display RenderPass in Viewport
This change allows the user to select a renderpass in the 3d viewport.
Added support for external renderers to extend the `View3DShading` struct.
This way Blender doesn't need to know the features an external render engine wants to support.
Note that the View3DShading is also available in the scene->display.shading; although this is
supported, it does not make sense for render engines to put something here as it is really
scene/workbench related.
Currently cycles assumes that it always needs to calculate the combined pass; it ignores the
`pass_flag` in KernelFilm. We could optimize this but that was not in scope of this change
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5689
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 4da0dd1d4ce..43f77a3cf88 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -458,6 +458,7 @@ const EnumPropertyItem rna_enum_file_sort_items[] = { # include "BKE_brush.h" # include "BKE_colortools.h" # include "BKE_context.h" +# include "BKE_idprop.h" # include "BKE_layer.h" # include "BKE_global.h" # include "BKE_nla.h" @@ -938,6 +939,18 @@ static bool rna_RegionView3D_is_orthographic_side_view_get(PointerRNA *ptr) return RV3D_VIEW_IS_AXIS(rv3d->view); } +static IDProperty *rna_View3DShading_idprops(PointerRNA *ptr, bool create) +{ + View3DShading *shading = ptr->data; + + if (create && !shading->prop) { + IDPropertyTemplate val = {0}; + shading->prop = IDP_New(IDP_GROUP, &val, "View3DShading ID properties"); + } + + return shading->prop; +} + static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA *ptr) { ID *id = ptr->owner_id; @@ -3003,6 +3016,7 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_View3DShading_path"); RNA_def_struct_ui_text( srna, "3D View Shading Settings", "Settings for shading in the 3D viewport"); + RNA_def_struct_idprops_func(srna, "rna_View3DShading_idprops"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_shading_type_items); |