A big cleaning patch by Bastien Montagne (thanks a lot!)

* Split and moved Cycles’ render layers panels into the render_layer
context as well (would be nice to hide this context when not needed,
e.g. with the BGE, but this is not so easy to do nicely...).

* Fixed some inconsistencies with trunk (probably due to svn merge
glitches) using r52858 as reference.  Also recovered the missing
release/bin/blender-softwaregl file.

* A bunch of style code fixes in Blender's own code (not Freestyle
itself yet): line lengths, spaces around operators, block formatting,
headers, etc.  In rna_linestyle.c, color_blend_items was replaced by
ramp_blend_items (exported from rna_material.c).
This commit is contained in:
2012-12-11 22:00:22 +00:00
parent c9dc80111b
commit 53d845ba69
36 changed files with 1080 additions and 976 deletions

View File

@@ -221,86 +221,6 @@ class CyclesRender_PT_performance(CyclesButtonsPanel, Panel):
sub.prop(rd, "use_persistent_data", text="Persistent Images")
class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
bl_label = "Layers"
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER'}
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
row = layout.row()
row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
col = row.column(align=True)
col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
row = layout.row()
rl = rd.layers.active
row.prop(rl, "name")
row.prop(rd, "use_single_layer", text="", icon_only=True)
split = layout.split()
col = split.column()
col.prop(scene, "layers", text="Scene")
col.prop(rl, "layers_exclude", text="Exclude")
col = split.column()
col.prop(rl, "layers", text="Layer")
col.label(text="Mask Layers:")
col.prop(rl, "layers_zmask", text="")
split = layout.split()
col = split.column()
col.label(text="Material:")
col.prop(rl, "material_override", text="")
col = split.column()
col.prop(rl, "samples")
col.prop(rl, "use_sky", "Use Environment")
split = layout.split()
col = split.column()
col.label(text="Passes:")
col.prop(rl, "use_pass_combined")
col.prop(rl, "use_pass_z")
col.prop(rl, "use_pass_normal")
col.prop(rl, "use_pass_vector")
col.prop(rl, "use_pass_uv")
col.prop(rl, "use_pass_object_index")
col.prop(rl, "use_pass_material_index")
col.prop(rl, "use_pass_ambient_occlusion")
col.prop(rl, "use_pass_shadow")
col = split.column()
col.label()
col.label(text="Diffuse:")
row = col.row(align=True)
row.prop(rl, "use_pass_diffuse_direct", text="Direct", toggle=True)
row.prop(rl, "use_pass_diffuse_indirect", text="Indirect", toggle=True)
row.prop(rl, "use_pass_diffuse_color", text="Color", toggle=True)
col.label(text="Glossy:")
row = col.row(align=True)
row.prop(rl, "use_pass_glossy_direct", text="Direct", toggle=True)
row.prop(rl, "use_pass_glossy_indirect", text="Indirect", toggle=True)
row.prop(rl, "use_pass_glossy_color", text="Color", toggle=True)
col.label(text="Transmission:")
row = col.row(align=True)
row.prop(rl, "use_pass_transmission_direct", text="Direct", toggle=True)
row.prop(rl, "use_pass_transmission_indirect", text="Indirect", toggle=True)
row.prop(rl, "use_pass_transmission_color", text="Color", toggle=True)
col.prop(rl, "use_pass_emit", text="Emission")
col.prop(rl, "use_pass_environment")
class Cycles_PT_post_processing(CyclesButtonsPanel, Panel):
bl_label = "Post Processing"
bl_options = {'DEFAULT_CLOSED'}
@@ -359,6 +279,116 @@ class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel):
sub.prop(ccam, "aperture_rotation", text="Rotation")
class CyclesRender_PT_layers(CyclesButtonsPanel, Panel):
bl_label = "Layers"
bl_options = {'HIDE_HEADER'}
bl_context = "render_layer"
COMPAT_ENGINES = {'CYCLES'}
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
row = layout.row()
row.template_list(rd, "layers", rd.layers, "active_index", rows=2)
col = row.column(align=True)
col.operator("scene.render_layer_add", icon='ZOOMIN', text="")
col.operator("scene.render_layer_remove", icon='ZOOMOUT', text="")
row = layout.row()
rl = rd.layers.active
if rl:
row.prop(rl, "name")
row.prop(rd, "use_single_layer", text="", icon_only=True)
class CyclesRender_PT_layer_options(CyclesButtonsPanel, Panel):
bl_label = "Layer"
bl_options = {'DEFAULT_CLOSED'}
bl_context = "render_layer"
COMPAT_ENGINES = {'CYCLES'}
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
rl = rd.layers.active
split = layout.split()
col = split.column()
col.prop(scene, "layers", text="Scene")
col.prop(rl, "layers_exclude", text="Exclude")
col = split.column()
col.prop(rl, "layers", text="Layer")
col.label(text="Mask Layers:")
col.prop(rl, "layers_zmask", text="")
split = layout.split()
col = split.column()
col.label(text="Material:")
col.prop(rl, "material_override", text="")
col = split.column()
col.prop(rl, "samples")
col.prop(rl, "use_sky", "Use Environment")
class CyclesRender_PT_layer_passes(CyclesButtonsPanel, Panel):
bl_label = "Layer"
bl_options = {'DEFAULT_CLOSED'}
bl_context = "render_layer"
COMPAT_ENGINES = {'CYCLES'}
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
rl = rd.layers.active
split = layout.split()
col = split.column()
col.label(text="Passes:")
col.prop(rl, "use_pass_combined")
col.prop(rl, "use_pass_z")
col.prop(rl, "use_pass_normal")
col.prop(rl, "use_pass_vector")
col.prop(rl, "use_pass_uv")
col.prop(rl, "use_pass_object_index")
col.prop(rl, "use_pass_material_index")
col.prop(rl, "use_pass_ambient_occlusion")
col.prop(rl, "use_pass_shadow")
col = split.column()
col.label()
col.label(text="Diffuse:")
row = col.row(align=True)
row.prop(rl, "use_pass_diffuse_direct", text="Direct", toggle=True)
row.prop(rl, "use_pass_diffuse_indirect", text="Indirect", toggle=True)
row.prop(rl, "use_pass_diffuse_color", text="Color", toggle=True)
col.label(text="Glossy:")
row = col.row(align=True)
row.prop(rl, "use_pass_glossy_direct", text="Direct", toggle=True)
row.prop(rl, "use_pass_glossy_indirect", text="Indirect", toggle=True)
row.prop(rl, "use_pass_glossy_color", text="Color", toggle=True)
col.label(text="Transmission:")
row = col.row(align=True)
row.prop(rl, "use_pass_transmission_direct", text="Direct", toggle=True)
row.prop(rl, "use_pass_transmission_indirect", text="Indirect", toggle=True)
row.prop(rl, "use_pass_transmission_color", text="Color", toggle=True)
col.prop(rl, "use_pass_emit", text="Emission")
col.prop(rl, "use_pass_environment")
class Cycles_PT_context_material(CyclesButtonsPanel, Panel):
bl_label = ""
bl_context = "material"

View File

@@ -0,0 +1,25 @@
#!/bin/sh
BF_DIST_BIN=`dirname "$0"`
BF_PROGRAM="blender" # BF_PROGRAM=`basename "$0"`-bin
exitcode=0
LD_LIBRARY_PATH=${BF_DIST_BIN}/lib:${LD_LIBRARY_PATH}
if [ -n "$LD_LIBRARYN32_PATH" ]; then
LD_LIBRARYN32_PATH=${BF_DIST_BIN}/lib:${LD_LIBRARYN32_PATH}
fi
if [ -n "$LD_LIBRARYN64_PATH" ]; then
LD_LIBRARYN64_PATH=${BF_DIST_BIN}/lib:${LD_LIBRARYN64_PATH}
fi
if [ -n "$LD_LIBRARY_PATH_64" ]; then
LD_LIBRARY_PATH_64=${BF_DIST_BIN}/lib:${LD_LIBRARY_PATH_64}
fi
# Workaround for half-transparent windows when compiz is enabled
XLIB_SKIP_ARGB_VISUALS=1
export LD_LIBRARY_PATH LD_LIBRARYN32_PATH LD_LIBRARYN64_PATH LD_LIBRARY_PATH_64 LD_PRELOAD XLIB_SKIP_ARGB_VISUALS
"$BF_DIST_BIN/$BF_PROGRAM" ${1+"$@"}
exitcode=$?
exit $exitcode

View File

@@ -22,14 +22,15 @@ from bpy.props import (EnumProperty, StringProperty)
class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
'''Fill the Range Min/Max entries by the min/max distance between selected mesh objects and the source object (either a user-specified object or the active camera)'''
'''Fill the Range Min/Max entries by the min/max distance between selected mesh objects and the source object
(either a user-specified object or the active camera)'''
bl_idname = "scene.freestyle_fill_range_by_selection"
bl_label = "Fill Range by Selection"
type = EnumProperty(name="Type", description="Type of the modifier to work on",
items=[("COLOR", "Color", "Color modifier type"),
items=(("COLOR", "Color", "Color modifier type"),
("ALPHA", "Alpha", "Alpha modifier type"),
("THICKNESS", "Thickness", "Thickness modifier type")])
("THICKNESS", "Thickness", "Thickness modifier type")))
name = StringProperty(name="Name", description="Name of the modifier to work on")
def execute(self, context):

View File

@@ -106,7 +106,7 @@ add_subdirectory(nodes)
add_subdirectory(modifiers)
add_subdirectory(makesdna)
add_subdirectory(makesrna)
ADD_SUBDIRECTORY(freestyle)
add_subdirectory(freestyle)
if(WITH_COMPOSITOR)
add_subdirectory(opencl) # later on this may be used more generally

View File

@@ -1,8 +1,4 @@
/* BKE_linestyle.h
*
*
* $Id: BKE_particle.h 29187 2010-06-03 15:39:02Z kjym3 $
*
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -29,8 +25,12 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef BKE_LINESTYLE_H
#define BKE_LINESTYLE_H
#ifndef __BKE_LINESTYLE_H__
#define __BKE_LINESTYLE_H__
/** \file BKE_linestyle.h
* \ingroup bke
* \brief Blender kernel freestyle line style functionality.
*/
#include "DNA_linestyle_types.h"

View File

@@ -103,7 +103,8 @@ set(SRC
intern/lattice.c
intern/library.c
intern/linestyle.c
intern/mask_evaluate.c intern/mask_rasterize.c
intern/mask_evaluate.c
intern/mask_rasterize.c
intern/mask.c
intern/material.c
intern/mball.c

View File

@@ -1,7 +1,4 @@
/* linestyle.c
*
* $Id$
*
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -28,6 +25,10 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/blenkernel/intern/linestyle.c
* \ingroup bke
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -68,20 +69,21 @@ static const char *modifier_name[LS_MODIFIER_NUM] = {
"Guiding Lines",
"Blueprint",
"2D Offset",
"2D Transform"};
"2D Transform",
};
static void default_linestyle_settings(FreestyleLineStyle *linestyle)
{
linestyle->panel = LS_PANEL_STROKES;
linestyle->r = linestyle->g = linestyle->b = 0.0;
linestyle->alpha = 1.0;
linestyle->thickness = 1.0;
linestyle->r = linestyle->g = linestyle->b = 0.0f;
linestyle->alpha = 1.0f;
linestyle->thickness = 1.0f;
linestyle->thickness_position = LS_THICKNESS_CENTER;
linestyle->thickness_ratio = 0.5f;
linestyle->chaining = LS_CHAINING_PLAIN;
linestyle->rounds = 3;
linestyle->min_angle = 0.0f;
linestyle->max_angle = 0.0f;
linestyle->min_angle = DEG2RADF(0.0f);
linestyle->max_angle = DEG2RADF(0.0f);
linestyle->min_length = 0.0f;
linestyle->max_length = 10000.0f;
linestyle->split_length = 100;
@@ -164,6 +166,7 @@ FreestyleLineStyle *FRS_copy_linestyle(FreestyleLineStyle *linestyle)
FRS_copy_linestyle_thickness_modifier(new_linestyle, m);
for (m = (LineStyleModifier *)linestyle->geometry_modifiers.first; m; m = m->next)
FRS_copy_linestyle_geometry_modifier(new_linestyle, m);
return new_linestyle;
}
@@ -178,6 +181,7 @@ static LineStyleModifier *new_modifier(int type, size_t size)
m->influence = 1.0f;
m->flags = LS_MODIFIER_ENABLED | LS_MODIFIER_EXPANDED;
}
return m;
}
@@ -207,6 +211,7 @@ static LineStyleModifier *alloc_color_modifier(int type)
default:
return NULL; /* unknown modifier type */
}
return new_modifier(type, size);
}
@@ -218,6 +223,7 @@ LineStyleModifier *FRS_add_linestyle_color_modifier(FreestyleLineStyle *linestyl
if (!m)
return NULL;
m->blend = MA_RAMP_BLEND;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
((LineStyleColorModifier_AlongStroke *)m)->color_ramp = add_colorband(1);
@@ -255,6 +261,7 @@ LineStyleModifier *FRS_copy_linestyle_color_modifier(FreestyleLineStyle *linesty
new_m->influence = m->influence;
new_m->flags = m->flags;
new_m->blend = m->blend;
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
{
@@ -346,6 +353,7 @@ LineStyleModifier *FRS_add_linestyle_alpha_modifier(FreestyleLineStyle *linestyl
if (!m)
return NULL;
m->blend = LS_VALUE_BLEND;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
((LineStyleAlphaModifier_AlongStroke *)m)->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -383,6 +391,7 @@ LineStyleModifier *FRS_copy_linestyle_alpha_modifier(FreestyleLineStyle *linesty
new_m->influence = m->influence;
new_m->flags = m->flags;
new_m->blend = m->blend;
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
{
@@ -466,6 +475,7 @@ static LineStyleModifier *alloc_thickness_modifier(int type)
default:
return NULL; /* unknown modifier type */
}
return new_modifier(type, size);
}
@@ -477,6 +487,7 @@ LineStyleModifier *FRS_add_linestyle_thickness_modifier(FreestyleLineStyle *line
if (!m)
return NULL;
m->blend = LS_VALUE_BLEND;
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
((LineStyleThicknessModifier_AlongStroke *)m)->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
@@ -527,6 +538,7 @@ LineStyleModifier *FRS_copy_linestyle_thickness_modifier(FreestyleLineStyle *lin
new_m->influence = m->influence;
new_m->flags = m->flags;
new_m->blend = m->blend;
switch (m->type) {
case LS_MODIFIER_ALONG_STROKE:
{
@@ -652,6 +664,7 @@ static LineStyleModifier *alloc_geometry_modifier(int type)
default:
return NULL; /* unknown modifier type */
}
return new_modifier(type, size);
}
@@ -662,70 +675,71 @@ LineStyleModifier *FRS_add_linestyle_geometry_modifier(FreestyleLineStyle *lines
m = alloc_geometry_modifier(type);
if (!m)
return NULL;
switch (type) {
case LS_MODIFIER_SAMPLING:
((LineStyleGeometryModifier_Sampling *)m)->sampling = 10.0;
((LineStyleGeometryModifier_Sampling *)m)->sampling = 10.0f;
break;
case LS_MODIFIER_BEZIER_CURVE:
((LineStyleGeometryModifier_BezierCurve *)m)->error = 10.0;
((LineStyleGeometryModifier_BezierCurve *)m)->error = 10.0f;
break;
case LS_MODIFIER_SINUS_DISPLACEMENT:
((LineStyleGeometryModifier_SinusDisplacement *)m)->wavelength = 20.0;
((LineStyleGeometryModifier_SinusDisplacement *)m)->amplitude = 5.0;
((LineStyleGeometryModifier_SinusDisplacement *)m)->phase = 0.0;
((LineStyleGeometryModifier_SinusDisplacement *)m)->wavelength = 20.0f;
((LineStyleGeometryModifier_SinusDisplacement *)m)->amplitude = 5.0f;
((LineStyleGeometryModifier_SinusDisplacement *)m)->phase = 0.0f;
break;
case LS_MODIFIER_SPATIAL_NOISE:
((LineStyleGeometryModifier_SpatialNoise *)m)->amplitude = 5.0;
((LineStyleGeometryModifier_SpatialNoise *)m)->scale = 20.0;
((LineStyleGeometryModifier_SpatialNoise *)m)->amplitude = 5.0f;
((LineStyleGeometryModifier_SpatialNoise *)m)->scale = 20.0f;
((LineStyleGeometryModifier_SpatialNoise *)m)->octaves = 4;
((LineStyleGeometryModifier_SpatialNoise *)m)->flags = LS_MODIFIER_SPATIAL_NOISE_SMOOTH | LS_MODIFIER_SPATIAL_NOISE_PURERANDOM;
break;
case LS_MODIFIER_PERLIN_NOISE_1D:
((LineStyleGeometryModifier_PerlinNoise1D *)m)->frequency = 10.0;
((LineStyleGeometryModifier_PerlinNoise1D *)m)->amplitude = 10.0;
((LineStyleGeometryModifier_PerlinNoise1D *)m)->frequency = 10.0f;
((LineStyleGeometryModifier_PerlinNoise1D *)m)->amplitude = 10.0f;
((LineStyleGeometryModifier_PerlinNoise1D *)m)->octaves = 4;
((LineStyleGeometryModifier_PerlinNoise1D *)m)->angle = DEG2RADF(45.0f);
break;
case LS_MODIFIER_PERLIN_NOISE_2D:
((LineStyleGeometryModifier_PerlinNoise2D *)m)->frequency = 10.0;
((LineStyleGeometryModifier_PerlinNoise2D *)m)->amplitude = 10.0;
((LineStyleGeometryModifier_PerlinNoise2D *)m)->frequency = 10.0f;
((LineStyleGeometryModifier_PerlinNoise2D *)m)->amplitude = 10.0f;
((LineStyleGeometryModifier_PerlinNoise2D *)m)->octaves = 4;
((LineStyleGeometryModifier_PerlinNoise2D *)m)->angle = DEG2RADF(45.0f);
break;
case LS_MODIFIER_BACKBONE_STRETCHER:
((LineStyleGeometryModifier_BackboneStretcher *)m)->backbone_length = 10.0;
((LineStyleGeometryModifier_BackboneStretcher *)m)->backbone_length = 10.0f;
break;
case LS_MODIFIER_TIP_REMOVER:
((LineStyleGeometryModifier_TipRemover *)m)->tip_length = 10.0;
((LineStyleGeometryModifier_TipRemover *)m)->tip_length = 10.0f;
break;
case LS_MODIFIER_POLYGONIZATION:
((LineStyleGeometryModifier_Polygonalization *)m)->error = 10.0;
((LineStyleGeometryModifier_Polygonalization *)m)->error = 10.0f;
break;
case LS_MODIFIER_GUIDING_LINES:
((LineStyleGeometryModifier_GuidingLines *)m)->offset = 0.0;
((LineStyleGeometryModifier_GuidingLines *)m)->offset = 0.0f;
break;
case LS_MODIFIER_BLUEPRINT:
((LineStyleGeometryModifier_Blueprint *)m)->flags = LS_MODIFIER_BLUEPRINT_CIRCLES;
((LineStyleGeometryModifier_Blueprint *)m)->rounds = 1;
((LineStyleGeometryModifier_Blueprint *)m)->backbone_length = 10.f;
((LineStyleGeometryModifier_Blueprint *)m)->backbone_length = 10.0f;
((LineStyleGeometryModifier_Blueprint *)m)->random_radius = 3;
((LineStyleGeometryModifier_Blueprint *)m)->random_center = 5;
((LineStyleGeometryModifier_Blueprint *)m)->random_backbone = 5;
break;
case LS_MODIFIER_2D_OFFSET:
((LineStyleGeometryModifier_2DOffset *)m)->start = 0.f;
((LineStyleGeometryModifier_2DOffset *)m)->end = 0.f;
((LineStyleGeometryModifier_2DOffset *)m)->x = 0.f;
((LineStyleGeometryModifier_2DOffset *)m)->y = 0.f;
((LineStyleGeometryModifier_2DOffset *)m)->start = 0.0f;
((LineStyleGeometryModifier_2DOffset *)m)->end = 0.0f;
((LineStyleGeometryModifier_2DOffset *)m)->x = 0.0f;
((LineStyleGeometryModifier_2DOffset *)m)->y = 0.0f;
break;
case LS_MODIFIER_2D_TRANSFORM:
((LineStyleGeometryModifier_2DTransform *)m)->pivot = LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER;
((LineStyleGeometryModifier_2DTransform *)m)->scale_x = 1.f;
((LineStyleGeometryModifier_2DTransform *)m)->scale_y = 1.f;
((LineStyleGeometryModifier_2DTransform *)m)->scale_x = 1.0f;
((LineStyleGeometryModifier_2DTransform *)m)->scale_y = 1.0f;
((LineStyleGeometryModifier_2DTransform *)m)->angle = DEG2RADF(0.0f);
((LineStyleGeometryModifier_2DTransform *)m)->pivot_u = 0.5f;
((LineStyleGeometryModifier_2DTransform *)m)->pivot_x = 0.f;
((LineStyleGeometryModifier_2DTransform *)m)->pivot_y = 0.f;
((LineStyleGeometryModifier_2DTransform *)m)->pivot_x = 0.0f;
((LineStyleGeometryModifier_2DTransform *)m)->pivot_y = 0.0f;
break;
default:
return NULL; /* unknown modifier type */
@@ -743,6 +757,7 @@ LineStyleModifier *FRS_copy_linestyle_geometry_modifier(FreestyleLineStyle *line
if (!new_m)
return NULL;
new_m->flags = m->flags;
switch (m->type) {
case LS_MODIFIER_SAMPLING:
{
@@ -947,6 +962,7 @@ void FRS_list_modifier_color_ramps(FreestyleLineStyle *linestyle, ListBase *list
}
}
/* XXX Do we want to keep that goto? Or use a boolean var? */
char *FRS_path_from_ID_to_color_ramp(FreestyleLineStyle *linestyle, ColorBand *color_ramp)
{
LineStyleModifier *m;

View File

@@ -36,7 +36,6 @@ set(INC
set(INC_SYS
${ZLIB_INCLUDE_DIRS}
${FREETYPE_INCLUDE_DIRS}
${ZLIB_INC}
)
set(SRC

View File

@@ -6415,8 +6415,10 @@ static void lib_link_linestyle(FileData *fd, Main *main)
if (linestyle->id.flag & LIB_NEED_LINK) {
linestyle->id.flag -= LIB_NEED_LINK;
if (linestyle->id.properties) IDP_LibLinkProperty(linestyle->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
if (linestyle->adt) lib_link_animdata(fd, &linestyle->id, linestyle->adt);
if (linestyle->id.properties)
IDP_LibLinkProperty(linestyle->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
if (linestyle->adt)
lib_link_animdata(fd, &linestyle->id, linestyle->adt);
for (m = linestyle->color_modifiers.first; m; m = m->next) {
switch (m->type) {
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
@@ -8580,7 +8582,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
for(sce = main->scene.first; sce; sce = sce->id.next) {
if (sce->r.line_thickness_mode == 0) {
sce->r.line_thickness_mode = R_LINE_THICKNESS_ABSOLUTE;
sce->r.unit_line_thickness= 1.f;
sce->r.unit_line_thickness = 1.0f;
}
for(srl = sce->r.layers.first; srl; srl = srl->next) {
if (srl->freestyleConfig.mode == 0)

View File

@@ -2893,7 +2893,7 @@ static void write_linestyle_color_modifiers(WriteData *wd, ListBase *modifiers)
struct_name = "LineStyleColorModifier_Material";
break;
default:
struct_name = "LineStyleColorModifier"; // this should not happen
struct_name = "LineStyleColorModifier"; /* this should not happen */
}
writestruct(wd, DATA, struct_name, 1, m);
}
@@ -2935,7 +2935,7 @@ static void write_linestyle_alpha_modifiers(WriteData *wd, ListBase *modifiers)
struct_name = "LineStyleAlphaModifier_Material";
break;
default:
struct_name = "LineStyleAlphaModifier"; // this should not happen
struct_name = "LineStyleAlphaModifier"; /* this should not happen */
}
writestruct(wd, DATA, struct_name, 1, m);
}
@@ -2980,7 +2980,7 @@ static void write_linestyle_thickness_modifiers(WriteData *wd, ListBase *modifie
struct_name = "LineStyleThicknessModifier_Calligraphy";
break;
default:
struct_name = "LineStyleThicknessModifier"; // this should not happen
struct_name = "LineStyleThicknessModifier"; /* this should not happen */
}
writestruct(wd, DATA, struct_name, 1, m);
}
@@ -3049,7 +3049,7 @@ static void write_linestyle_geometry_modifiers(WriteData *wd, ListBase *modifier
struct_name = "LineStyleGeometryModifier_2DTransform";
break;
default:
struct_name = "LineStyleGeometryModifier"; // this should not happen
struct_name = "LineStyleGeometryModifier"; /* this should not happen */
}
writestruct(wd, DATA, struct_name, 1, m);
}
@@ -3062,8 +3062,10 @@ static void write_linestyles(WriteData *wd, ListBase *idbase)
for (linestyle = idbase->first; linestyle; linestyle = linestyle->id.next) {
if (linestyle->id.us>0 || wd->current) {
writestruct(wd, ID_LS, "FreestyleLineStyle", 1, linestyle);
if (linestyle->id.properties) IDP_WriteProperty(linestyle->id.properties, wd);
if (linestyle->adt) write_animdata(wd, linestyle->adt);
if (linestyle->id.properties)
IDP_WriteProperty(linestyle->id.properties, wd);
if (linestyle->adt)
write_animdata(wd, linestyle->adt);
write_linestyle_color_modifiers(wd, &linestyle->color_modifiers);
write_linestyle_alpha_modifiers(wd, &linestyle->alpha_modifiers);
write_linestyle_thickness_modifiers(wd, &linestyle->thickness_modifiers);

View File

@@ -472,7 +472,7 @@ void bmo_similar_edges_exec(BMesh *bm, BMOperator *op)
case SIMEDGE_FREESTYLE:
if (BM_elem_flag_test(e, BM_ELEM_FREESTYLE) == BM_elem_flag_test(es, BM_ELEM_FREESTYLE)) {
BMO_elem_flag_enable(bm, e, EDGE_MARK);
cont = 0;
cont = FALSE;
}
break;
default:

View File

@@ -2013,7 +2013,7 @@ static bAnimChannelType ACF_DSNTREE =
/* LineStyle Expander ------------------------------------------- */
// TODO: just get this from RNA?
/* TODO: just get this from RNA? */
static int acf_dslinestyle_icon(bAnimListElem *UNUSED(ale))
{
return ICON_BRUSH_DATA; /* FIXME */

View File

@@ -2412,7 +2412,8 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe
uiBlockSetEmboss(block, UI_EMBOSS);
uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, ptr, "use_textures", i, 0, 0, 0, 0, NULL);
}
else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) || RNA_struct_is_a(itemptr->type, &RNA_FreestyleLineSet)) {
else if (RNA_struct_is_a(itemptr->type, &RNA_SceneRenderLayer) ||
RNA_struct_is_a(itemptr->type, &RNA_FreestyleLineSet)) {
uiItemL(sub, name, icon);
uiBlockSetEmboss(block, UI_EMBOSS);
uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "use", 0, 0, 0, 0, 0, NULL);

View File

@@ -5772,7 +5772,8 @@ static int edbm_mark_freestyle_edge(bContext *C, wmOperator *op)
BMIter iter;
int clear = RNA_boolean_get(op->ptr, "clear");
if (em == NULL) return OPERATOR_FINISHED;
if (em == NULL)
return OPERATOR_FINISHED;
/* auto-enable seams drawing */
if (clear == 0) {
@@ -5865,4 +5866,3 @@ void MESH_OT_mark_freestyle_face(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "clear", 0, "Clear", "");
}

View File

@@ -577,7 +577,7 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot)
static int freestyle_module_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FRS_add_module(&srl->freestyleConfig);
@@ -603,7 +603,7 @@ void SCENE_OT_freestyle_module_add(wmOperatorType *ot)
static int freestyle_module_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
FreestyleModuleConfig *module = ptr.data;
@@ -631,14 +631,15 @@ void SCENE_OT_freestyle_module_remove(wmOperatorType *ot)
static int freestyle_module_move_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
PointerRNA ptr = CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings);
FreestyleModuleConfig *module = ptr.data;
int dir = RNA_enum_get(op->ptr, "direction");
if (dir == 1) {
FRS_move_module_up(&srl->freestyleConfig, module);
} else {
}
else {
FRS_move_module_down(&srl->freestyleConfig, module);
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -672,7 +673,7 @@ void SCENE_OT_freestyle_module_move(wmOperatorType *ot)
static int freestyle_lineset_add_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FRS_add_lineset(&srl->freestyleConfig);
@@ -698,7 +699,7 @@ void SCENE_OT_freestyle_lineset_add(wmOperatorType *ot)
static int freestyle_active_lineset_poll(bContext *C)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
return FRS_get_active_lineset(&srl->freestyleConfig) != NULL;
}
@@ -706,7 +707,7 @@ static int freestyle_active_lineset_poll(bContext *C)
static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FRS_copy_active_lineset(&srl->freestyleConfig);
@@ -733,7 +734,7 @@ void SCENE_OT_freestyle_lineset_copy(wmOperatorType *ot)
static int freestyle_lineset_paste_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FRS_paste_active_lineset(&srl->freestyleConfig);
@@ -760,7 +761,7 @@ void SCENE_OT_freestyle_lineset_paste(wmOperatorType *ot)
static int freestyle_lineset_remove_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FRS_delete_active_lineset(&srl->freestyleConfig);
@@ -787,12 +788,13 @@ void SCENE_OT_freestyle_lineset_remove(wmOperatorType *ot)
static int freestyle_lineset_move_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
int dir = RNA_enum_get(op->ptr, "direction");
if (dir == 1) {
FRS_move_active_lineset_up(&srl->freestyleConfig);
} else {
}
else {
FRS_move_active_lineset_down(&srl->freestyleConfig);
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -827,11 +829,11 @@ void SCENE_OT_freestyle_lineset_move(wmOperatorType *ot)
static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset to add a new line style to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset to add a new line style to");
return OPERATOR_CANCELLED;
}
lineset->linestyle->id.us--;
@@ -860,12 +862,12 @@ void SCENE_OT_freestyle_linestyle_new(wmOperatorType *ot)
static int freestyle_color_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_color_modifier(lineset->linestyle, type) < 0) {
@@ -899,16 +901,16 @@ void SCENE_OT_freestyle_color_modifier_add(wmOperatorType *ot)
static int freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_alpha_modifier(lineset->linestyle, type) < 0) {
BKE_report(op->reports, RPT_ERROR, "Unknown alpha transparency modifier type.");
BKE_report(op->reports, RPT_ERROR, "Unknown alpha transparency modifier type");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -938,16 +940,16 @@ void SCENE_OT_freestyle_alpha_modifier_add(wmOperatorType *ot)
static int freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_thickness_modifier(lineset->linestyle, type) < 0) {
BKE_report(op->reports, RPT_ERROR, "Unknown line thickness modifier type.");
BKE_report(op->reports, RPT_ERROR, "Unknown line thickness modifier type");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -977,16 +979,16 @@ void SCENE_OT_freestyle_thickness_modifier_add(wmOperatorType *ot)
static int freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
int type = RNA_enum_get(op->ptr, "type");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style to add the modifier to");
return OPERATOR_CANCELLED;
}
if (FRS_add_linestyle_geometry_modifier(lineset->linestyle, type) < 0) {
BKE_report(op->reports, RPT_ERROR, "Unknown stroke geometry modifier type.");
BKE_report(op->reports, RPT_ERROR, "Unknown stroke geometry modifier type");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -1029,15 +1031,16 @@ static int freestyle_get_modifier_type(PointerRNA *ptr)
static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
LineStyleModifier *modifier = ptr.data;
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style the modifier belongs to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style the modifier belongs to");
return OPERATOR_CANCELLED;
}
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
FRS_remove_linestyle_color_modifier(lineset->linestyle, modifier);
@@ -1052,7 +1055,7 @@ static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
FRS_remove_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier.");
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
@@ -1078,13 +1081,13 @@ void SCENE_OT_freestyle_modifier_remove(wmOperatorType *ot)
static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
LineStyleModifier *modifier = ptr.data;
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style the modifier belongs to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style the modifier belongs to");
return OPERATOR_CANCELLED;
}
@@ -1102,13 +1105,12 @@ static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
FRS_copy_linestyle_geometry_modifier(lineset->linestyle, modifier);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier.");
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
}
void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot)
@@ -1129,16 +1131,17 @@ void SCENE_OT_freestyle_modifier_copy(wmOperatorType *ot)
static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay);
SceneRenderLayer *srl = BLI_findlink(&scene->r.layers, scene->r.actlay);
FreestyleLineSet *lineset = FRS_get_active_lineset(&srl->freestyleConfig);
PointerRNA ptr = CTX_data_pointer_get_type(C, "modifier", &RNA_LineStyleModifier);
LineStyleModifier *modifier = ptr.data;
int dir = RNA_enum_get(op->ptr, "direction");
if (!lineset) {
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style the modifier belongs to.");
BKE_report(op->reports, RPT_ERROR, "No active lineset and associated line style the modifier belongs to");
return OPERATOR_CANCELLED;
}
switch (freestyle_get_modifier_type(&ptr)) {
case LS_MODIFIER_TYPE_COLOR:
FRS_move_linestyle_color_modifier(lineset->linestyle, modifier, dir);
@@ -1153,7 +1156,7 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
FRS_move_linestyle_geometry_modifier(lineset->linestyle, modifier, dir);
break;
default:
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier.");
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);

View File

@@ -836,6 +836,9 @@ int transformEvent(TransInfo *t, wmEvent *event)
t->redraw |= handleMouseInput(t, &t->mouse, event);
if (event->type == MOUSEMOVE) {
if (t->modifiers & MOD_CONSTRAINT_SELECT)
t->con.mode |= CON_SELECT;
copy_v2_v2_int(t->mval, event->mval);
// t->redraw |= TREDRAW_SOFT; /* Use this for soft redraw. Might cause flicker in object mode */
@@ -2037,9 +2040,6 @@ void transformApply(bContext *C, TransInfo *t)
t->context = C;
if ((t->redraw & TREDRAW_HARD) || (t->draw_handle_apply == NULL && (t->redraw & TREDRAW_SOFT))) {
if (t->modifiers & MOD_CONSTRAINT_SELECT)
t->con.mode |= CON_SELECT;
selectConstraint(t);
if (t->transform) {
t->transform(t, t->mval); // calls recalcData()

View File

@@ -1,7 +1,4 @@
/* DNA_freestyle_types.h
*
* $Id$
*
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -28,52 +25,52 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef DNA_FREESTYLE_TYPES_H
#define DNA_FREESTYLE_TYPES_H
#ifndef __DNA_FREESTYLE_TYPES_H__
#define __DNA_FREESTYLE_TYPES_H__
#include "DNA_listBase.h"
struct FreestyleLineStyle;
/* FreestyleConfig::flags */
#define FREESTYLE_SUGGESTIVE_CONTOURS_FLAG 1
#define FREESTYLE_RIDGES_AND_VALLEYS_FLAG 2
#define FREESTYLE_MATERIAL_BOUNDARIES_FLAG 4
#define FREESTYLE_FACE_SMOOTHNESS_FLAG 8
#define FREESTYLE_ADVANCED_OPTIONS_FLAG 16
#define FREESTYLE_CULLING 32
#define FREESTYLE_SUGGESTIVE_CONTOURS_FLAG (1 << 0)
#define FREESTYLE_RIDGES_AND_VALLEYS_FLAG (1 << 1)
#define FREESTYLE_MATERIAL_BOUNDARIES_FLAG (1 << 2)
#define FREESTYLE_FACE_SMOOTHNESS_FLAG (1 << 3)
#define FREESTYLE_ADVANCED_OPTIONS_FLAG (1 << 4)
#define FREESTYLE_CULLING (1 << 5)
/* FreestyleConfig::mode */
#define FREESTYLE_CONTROL_SCRIPT_MODE 1
#define FREESTYLE_CONTROL_EDITOR_MODE 2
/* FreestyleLineSet::flags */
#define FREESTYLE_LINESET_CURRENT 1l
#define FREESTYLE_LINESET_ENABLED 2
#define FREESTYLE_LINESET_FE_NOT 4
#define FREESTYLE_LINESET_FE_AND 8
#define FREESTYLE_LINESET_GR_NOT 16
#define FREESTYLE_LINESET_FM_NOT 32
#define FREESTYLE_LINESET_FM_BOTH 64
#define FREESTYLE_LINESET_CURRENT (1 << 0)
#define FREESTYLE_LINESET_ENABLED (1 << 1)
#define FREESTYLE_LINESET_FE_NOT (1 << 2)
#define FREESTYLE_LINESET_FE_AND (1 << 3)
#define FREESTYLE_LINESET_GR_NOT (1 << 4)
#define FREESTYLE_LINESET_FM_NOT (1 << 5)
#define FREESTYLE_LINESET_FM_BOTH (1 << 6)
/* FreestyleLineSet::selection */
#define FREESTYLE_SEL_VISIBILITY 1
#define FREESTYLE_SEL_EDGE_TYPES 2
#define FREESTYLE_SEL_GROUP 4
#define FREESTYLE_SEL_IMAGE_BORDER 8
#define FREESTYLE_SEL_FACE_MARK 16
#define FREESTYLE_SEL_VISIBILITY (1 << 0)
#define FREESTYLE_SEL_EDGE_TYPES (1 << 1)
#define FREESTYLE_SEL_GROUP (1 << 2)
#define FREESTYLE_SEL_IMAGE_BORDER (1 << 3)
#define FREESTYLE_SEL_FACE_MARK (1 << 4)
/* FreestyleLineSet::edge_types, exclude_edge_types */
#define FREESTYLE_FE_SILHOUETTE 1
#define FREESTYLE_FE_BORDER 2
#define FREESTYLE_FE_CREASE 4
#define FREESTYLE_FE_RIDGE_VALLEY 8
/* Note: FREESTYLE_FE_VALLEY = 16 is no longer used */
#define FREESTYLE_FE_SUGGESTIVE_CONTOUR 32
#define FREESTYLE_FE_MATERIAL_BOUNDARY 64
#define FREESTYLE_FE_CONTOUR 128
#define FREESTYLE_FE_EXTERNAL_CONTOUR 512
#define FREESTYLE_FE_EDGE_MARK 1024
#define FREESTYLE_FE_SILHOUETTE (1 << 0)
#define FREESTYLE_FE_BORDER (1 << 1)
#define FREESTYLE_FE_CREASE (1 << 2)
#define FREESTYLE_FE_RIDGE_VALLEY (1 << 3)
/* Note: FREESTYLE_FE_VALLEY = (1 << 4) is no longer used */
#define FREESTYLE_FE_SUGGESTIVE_CONTOUR (1 << 5)
#define FREESTYLE_FE_MATERIAL_BOUNDARY (1 << 6)
#define FREESTYLE_FE_CONTOUR (1 << 7)
#define FREESTYLE_FE_EXTERNAL_CONTOUR (1 << 8)
#define FREESTYLE_FE_EDGE_MARK (1 << 9)
/* FreestyleLineSet::qi */
#define FREESTYLE_QI_VISIBLE 1
@@ -81,7 +78,7 @@ struct FreestyleLineStyle;
#define FREESTYLE_QI_RANGE 3
/* FreestyleConfig::raycasting_algorithm */
// Defines should be replaced with ViewMapBuilder::visibility_algo
/* Defines should be replaced with ViewMapBuilder::visibility_algo */
#define FREESTYLE_ALGO_REGULAR 1
#define FREESTYLE_ALGO_FAST 2
#define FREESTYLE_ALGO_VERYFAST 3
@@ -105,7 +102,6 @@ typedef struct FreestyleLineSet {
struct Group *group; /* group of target objects */
struct FreestyleLineStyle *linestyle;
} FreestyleLineSet;
typedef struct FreestyleModuleConfig {
@@ -114,7 +110,6 @@ typedef struct FreestyleModuleConfig {
char module_path[256];
short is_displayed;
short pad[3];
} FreestyleModuleConfig;
typedef struct FreestyleConfig {
@@ -128,7 +123,6 @@ typedef struct FreestyleConfig {
float crease_angle; /* in radians! */
ListBase linesets;
} FreestyleConfig;
#endif

View File

@@ -1,7 +1,4 @@
/* DNA_linestyle_types.h
*
* $Id$
*
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -28,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
#ifndef DNA_LINESTYLE_TYPES_H
#define DNA_LINESTYLE_TYPES_H
#ifndef __DNA_LINESTYLE_TYPES_H__
#define __DNA_LINESTYLE_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
@@ -96,7 +93,6 @@ typedef struct LineStyleColorModifier_AlongStroke {
struct LineStyleModifier modifier;
struct ColorBand *color_ramp;
} LineStyleColorModifier_AlongStroke;
typedef struct LineStyleAlphaModifier_AlongStroke {
@@ -105,7 +101,6 @@ typedef struct LineStyleAlphaModifier_AlongStroke {
struct CurveMapping *curve;
int flags;
int pad;
} LineStyleAlphaModifier_AlongStroke;
typedef struct LineStyleThicknessModifier_AlongStroke {
@@ -115,7 +110,6 @@ typedef struct LineStyleThicknessModifier_AlongStroke {
int flags;
float value_min, value_max;
int pad;
} LineStyleThicknessModifier_AlongStroke;
/* Distance from Camera modifiers */
@@ -125,7 +119,6 @@ typedef struct LineStyleColorModifier_DistanceFromCamera {
struct ColorBand *color_ramp;
float range_min, range_max;
} LineStyleColorModifier_DistanceFromCamera;
typedef struct LineStyleAlphaModifier_DistanceFromCamera {
@@ -135,7 +128,6 @@ typedef struct LineStyleAlphaModifier_DistanceFromCamera {
int flags;
float range_min, range_max;
int pad;
} LineStyleAlphaModifier_DistanceFromCamera;
typedef struct LineStyleThicknessModifier_DistanceFromCamera {
@@ -146,7 +138,6 @@ typedef struct LineStyleThicknessModifier_DistanceFromCamera {
float range_min, range_max;
float value_min, value_max;
int pad;
} LineStyleThicknessModifier_DistanceFromCamera;
/* Distance from Object modifiers */
@@ -157,7 +148,6 @@ typedef struct LineStyleColorModifier_DistanceFromObject {
struct Object *target;
struct ColorBand *color_ramp;
float range_min, range_max;
} LineStyleColorModifier_DistanceFromObject;
typedef struct LineStyleAlphaModifier_DistanceFromObject {
@@ -168,7 +158,6 @@ typedef struct LineStyleAlphaModifier_DistanceFromObject {
int flags;
float range_min, range_max;
int pad;
} LineStyleAlphaModifier_DistanceFromObject;
typedef struct LineStyleThicknessModifier_DistanceFromObject {
@@ -180,7 +169,6 @@ typedef struct LineStyleThicknessModifier_DistanceFromObject {
float range_min, range_max;
float value_min, value_max;
int pad;
} LineStyleThicknessModifier_DistanceFromObject;
/* Material modifiers */
@@ -203,7 +191,6 @@ typedef struct LineStyleColorModifier_Material {
struct ColorBand *color_ramp;
int flags;
int mat_attr;
} LineStyleColorModifier_Material;
typedef struct LineStyleAlphaModifier_Material {
@@ -212,7 +199,6 @@ typedef struct LineStyleAlphaModifier_Material {
struct CurveMapping *curve;
int flags;
int mat_attr;
} LineStyleAlphaModifier_Material;
typedef struct LineStyleThicknessModifier_Material {
@@ -222,7 +208,6 @@ typedef struct LineStyleThicknessModifier_Material {
int flags;
float value_min, value_max;
int mat_attr;
} LineStyleThicknessModifier_Material;
/* Geometry modifiers */
@@ -232,7 +217,6 @@ typedef struct LineStyleGeometryModifier_Sampling {
float sampling;
int pad;
} LineStyleGeometryModifier_Sampling;
typedef struct LineStyleGeometryModifier_BezierCurve {
@@ -240,7 +224,6 @@ typedef struct LineStyleGeometryModifier_BezierCurve {
float error;
int pad;
} LineStyleGeometryModifier_BezierCurve;
typedef struct LineStyleGeometryModifier_SinusDisplacement {
@@ -248,7 +231,6 @@ typedef struct LineStyleGeometryModifier_SinusDisplacement {
float wavelength, amplitude, phase;
int pad;
} LineStyleGeometryModifier_SinusDisplacement;
/* LineStyleGeometryModifier_SpatialNoise::flags */
@@ -261,7 +243,6 @@ typedef struct LineStyleGeometryModifier_SpatialNoise {
float amplitude, scale;
unsigned int octaves;
int flags;
} LineStyleGeometryModifier_SpatialNoise;
typedef struct LineStyleGeometryModifier_PerlinNoise1D {
@@ -272,7 +253,6 @@ typedef struct LineStyleGeometryModifier_PerlinNoise1D {
unsigned int octaves;
int seed;
int pad1;
} LineStyleGeometryModifier_PerlinNoise1D;
typedef struct LineStyleGeometryModifier_PerlinNoise2D {
@@ -283,7 +263,6 @@ typedef struct LineStyleGeometryModifier_PerlinNoise2D {
unsigned int octaves;
int seed;
int pad1;
} LineStyleGeometryModifier_PerlinNoise2D;
typedef struct LineStyleGeometryModifier_BackboneStretcher {
@@ -291,7 +270,6 @@ typedef struct LineStyleGeometryModifier_BackboneStretcher {
float backbone_length;
int pad;
} LineStyleGeometryModifier_BackboneStretcher;
typedef struct LineStyleGeometryModifier_TipRemover {
@@ -299,7 +277,6 @@ typedef struct LineStyleGeometryModifier_TipRemover {
float tip_length;
int pad;
} LineStyleGeometryModifier_TipRemover;
typedef struct LineStyleGeometryModifier_Polygonalization {
@@ -307,7 +284,6 @@ typedef struct LineStyleGeometryModifier_Polygonalization {
float error;
int pad;
} LineStyleGeometryModifier_Polygonalization;
typedef struct LineStyleGeometryModifier_GuidingLines {
@@ -315,7 +291,6 @@ typedef struct LineStyleGeometryModifier_GuidingLines {
float offset;
int pad;
} LineStyleGeometryModifier_GuidingLines;
/* LineStyleGeometryModifier_BluePrintLines::shape */
@@ -332,7 +307,6 @@ typedef struct LineStyleGeometryModifier_Blueprint {
unsigned int random_radius;
unsigned int random_center;
unsigned int random_backbone;
} LineStyleGeometryModifier_Blueprint;
typedef struct LineStyleGeometryModifier_2DOffset {
@@ -340,7 +314,6 @@ typedef struct LineStyleGeometryModifier_2DOffset {
float start, end;
float x, y;
} LineStyleGeometryModifier_2DOffset;
/* LineStyleGeometryModifier_2DTransform::pivot */
@@ -359,7 +332,6 @@ typedef struct LineStyleGeometryModifier_2DTransform {
float pivot_u;
float pivot_x, pivot_y;
int pad;
} LineStyleGeometryModifier_2DTransform;
/* Calligraphic thickness modifier */
@@ -370,7 +342,6 @@ typedef struct LineStyleThicknessModifier_Calligraphy {
float min_thickness, max_thickness;
float orientation; /* in radians! */
int pad;
} LineStyleThicknessModifier_Calligraphy;
/* FreestyleLineStyle::panel */
@@ -382,17 +353,17 @@ typedef struct LineStyleThicknessModifier_Calligraphy {
#define LS_PANEL_MISC 6
/* FreestyleLineStyle::flag */
#define LS_DS_EXPAND 1 /* for animation editors */
#define LS_SAME_OBJECT 2
#define LS_DASHED_LINE 4
#define LS_MATERIAL_BOUNDARY 8
#define LS_MIN_2D_LENGTH 16
#define LS_MAX_2D_LENGTH 32
#define LS_NO_CHAINING 64
#define LS_MIN_2D_ANGLE 128
#define LS_MAX_2D_ANGLE 256
#define LS_SPLIT_LENGTH 512
#define LS_SPLIT_PATTERN 1024
#define LS_DS_EXPAND (1 << 0) /* for animation editors */
#define LS_SAME_OBJECT (1 << 1)
#define LS_DASHED_LINE (1 << 2)
#define LS_MATERIAL_BOUNDARY (1 << 3)
#define LS_MIN_2D_LENGTH (1 << 4)
#define LS_MAX_2D_LENGTH (1 << 5)
#define LS_NO_CHAINING (1 << 6)
#define LS_MIN_2D_ANGLE (1 << 7)
#define LS_MAX_2D_ANGLE (1 << 8)
#define LS_SPLIT_LENGTH (1 << 9)
#define LS_SPLIT_PATTERN (1 << 10)
/* FreestyleLineStyle::chaining */
#define LS_CHAINING_PLAIN 1
@@ -434,7 +405,6 @@ typedef struct FreestyleLineStyle {
ListBase alpha_modifiers;
ListBase thickness_modifiers;
ListBase geometry_modifiers;
} FreestyleLineStyle;
#endif

View File

@@ -190,7 +190,6 @@ typedef struct SceneRenderLayer {
int pad;
struct FreestyleConfig freestyleConfig;
} SceneRenderLayer;
/* srl->layflag */

View File

@@ -195,10 +195,10 @@ static char *rna_ColorRamp_path(PointerRNA *ptr)
char *path = FRS_path_from_ID_to_color_ramp((FreestyleLineStyle *)id, (ColorBand *)ptr->data);
if (path)
return path;
}
break;
}
}
}
else {
/* everything else just uses 'color_ramp' */
path = BLI_strdup("color_ramp");
@@ -279,8 +279,8 @@ static char *rna_ColorRampElement_path(PointerRNA *ptr)
COLRAMP_GETPATH;
}
BLI_freelistN(&listbase);
}
break;
}
default: /* everything else should have a "color_ramp" property */
{
@@ -338,8 +338,8 @@ static void rna_ColorRamp_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *
FreestyleLineStyle *linestyle= ptr->id.data;
WM_main_add_notifier(NC_LINESTYLE, linestyle);
}
break;
}
default:
break;
}

View File

@@ -1,6 +1,4 @@
/**
* $Id$
*
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -22,10 +20,15 @@
* ***** END GPL LICENSE BLOCK *****
*/
/** \file blender/makesrna/intern/rna_linestyle.c
* \ingroup RNA
*/
#include <stdio.h>
#include <stdlib.h>
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -41,14 +44,16 @@ EnumPropertyItem linestyle_color_modifier_type_items[] ={
{LS_MODIFIER_DISTANCE_FROM_CAMERA, "DISTANCE_FROM_CAMERA", ICON_MODIFIER, "Distance from Camera", ""},
{LS_MODIFIER_DISTANCE_FROM_OBJECT, "DISTANCE_FROM_OBJECT", ICON_MODIFIER, "Distance from Object", ""},
{LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem linestyle_alpha_modifier_type_items[] = {
{LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
{LS_MODIFIER_DISTANCE_FROM_CAMERA, "DISTANCE_FROM_CAMERA", ICON_MODIFIER, "Distance from Camera", ""},
{LS_MODIFIER_DISTANCE_FROM_OBJECT, "DISTANCE_FROM_OBJECT", ICON_MODIFIER, "Distance from Object", ""},
{LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem linestyle_thickness_modifier_type_items[] = {
{LS_MODIFIER_ALONG_STROKE, "ALONG_STROKE", ICON_MODIFIER, "Along Stroke", ""},
@@ -56,7 +61,8 @@ EnumPropertyItem linestyle_thickness_modifier_type_items[] ={
{LS_MODIFIER_DISTANCE_FROM_CAMERA, "DISTANCE_FROM_CAMERA", ICON_MODIFIER, "Distance from Camera", ""},
{LS_MODIFIER_DISTANCE_FROM_OBJECT, "DISTANCE_FROM_OBJECT", ICON_MODIFIER, "Distance from Object", ""},
{LS_MODIFIER_MATERIAL, "MATERIAL", ICON_MODIFIER, "Material", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
EnumPropertyItem linestyle_geometry_modifier_type_items[] = {
{LS_MODIFIER_2D_OFFSET, "2D_OFFSET", ICON_MODIFIER, "2D Offset", ""},
@@ -72,7 +78,8 @@ EnumPropertyItem linestyle_geometry_modifier_type_items[] ={
{LS_MODIFIER_SINUS_DISPLACEMENT, "SINUS_DISPLACEMENT", ICON_MODIFIER, "Sinus Displacement", ""},
{LS_MODIFIER_SPATIAL_NOISE, "SPATIAL_NOISE", ICON_MODIFIER, "Spatial Noise", ""},
{LS_MODIFIER_TIP_REMOVER, "TIP_REMOVER", ICON_MODIFIER, "Tip Remover", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
#ifdef RNA_RUNTIME
@@ -196,7 +203,8 @@ static void rna_LineStyleColorModifier_name_set(PointerRNA *ptr, const char *val
LineStyleModifier *m = (LineStyleModifier *)ptr->data;
BLI_strncpy_utf8(m->name, value, sizeof(m->name));
BLI_uniquename(&linestyle->color_modifiers, m, "ColorModifier", '.', offsetof(LineStyleModifier, name), sizeof(m->name));
BLI_uniquename(&linestyle->color_modifiers, m, "ColorModifier", '.',
offsetof(LineStyleModifier, name), sizeof(m->name));
}
static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *value)
@@ -205,7 +213,8 @@ static void rna_LineStyleAlphaModifier_name_set(PointerRNA *ptr, const char *val
LineStyleModifier *m = (LineStyleModifier *)ptr->data;
BLI_strncpy_utf8(m->name, value, sizeof(m->name));
BLI_uniquename(&linestyle->alpha_modifiers, m, "AlphaModifier", '.', offsetof(LineStyleModifier, name), sizeof(m->name));
BLI_uniquename(&linestyle->alpha_modifiers, m, "AlphaModifier", '.',
offsetof(LineStyleModifier, name), sizeof(m->name));
}
static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char *value)
@@ -214,7 +223,8 @@ static void rna_LineStyleThicknessModifier_name_set(PointerRNA *ptr, const char
LineStyleModifier *m = (LineStyleModifier *)ptr->data;
BLI_strncpy_utf8(m->name, value, sizeof(m->name));
BLI_uniquename(&linestyle->thickness_modifiers, m, "ThicknessModifier", '.', offsetof(LineStyleModifier, name), sizeof(m->name));
BLI_uniquename(&linestyle->thickness_modifiers, m, "ThicknessModifier", '.',
offsetof(LineStyleModifier, name), sizeof(m->name));
}
static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char *value)
@@ -223,7 +233,8 @@ static void rna_LineStyleGeometryModifier_name_set(PointerRNA *ptr, const char *
LineStyleModifier *m = (LineStyleModifier *)ptr->data;
BLI_strncpy_utf8(m->name, value, sizeof(m->name));
BLI_uniquename(&linestyle->geometry_modifiers, m, "GeometryModifier", '.', offsetof(LineStyleModifier, name), sizeof(m->name));
BLI_uniquename(&linestyle->geometry_modifiers, m, "GeometryModifier", '.',
offsetof(LineStyleModifier, name), sizeof(m->name));
}
#else
@@ -235,27 +246,7 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi
{
PropertyRNA *prop;
static EnumPropertyItem color_blend_items[] = {
{MA_RAMP_BLEND, "MIX", 0, "Mix", ""},
{MA_RAMP_ADD, "ADD", 0, "Add", ""},
{MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""},
{MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""},
{MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""},
{MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""},
{MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""},
{MA_RAMP_DARK, "DARKEN", 0, "Darken", ""},
{MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""},
{MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""},
{MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""},
{MA_RAMP_BURN, "BURN", 0, "Burn", ""},
{MA_RAMP_HUE, "HUE", 0, "Hue", ""},
{MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""},
{MA_RAMP_VAL, "VALUE", 0, "Value", ""},
{MA_RAMP_COLOR, "COLOR", 0, "Color", ""},
{MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""},
{MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""},
{0, NULL, 0, NULL, NULL}};
/* TODO: Check this is not already defined somewhere else, e.g. in nodes... */
static EnumPropertyItem value_blend_items[] = {
{LS_VALUE_BLEND, "MIX", 0, "Mix", ""},
{LS_VALUE_ADD, "ADD", 0, "Add", ""},
@@ -265,7 +256,8 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi
{LS_VALUE_DIFF, "DIFFERENCE", 0, "Divide", ""},
{LS_VALUE_MIN, "MININUM", 0, "Minimum", ""},
{LS_VALUE_MAX, "MAXIMUM", 0, "Maximum", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "modifier.type");
@@ -283,7 +275,7 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi
if (blend) {
prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "modifier.blend");
RNA_def_property_enum_items(prop, (color) ? color_blend_items : value_blend_items);
RNA_def_property_enum_items(prop, (color) ? ramp_blend_items : value_blend_items);
RNA_def_property_ui_text(prop, "Blend", "Specify how the modifier value is blended into the base value");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
@@ -306,25 +298,25 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi
static void rna_def_color_modifier(StructRNA *srna)
{
rna_def_modifier_type_common(srna, linestyle_color_modifier_type_items,
"rna_LineStyleColorModifier_name_set", 1, 1);
"rna_LineStyleColorModifier_name_set", TRUE, TRUE);
}
static void rna_def_alpha_modifier(StructRNA *srna)
{
rna_def_modifier_type_common(srna, linestyle_alpha_modifier_type_items,
"rna_LineStyleAlphaModifier_name_set", 1, 0);
"rna_LineStyleAlphaModifier_name_set", TRUE, FALSE);
}
static void rna_def_thickness_modifier(StructRNA *srna)
{
rna_def_modifier_type_common(srna, linestyle_thickness_modifier_type_items,
"rna_LineStyleThicknessModifier_name_set", 1, 0);
"rna_LineStyleThicknessModifier_name_set", TRUE, FALSE);
}
static void rna_def_geometry_modifier(StructRNA *srna)
{
rna_def_modifier_type_common(srna, linestyle_geometry_modifier_type_items,
"rna_LineStyleGeometryModifier_name_set", 0, 0);
"rna_LineStyleGeometryModifier_name_set", FALSE, FALSE);
}
static void rna_def_modifier_color_ramp_common(StructRNA *srna, int range)
@@ -357,7 +349,8 @@ static void rna_def_modifier_curve_common(StructRNA *srna, int range, int value)
static EnumPropertyItem mapping_items[] = {
{0, "LINEAR", 0, "Linear", "Use linear mapping"},
{LS_MODIFIER_USE_CURVE, "CURVE", 0, "Curve", "Use curve mapping"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "mapping", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
@@ -416,7 +409,8 @@ static void rna_def_modifier_material_common(StructRNA *srna)
{LS_MODIFIER_MATERIAL_SPEC_B, "SPEC_B", 0, "Specular Blue", ""},
{LS_MODIFIER_MATERIAL_SPEC_HARD, "SPEC_HARD", 0, "Specular Hardness", ""},
{LS_MODIFIER_MATERIAL_ALPHA, "ALPHA", 0, "Alpha", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
prop = RNA_def_property(srna, "material_attr", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "mat_attr");
@@ -435,7 +429,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
{LS_MODIFIER_BLUEPRINT_CIRCLES, "CIRCLES", 0, "Circles", "Draw a blueprint using circular contour strokes"},
{LS_MODIFIER_BLUEPRINT_ELLIPSES, "ELLIPSES", 0, "Ellipses", "Draw a blueprint using elliptic contour strokes"},
{LS_MODIFIER_BLUEPRINT_SQUARES, "SQUARES", 0, "Squares", "Draw a blueprint using square contour strokes"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem transform_pivot_items[] = {
{LS_MODIFIER_2D_TRANSFORM_PIVOT_CENTER, "CENTER", 0, "Stroke Center", ""},
@@ -443,7 +438,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
{LS_MODIFIER_2D_TRANSFORM_PIVOT_END, "END", 0, "Stroke End", ""},
{LS_MODIFIER_2D_TRANSFORM_PIVOT_PARAM, "PARAM", 0, "Stroke Point Parameter", ""},
{LS_MODIFIER_2D_TRANSFORM_PIVOT_ABSOLUTE, "ABSOLUTE", 0, "Absolute 2D Point", ""},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "LineStyleModifier", NULL);
RNA_def_struct_ui_text(srna, "Line Style Modifier", "Base type to define modifiers");
@@ -459,17 +455,17 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
srna = RNA_def_struct(brna, "LineStyleColorModifier_AlongStroke", "LineStyleColorModifier");
RNA_def_struct_ui_text(srna, "Along Stroke", "Change line color along stroke");
rna_def_color_modifier(srna);
rna_def_modifier_color_ramp_common(srna, 0);
rna_def_modifier_color_ramp_common(srna, FALSE);
srna = RNA_def_struct(brna, "LineStyleColorModifier_DistanceFromCamera", "LineStyleColorModifier");
RNA_def_struct_ui_text(srna, "Distance from Camera", "Change line color based on the distance from the camera");
rna_def_color_modifier(srna);
rna_def_modifier_color_ramp_common(srna, 1);
rna_def_modifier_color_ramp_common(srna, TRUE);
srna = RNA_def_struct(brna, "LineStyleColorModifier_DistanceFromObject", "LineStyleColorModifier");
RNA_def_struct_ui_text(srna, "Distance from Object", "Change line color based on the distance from an object");
rna_def_color_modifier(srna);
rna_def_modifier_color_ramp_common(srna, 1);
rna_def_modifier_color_ramp_common(srna, TRUE);
prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "target");
@@ -482,7 +478,7 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Material", "Change line color based on a material attribute");
rna_def_color_modifier(srna);
rna_def_modifier_material_common(srna);
rna_def_modifier_color_ramp_common(srna, 0);
rna_def_modifier_color_ramp_common(srna, FALSE);
prop = RNA_def_property(srna, "use_ramp", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", LS_MODIFIER_USE_RAMP);
@@ -500,17 +496,19 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
srna = RNA_def_struct(brna, "LineStyleAlphaModifier_AlongStroke", "LineStyleAlphaModifier");
RNA_def_struct_ui_text(srna, "Along Stroke", "Change alpha transparency along stroke");
rna_def_alpha_modifier(srna);
rna_def_modifier_curve_common(srna, 0, 0);
rna_def_modifier_curve_common(srna, FALSE, FALSE);
srna = RNA_def_struct(brna, "LineStyleAlphaModifier_DistanceFromCamera", "LineStyleAlphaModifier");
RNA_def_struct_ui_text(srna, "Distance from Camera", "Change alpha transparency based on the distance from the camera");
RNA_def_struct_ui_text(srna, "Distance from Camera",
"Change alpha transparency based on the distance from the camera");
rna_def_alpha_modifier(srna);
rna_def_modifier_curve_common(srna, 1, 0);
rna_def_modifier_curve_common(srna, TRUE, FALSE);
srna= RNA_def_struct(brna, "LineStyleAlphaModifier_DistanceFromObject", "LineStyleAlphaModifier");
RNA_def_struct_ui_text(srna, "Distance from Object", "Change alpha transparency based on the distance from an object");
RNA_def_struct_ui_text(srna, "Distance from Object",
"Change alpha transparency based on the distance from an object");
rna_def_alpha_modifier(srna);
rna_def_modifier_curve_common(srna, 1, 0);
rna_def_modifier_curve_common(srna, TRUE, FALSE);
prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "target");
@@ -523,7 +521,7 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Material", "Change alpha transparency based on a material attribute");
rna_def_alpha_modifier(srna);
rna_def_modifier_material_common(srna);
rna_def_modifier_curve_common(srna, 0, 0);
rna_def_modifier_curve_common(srna, FALSE, FALSE);
/* line thickness modifiers */
@@ -536,17 +534,17 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
srna = RNA_def_struct(brna, "LineStyleThicknessModifier_AlongStroke", "LineStyleThicknessModifier");
RNA_def_struct_ui_text(srna, "Along Stroke", "Change line thickness along stroke");
rna_def_thickness_modifier(srna);
rna_def_modifier_curve_common(srna, 0, 1);
rna_def_modifier_curve_common(srna, FALSE, TRUE);
srna = RNA_def_struct(brna, "LineStyleThicknessModifier_DistanceFromCamera", "LineStyleThicknessModifier");
RNA_def_struct_ui_text(srna, "Distance from Camera", "Change line thickness based on the distance from the camera");
rna_def_thickness_modifier(srna);
rna_def_modifier_curve_common(srna, 1, 1);
rna_def_modifier_curve_common(srna, TRUE, TRUE);
srna = RNA_def_struct(brna, "LineStyleThicknessModifier_DistanceFromObject", "LineStyleThicknessModifier");
RNA_def_struct_ui_text(srna, "Distance from Object", "Change line thickness based on the distance from an object");
rna_def_thickness_modifier(srna);
rna_def_modifier_curve_common(srna, 1, 1);
rna_def_modifier_curve_common(srna, TRUE, TRUE);
prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "target");
@@ -559,10 +557,11 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Material", "Change line thickness based on a material attribute");
rna_def_thickness_modifier(srna);
rna_def_modifier_material_common(srna);
rna_def_modifier_curve_common(srna, 0, 1);
rna_def_modifier_curve_common(srna, FALSE, TRUE);
srna = RNA_def_struct(brna, "LineStyleThicknessModifier_Calligraphy", "LineStyleThicknessModifier");
RNA_def_struct_ui_text(srna, "Calligraphy", "Change line thickness so that stroke looks like made with a calligraphic pen");
RNA_def_struct_ui_text(srna, "Calligraphy",
"Change line thickness so that stroke looks like made with a calligraphic pen");
rna_def_thickness_modifier(srna);
prop = RNA_def_property(srna, "orientation", PROP_FLOAT, PROP_ANGLE);
@@ -573,7 +572,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
prop = RNA_def_property(srna, "min_thickness", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "min_thickness");
RNA_def_property_range(prop, 0.0f, 10000.0f);
RNA_def_property_ui_text(prop, "Min Thickness", "Minimum thickness in the direction perpendicular to the main direction");
RNA_def_property_ui_text(prop, "Min Thickness",
"Minimum thickness in the direction perpendicular to the main direction");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
prop = RNA_def_property(srna, "max_thickness", PROP_FLOAT, PROP_NONE);
@@ -591,7 +591,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_struct_ui_text(srna, "Line Style Geometry Modifier", "Base type to define stroke geometry modifiers");
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Sampling", "LineStyleGeometryModifier");
RNA_def_struct_ui_text(srna, "Sampling", "Specify a new sampling value that determines the resolution of stroke polylines");
RNA_def_struct_ui_text(srna, "Sampling",
"Specify a new sampling value that determines the resolution of stroke polylines");
rna_def_geometry_modifier(srna);
prop = RNA_def_property(srna, "sampling", PROP_FLOAT, PROP_NONE);
@@ -600,12 +601,16 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_BezierCurve", "LineStyleGeometryModifier");
RNA_def_struct_ui_text(srna, "Bezier Curve", "Replace stroke backbone geometry by a Bezier curve approximation of the original backbone geometry");
RNA_def_struct_ui_text(srna, "Bezier Curve",
"Replace stroke backbone geometry by a Bezier curve approximation of the "
"original backbone geometry");
rna_def_geometry_modifier(srna);
prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "error");
RNA_def_property_ui_text(prop, "Error", "Maximum distance allowed between the new Bezier curve and the original backbone geometry)");
RNA_def_property_ui_text(prop, "Error",
"Maximum distance allowed between the new Bezier curve and the "
"original backbone geometry)");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_SinusDisplacement", "LineStyleGeometryModifier");
@@ -682,7 +687,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed");
RNA_def_property_ui_text(prop, "Seed", "Seed for random number generation. If negative, time is used as a seed instead");
RNA_def_property_ui_text(prop, "Seed",
"Seed for random number generation (if negative, time is used as a seed instead)");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_PerlinNoise2D", "LineStyleGeometryModifier");
@@ -711,7 +717,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
prop = RNA_def_property(srna, "seed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "seed");
RNA_def_property_ui_text(prop, "Seed", "Seed for random number generation. If negative, time is used as a seed instead");
RNA_def_property_ui_text(prop, "Seed",
"Seed for random number generation (if negative, time is used as a seed instead)");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_BackboneStretcher", "LineStyleGeometryModifier");
@@ -724,7 +731,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_TipRemover", "LineStyleGeometryModifier");
RNA_def_struct_ui_text(srna, "Tip Remover", "Remove a piece of stroke at the beginning and the end of stroke backbone");
RNA_def_struct_ui_text(srna, "Tip Remover",
"Remove a piece of stroke at the beginning and the end of stroke backbone");
rna_def_geometry_modifier(srna);
prop = RNA_def_property(srna, "tip_length", PROP_FLOAT, PROP_NONE);
@@ -733,25 +741,29 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Polygonalization", "LineStyleGeometryModifier");
RNA_def_struct_ui_text(srna, "Polygonalization", "Modify the stroke geometry so that it looks more \"polygonal\"");
RNA_def_struct_ui_text(srna, "Polygonalization", "Modify the stroke geometry so that it looks more 'polygonal'");
rna_def_geometry_modifier(srna);
prop = RNA_def_property(srna, "error", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "error");
RNA_def_property_ui_text(prop, "Error", "Maximum distance between the original stroke and its polygonal approximation");
RNA_def_property_ui_text(prop, "Error",
"Maximum distance between the original stroke and its polygonal approximation");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_GuidingLines", "LineStyleGeometryModifier");
RNA_def_struct_ui_text(srna, "Guiding Lines", "Modify the stroke geometry so that it corresponds to its main direction line");
RNA_def_struct_ui_text(srna, "Guiding Lines",
"Modify the stroke geometry so that it corresponds to its main direction line");
rna_def_geometry_modifier(srna);
prop = RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "offset");
RNA_def_property_ui_text(prop, "Offset", "Displacement that is applied to the main direction line along its normal");
RNA_def_property_ui_text(prop, "Offset",
"Displacement that is applied to the main direction line along its normal");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_Blueprint", "LineStyleGeometryModifier");
RNA_def_struct_ui_text(srna, "Blueprint", "Produce a blueprint using circular, elliptic, and square contour strokes");
RNA_def_struct_ui_text(srna, "Blueprint",
"Produce a blueprint using circular, elliptic, and square contour strokes");
rna_def_geometry_modifier(srna);
prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE);
@@ -811,7 +823,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
srna = RNA_def_struct(brna, "LineStyleGeometryModifier_2DTransform", "LineStyleGeometryModifier");
RNA_def_struct_ui_text(srna, "2D Transform", "Apply two-dimensional scaling and rotation to stroke backbone geometry");
RNA_def_struct_ui_text(srna, "2D Transform",
"Apply two-dimensional scaling and rotation to stroke backbone geometry");
rna_def_geometry_modifier(srna);
prop = RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE);
@@ -838,7 +851,8 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
prop = RNA_def_property(srna, "pivot_u", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "pivot_u");
RNA_def_property_range(prop, 0.f, 1.f);
RNA_def_property_ui_text(prop, "Stroke Point Parameter", "Pivot in terms of the stroke point parameter u (0 <= u <= 1)");
RNA_def_property_ui_text(prop, "Stroke Point Parameter",
"Pivot in terms of the stroke point parameter u (0 <= u <= 1)");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
prop = RNA_def_property(srna, "pivot_x", PROP_FLOAT, PROP_NONE);
@@ -850,7 +864,6 @@ static void rna_def_linestyle_modifiers(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "pivot_y");
RNA_def_property_ui_text(prop, "Pivot Y", "2D Y coordinate of the absolute pivot");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
}
static void rna_def_linestyle(BlenderRNA *brna)
@@ -865,22 +878,26 @@ static void rna_def_linestyle(BlenderRNA *brna)
{LS_PANEL_THICKNESS, "THICKNESS", 0, "Thickness", "Show the panel for line thickness options"},
{LS_PANEL_GEOMETRY, "GEOMETRY", 0, "Geometry", "Show the panel for stroke geometry options"},
{LS_PANEL_MISC, "MISC", 0, "Misc", "Show the panel for miscellaneous options"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem chaining_items[] = {
{LS_CHAINING_PLAIN, "PLAIN", 0, "Plain", "Plain chaining"},
{LS_CHAINING_SKETCHY, "SKETCHY", 0, "Sketchy", "Sketchy chaining with a multiple touch"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem cap_items[] = {
{LS_CAPS_BUTT, "BUTT", 0, "Butt", "Butt cap (flat)"},
{LS_CAPS_ROUND, "ROUND", 0, "Round", "Round cap (half-circle)"},
{LS_CAPS_SQUARE, "SQUARE", 0, "Square", "Square cap (flat and extended)"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem thickness_position_items[] = {
{LS_THICKNESS_CENTER, "CENTER", 0, "Center", "Stroke is centered along stroke geometry"},
{LS_THICKNESS_INSIDE, "INSIDE", 0, "Inside", "Stroke is drawn inside stroke geometry"},
{LS_THICKNESS_OUTSIDE, "OUTSIDE", 0, "Outside", "Stroke is drawn outside stroke geometry"},
{LS_THICKNESS_RELATIVE, "RELATIVE", 0, "Relative", "Stroke thinkness is split by a user-defined ratio"},
{0, NULL, 0, NULL, NULL}};
{0, NULL, 0, NULL, NULL}
};
srna = RNA_def_struct(brna, "FreestyleLineStyle", "ID");
RNA_def_struct_ui_text(srna, "Freestyle Line Style", "Freestyle line style, reusable by multiple line sets");
@@ -901,7 +918,8 @@ static void rna_def_linestyle(BlenderRNA *brna)
prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "alpha");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Alpha", "Base alpha transparency, possibly modified by alpha transparency modifiers");
RNA_def_property_ui_text(prop, "Alpha",
"Base alpha transparency, possibly modified by alpha transparency modifiers");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_NONE);
@@ -919,7 +937,9 @@ static void rna_def_linestyle(BlenderRNA *brna)
prop = RNA_def_property(srna, "thickness_ratio", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "thickness_ratio");
RNA_def_property_range(prop, 0.f, 1.f);
RNA_def_property_ui_text(prop, "Thickness Ratio", "A number between 0 (inside) and 1 (outside) specifying the relative position of stroke thickness");
RNA_def_property_ui_text(prop, "Thickness Ratio",
"A number between 0 (inside) and 1 (outside) specifying the relative position of "
"stroke thickness");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
prop = RNA_def_property(srna, "color_modifiers", PROP_COLLECTION, PROP_NONE);
@@ -977,7 +997,8 @@ static void rna_def_linestyle(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_min_angle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LS_MIN_2D_ANGLE);
RNA_def_property_ui_text(prop, "Use Min 2D Angle", "Split chains at points with angles smaller than the minimum 2D angle");
RNA_def_property_ui_text(prop, "Use Min 2D Angle",
"Split chains at points with angles smaller than the minimum 2D angle");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
prop = RNA_def_property(srna, "min_angle", PROP_FLOAT, PROP_ANGLE);
@@ -988,7 +1009,8 @@ static void rna_def_linestyle(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_max_angle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", LS_MAX_2D_ANGLE);
RNA_def_property_ui_text(prop, "Use Max 2D Angle", "Split chains at points with angles larger than the maximum 2D angle");
RNA_def_property_ui_text(prop, "Use Max 2D Angle",
"Split chains at points with angles larger than the maximum 2D angle");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
prop = RNA_def_property(srna, "max_angle", PROP_FLOAT, PROP_ANGLE);
@@ -1111,7 +1133,6 @@ static void rna_def_linestyle(BlenderRNA *brna)
RNA_def_property_range(prop, 0, USHRT_MAX);
RNA_def_property_ui_text(prop, "Gap 3", "Length of the 3rd gap for dashed lines");
RNA_def_property_update(prop, NC_LINESTYLE, NULL);
}
void RNA_def_linestyle(BlenderRNA *brna)

View File

@@ -646,7 +646,7 @@ void rna_Main_linestyles_remove(Main *bmain, ReportList *reports, FreestyleLineS
if(ID_REAL_USERS(linestyle) <= 0)
BKE_libblock_free(&bmain->linestyle, linestyle);
else
BKE_reportf(reports, RPT_ERROR, "Line style \"%s\" must have zero users to be removed, found %d.", linestyle->id.name+2, ID_REAL_USERS(linestyle));
BKE_reportf(reports, RPT_ERROR, "Line style '%s' must have zero users to be removed, found %d", linestyle->id.name+2, ID_REAL_USERS(linestyle));
/* XXX python now has invalid pointer? */
}

View File

@@ -1466,7 +1466,8 @@ static PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset);
}
static void rna_FreestyleSettings_active_lineset_index_range(PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax)
static void rna_FreestyleSettings_active_lineset_index_range(PointerRNA *ptr, int *min, int *max,
int *softmin, int *softmax)
{
FreestyleConfig *config = (FreestyleConfig *)ptr->data;
@@ -2105,8 +2106,10 @@ void rna_def_render_layer_common(StructRNA *srna, int scene)
prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_FRS);
RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer");
if(scene) RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
else RNA_def_property_clear_flag(prop, PROP_EDITABLE);
if (scene)
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
else
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* passes */
prop = RNA_def_property(srna, "use_pass_combined", PROP_BOOLEAN, PROP_NONE);
@@ -2345,7 +2348,9 @@ static void rna_def_freestyle_linesets(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_int_funcs(prop, "rna_FreestyleSettings_active_lineset_index_get", "rna_FreestyleSettings_active_lineset_index_set", "rna_FreestyleSettings_active_lineset_index_range");
RNA_def_property_int_funcs(prop, "rna_FreestyleSettings_active_lineset_index_get",
"rna_FreestyleSettings_active_lineset_index_set",
"rna_FreestyleSettings_active_lineset_index_range");
RNA_def_property_ui_text(prop, "Active Line Set Index", "Index of active line set slot");
RNA_def_property_update(prop, NC_SCENE, NULL);
}
@@ -2357,49 +2362,74 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
static EnumPropertyItem edge_type_negation_items[] = {
{0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given edge type conditions"},
{FREESTYLE_LINESET_FE_NOT, "EXCLUSIVE", 0, "Exclusive", "Select feature edges not satisfying the given edge type conditions"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_LINESET_FE_NOT, "EXCLUSIVE", 0, "Exclusive",
"Select feature edges not satisfying the given edge type conditions"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem edge_type_combination_items[] = {
{0, "OR", 0, "Logical OR", "Combine feature edge type conditions by logical OR (logical disjunction)"},
{FREESTYLE_LINESET_FE_AND, "AND", 0, "Logical AND", "Combine feature edge type conditions by logical AND (logical conjunction)"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_LINESET_FE_AND, "AND", 0, "Logical AND",
"Combine feature edge type conditions by logical AND (logical conjunction)"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem group_negation_items[] = {
{0, "INCLUSIVE", 0, "Inclusive", "Select feature edges belonging to some object in the group"},
{FREESTYLE_LINESET_GR_NOT, "EXCLUSIVE", 0, "Exclusive", "Select feature edges not belonging to any object in the group"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_LINESET_GR_NOT, "EXCLUSIVE", 0, "Exclusive",
"Select feature edges not belonging to any object in the group"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem face_mark_negation_items[] = {
{0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given face mark conditions"},
{FREESTYLE_LINESET_FM_NOT, "EXCLUSIVE", 0, "Exclusive", "Select feature edges not satisfying the given face mark conditions"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_LINESET_FM_NOT, "EXCLUSIVE", 0, "Exclusive",
"Select feature edges not satisfying the given face mark conditions"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem face_mark_condition_items[] = {
{0, "ONE", 0, "One Face", "Select feature edges if one of faces on the right and left has a face mark"},
{FREESTYLE_LINESET_FM_BOTH, "BOTH", 0, "Both Faces", "Select feature edges if both faces on the right and left faces have a face mark"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_LINESET_FM_BOTH, "BOTH", 0, "Both Faces",
"Select feature edges if both faces on the right and left faces have a face mark"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem freestyle_ui_mode_items[] = {
{FREESTYLE_CONTROL_SCRIPT_MODE, "SCRIPT", 0, "Python Scripting Mode", "Advanced mode for using style modules in Python"},
{FREESTYLE_CONTROL_EDITOR_MODE, "EDITOR", 0, "Parameter Editor Mode", "Basic mode for interactive style parameter editing"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_CONTROL_SCRIPT_MODE, "SCRIPT", 0, "Python Scripting Mode",
"Advanced mode for using style modules in Python"},
{FREESTYLE_CONTROL_EDITOR_MODE, "EDITOR", 0, "Parameter Editor Mode",
"Basic mode for interactive style parameter editing"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem visibility_items[] ={
{FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges"},
{FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges"},
{FREESTYLE_QI_RANGE, "RANGE", 0, "QI Range", "Select feature edges within a range of quantitative invisibility (QI) values"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_QI_RANGE, "RANGE", 0, "QI Range",
"Select feature edges within a range of quantitative invisibility (QI) values"},
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem freestyle_raycasting_algorithm_items[] = {
{FREESTYLE_ALGO_REGULAR, "REGULAR", 0, "Normal Ray Casting", "Consider all FEdges in each ViewEdge"},
{FREESTYLE_ALGO_FAST, "FAST", 0, "Fast Ray Casting", "Sample some FEdges in each ViewEdge"},
{FREESTYLE_ALGO_VERYFAST, "VERYFAST", 0, "Very Fast Ray Casting", "Sample one FEdge in each ViewEdge; do not save list of occluders"},
{FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL, "CULLEDADAPTIVETRADITIONAL", 0, "Culled Traditional Visibility Detection", "Culled adaptive grid with heuristic density and traditional QI calculation"},
{FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL, "ADAPTIVETRADITIONAL", 0, "Unculled Traditional Visibility Detection", "Adaptive grid with heuristic density and traditional QI calculation"},
{FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE, "CULLEDADAPTIVECUMULATIVE", 0, "Culled Cumulative Visibility Detection", "Culled adaptive grid with heuristic density and cumulative QI calculation"},
{FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE, "ADAPTIVECUMULATIVE", 0, "Unculled Cumulative Visibility Detection", "Adaptive grid with heuristic density and cumulative QI calculation"},
{0, NULL, 0, NULL, NULL}};
{FREESTYLE_ALGO_VERYFAST, "VERYFAST", 0, "Very Fast Ray Casting",
"Sample one FEdge in each ViewEdge; do not save list of occluders"},
{FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL, "CULLEDADAPTIVETRADITIONAL", 0,
"Culled Traditional Visibility Detection",
"Culled adaptive grid with heuristic density and "
"traditional QI calculation"},
{FREESTYLE_ALGO_ADAPTIVE_TRADITIONAL, "ADAPTIVETRADITIONAL", 0, "Unculled Traditional Visibility Detection",
"Adaptive grid with heuristic density and traditional QI calculation"},
{FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE, "CULLEDADAPTIVECUMULATIVE", 0,
"Culled Cumulative Visibility Detection",
"Culled adaptive grid with heuristic density and "
"cumulative QI calculation"},
{FREESTYLE_ALGO_ADAPTIVE_CUMULATIVE, "ADAPTIVECUMULATIVE", 0, "Unculled Cumulative Visibility Detection",
"Adaptive grid with heuristic density and cumulative QI calculation"},
{0, NULL, 0, NULL, NULL}
};
/* FreestyleLineSet */
@@ -2407,12 +2437,14 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
srna = RNA_def_struct(brna, "FreestyleLineSet", NULL);
RNA_def_struct_ui_text(srna, "Freestyle Line Set", "Line set for associating lines and style parameters");
/* access to line style settings is redirected through functions */
/* to allow proper id-buttons functionality */
/* access to line style settings is redirected through functions
* to allow proper id-buttons functionality
*/
prop = RNA_def_property(srna, "linestyle", PROP_POINTER, PROP_NONE);
RNA_def_property_struct_type(prop, "FreestyleLineStyle");
RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL);
RNA_def_property_pointer_funcs(prop, "rna_FreestyleLineSet_linestyle_get", "rna_FreestyleLineSet_linestyle_set", NULL, NULL);
RNA_def_property_pointer_funcs(prop, "rna_FreestyleLineSet_linestyle_get",
"rna_FreestyleLineSet_linestyle_set", NULL, NULL);
RNA_def_property_ui_text(prop, "Line Style", "Line style settings");
RNA_def_property_update(prop, NC_SCENE, NULL);
@@ -2444,7 +2476,8 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "select_by_image_border", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "selection", FREESTYLE_SEL_IMAGE_BORDER);
RNA_def_property_ui_text(prop, "Selection by Image Border", "Select feature edges by image border (less memory consumption)");
RNA_def_property_ui_text(prop, "Selection by Image Border",
"Select feature edges by image border (less memory consumption)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "select_by_face_marks", PROP_BOOLEAN, PROP_NONE);
@@ -2455,13 +2488,15 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "edge_type_negation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
RNA_def_property_enum_items(prop, edge_type_negation_items);
RNA_def_property_ui_text(prop, "Edge Type Negation", "Set the negation operation for conditions on feature edge types");
RNA_def_property_ui_text(prop, "Edge Type Negation",
"Set the negation operation for conditions on feature edge types");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "edge_type_combination", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
RNA_def_property_enum_items(prop, edge_type_combination_items);
RNA_def_property_ui_text(prop, "Edge Type Combination", "Set the combination operation for conditions on feature edge types");
RNA_def_property_ui_text(prop, "Edge Type Combination",
"Set the combination operation for conditions on feature edge types");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE);
@@ -2474,13 +2509,15 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "group_negation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
RNA_def_property_enum_items(prop, group_negation_items);
RNA_def_property_ui_text(prop, "Group Negation", "Set the negation operation for conditions on feature edge types");
RNA_def_property_ui_text(prop, "Group Negation",
"Set the negation operation for conditions on feature edge types");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "face_mark_negation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
RNA_def_property_enum_items(prop, face_mark_negation_items);
RNA_def_property_ui_text(prop, "Face Mark Negation", "Set the negation operation for the condition on face marks");
RNA_def_property_ui_text(prop, "Face Mark Negation",
"Set the negation operation for the condition on face marks");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "face_mark_condition", PROP_ENUM, PROP_NONE);
@@ -2673,7 +2710,8 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_advanced_options", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_ADVANCED_OPTIONS_FLAG);
RNA_def_property_ui_text(prop, "Advanced Edge Detection Options", "Enable advanced edge detection options (sphere radius and Kr derivative epsilon)");
RNA_def_property_ui_text(prop, "Advanced Edge Detection Options",
"Enable advanced edge detection options (sphere radius and Kr derivative epsilon)");
RNA_def_property_update(prop, NC_SCENE, NULL);
prop = RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
@@ -3818,7 +3856,9 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
static EnumPropertyItem freestyle_thickness_items[] = {
{R_LINE_THICKNESS_ABSOLUTE, "ABSOLUTE", 0, "Absolute", "Specify unit line thickness in pixels"},
{R_LINE_THICKNESS_RELATIVE, "RELATIVE", 0, "Relative", "Unit line thickness is scaled by the proportion of the present vertical image resolution to 480 pixels"},
{R_LINE_THICKNESS_RELATIVE, "RELATIVE", 0, "Relative",
"Unit line thickness is scaled by the proportion of the present vertical image "
"resolution to 480 pixels"},
{0, NULL, 0, NULL, NULL}};
rna_def_scene_ffmpeg_settings(brna);