Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_shading.cc
| Show First 20 Lines • Show All 873 Lines • ▼ Show 20 Lines | static int new_world_exec(bContext *C, wmOperator * /*op*/) | ||||
| /* add or copy world */ | /* add or copy world */ | ||||
| if (wo) { | if (wo) { | ||||
| World *new_wo = (World *)BKE_id_copy_ex( | World *new_wo = (World *)BKE_id_copy_ex( | ||||
| bmain, &wo->id, nullptr, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS); | bmain, &wo->id, nullptr, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS); | ||||
| wo = new_wo; | wo = new_wo; | ||||
| } | } | ||||
| else { | else { | ||||
| wo = BKE_world_add(bmain, DATA_("World")); | wo = BKE_world_add(bmain, CTX_DATA_(BLT_I18NCONTEXT_ID_WORLD, "World")); | ||||
| ED_node_shader_default(C, &wo->id); | ED_node_shader_default(C, &wo->id); | ||||
| wo->use_nodes = true; | wo->use_nodes = true; | ||||
| } | } | ||||
| /* hook into UI */ | /* hook into UI */ | ||||
| UI_context_active_but_prop_get_templateID(C, &ptr, &prop); | UI_context_active_but_prop_get_templateID(C, &ptr, &prop); | ||||
| if (prop) { | if (prop) { | ||||
| ▲ Show 20 Lines • Show All 1,874 Lines • Show Last 20 Lines | |||||