diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-10-16 22:15:03 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-10-16 22:29:04 +0300 |
commit | e4f2b2be26adbb5c34231598526a270559c6e183 (patch) | |
tree | 40601b1349372904cffe619003dcc83b7011d8be /source/blender/makesrna/intern/rna_scene_api.c | |
parent | e8962f90de4222d6f750d3d3478eff65490365d8 (diff) |
Workspace: Move engines to workspace and Properties Editor cleanup
Engine is not stored in WorkSpaces. That defines the "context" engine, which
is used for the entire UI.
The engine used for the poll of nodes (add node menu, new nodes when "Use Nodes")
is obtained from context.
Introduce a ViewRender struct for viewport settings that are defined for
workspaces and scene. This struct will be populated with the hand-picked
settings that can be defined per workspace as per the 2.8 design.
* use_scene_settings
* properties editor: workshop + organize context path
Use Scene Settings
==================
For viewport drawing, Workspaces have an option to use the Scene render
settings (F12) instead of the viewport settings.
This way users can quickly preview the final render settings, engine and
View Layer. This will affect all the editors in that workspace, and it will be
clearly indicated in the top-bar.
Properties Editor: Add Workspace and organize context path
==========================================================
We now have the properties of:
Scene, Scene > Layer, Scene > World, Workspace
[Scene | Workspace] > Render Layer > Object
[Scene | Workspace] > Render Layer > Object > Data
(...)
Reviewers: Campbell Barton, Julian Eisel
Differential Revision: https://developer.blender.org/D2842
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index a1ef3f17bd6..baa29df3fc3 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -151,14 +151,24 @@ static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, int previe } static void rna_Scene_ray_cast( - Scene *scene, SceneLayer *sl, float origin[3], float direction[3], float ray_dist, + Scene *scene, SceneLayer *scene_layer, const char *engine_id, + float origin[3], float direction[3], float ray_dist, int *r_success, float r_location[3], float r_normal[3], int *r_index, Object **r_ob, float r_obmat[16]) { + RenderEngineType *engine; + + if (engine_id == NULL || engine_id[0] == '\0') { + engine = RE_engines_find(scene->view_render.engine_id); + } + else { + engine = RE_engines_find(engine_id); + } + normalize_v3(direction); SnapObjectContext *sctx = ED_transform_snap_object_context_create( - G.main, scene, sl, 0); + G.main, scene, scene_layer, engine, 0); bool ret = ED_transform_snap_object_project_ray_ex( sctx, @@ -354,6 +364,7 @@ void RNA_api_scene(StructRNA *srna) RNA_def_function_ui_description(func, "Cast a ray onto in object space"); parm = RNA_def_pointer(func, "scene_layer", "SceneLayer", "", "Scene Layer"); RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED); + parm = RNA_def_string(func, "engine", NULL, MAX_NAME, "Engine", "Render engine, use scene one by default"); /* ray start and end */ parm = RNA_def_float_vector(func, "origin", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); |