bool ED_texture_context_check_linestyle(const bContext *C)
{
#ifdef WITH_FREESTYLE
	Scene *scene = CTX_data_scene(C);
	SceneRenderLayer *actsrl;
	FreestyleConfig *config;
	FreestyleLineSet *lineset;
	FreestyleLineStyle *linestyle;

	if (scene && (scene->r.mode & R_EDGE_FRS)) {
		actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
		config = &actsrl->freestyleConfig;
		if (config->mode == FREESTYLE_CONTROL_EDITOR_MODE) {
			lineset = BKE_freestyle_lineset_get_active(config);
			if (lineset) {
				linestyle = lineset->linestyle;
				return linestyle && (linestyle->flag & LS_TEXTURE);
			}
		}
	}
#else
	(void)C;
#endif
	return false;
}
Example #2
0
FreestyleLineStyle *BKE_linestyle_active_from_scene(Scene *scene)
{
	SceneRenderLayer *actsrl = BLI_findlink(&scene->r.layers, scene->r.actlay);
	FreestyleConfig *config = &actsrl->freestyleConfig;
	FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config);

	if (lineset) {
		return lineset->linestyle;
	}
	return NULL;
}