Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_buttons/buttons_context.c
| Show First 20 Lines • Show All 555 Lines • ▼ Show 20 Lines | static int buttons_context_path_texture(const bContext *C, ButsContextPath *path, ButsContextTexture *ct) | ||||
| /* no path to a texture possible */ | /* no path to a texture possible */ | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| #ifdef WITH_FREESTYLE | #ifdef WITH_FREESTYLE | ||||
| static bool buttons_context_linestyle_pinnable(const bContext *C) | static bool buttons_context_linestyle_pinnable(const bContext *C) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| SceneRenderLayer *actsrl; | SceneLayer *active_scene_layer; | ||||
| FreestyleConfig *config; | FreestyleConfig *config; | ||||
| SpaceButs *sbuts; | SpaceButs *sbuts; | ||||
| /* if Freestyle is disabled in the scene */ | /* if Freestyle is disabled in the scene */ | ||||
| if ((scene->r.mode & R_EDGE_FRS) == 0) { | if ((scene->r.mode & R_EDGE_FRS) == 0) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* if Freestyle is not in the Parameter Editor mode */ | /* if Freestyle is not in the Parameter Editor mode */ | ||||
| actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay); | active_scene_layer = BLI_findlink(&scene->render_layers, scene->active_layer); | ||||
| config = &actsrl->freestyleConfig; | config = &active_scene_layer->freestyle_config; | ||||
| if (config->mode != FREESTYLE_CONTROL_EDITOR_MODE) { | if (config->mode != FREESTYLE_CONTROL_EDITOR_MODE) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* if the scene has already been pinned */ | /* if the scene has already been pinned */ | ||||
| sbuts = CTX_wm_space_buts(C); | sbuts = CTX_wm_space_buts(C); | ||||
| if (sbuts->pinid && sbuts->pinid == &scene->id) { | if (sbuts->pinid && sbuts->pinid == &scene->id) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 669 Lines • Show Last 20 Lines | |||||