Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/render/render_shading.c
| Show First 20 Lines • Show All 867 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data; | World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data; | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| PointerRNA ptr, idptr; | PointerRNA ptr, idptr; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| /* add or copy world */ | /* add or copy world */ | ||||
| if (wo) { | if (wo) { | ||||
| wo = BKE_world_copy(bmain, wo); | World *new_wo = NULL; | ||||
| BKE_id_copy_ex(bmain, &wo->id, (ID **)&new_wo, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_ACTIONS); | |||||
| wo = new_wo; | |||||
| } | } | ||||
| else { | else { | ||||
| wo = BKE_world_add(bmain, DATA_("World")); | wo = BKE_world_add(bmain, DATA_("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 */ | ||||
| ▲ Show 20 Lines • Show All 1,557 Lines • Show Last 20 Lines | |||||