Pre-merger changes.

Deprecated Freestyle-specific elements were removed from the code base,
in order to address all comments from branch code reviews.
https://codereview.appspot.com/7416049/

Backward compatibility won't be maintained in the following components:

- Freestyle edge/face marks in old .blend files are ignored.

Old .blend files can be converted by loading and saving the files using
a Freestyle branch build between revision 55581 and 55842.

- External style modules are no longer supported.

Instead text datablocks must be used to keep style module files within
.blend files.  A branch build between revision 55741 and 55842 is useful
for identifying the style module file names that need reconfiguring.
This commit is contained in:
Tamito Kajiyama 2013-04-06 14:45:50 +00:00
commit 4c16d3e231
8 changed files with 0 additions and 152 deletions

@ -580,19 +580,6 @@ void BKE_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
}
SEQ_END
}
/* TODO, keep this or not? - campbell */
#if 0
{
SceneRenderLayer *srl = scene->r.layers.first;
for(; srl; srl = srl->next) {
FreestyleModuleConfig *module = srl->freestyleConfig.modules.first;
for (; module; module = module->next) {
rewrite_path_fixed(module->module_path, visit_cb, absbase, bpath_user_data);
}
}
}
#endif
break;
}
case ID_ME:

@ -9329,81 +9329,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
linestyle->rounds = 3;
}
}
/* The code segment below will be removed when the trunk merger is done.
For now it is kept for backward compatibility, giving branch users time
to migrate to the new CustomData-based edge/face marks. */
{
Scene *sce;
SceneRenderLayer *srl;
FreestyleModuleConfig *fmc;
Mesh *me;
MEdge *medge;
MPoly *mpoly;
int i, found;
for (me = main->mesh.first; me; me = me->id.next) {
/* Freestyle edge marks */
found = 0;
medge = me->medge;
for (i = 0; i < me->totedge; i++) {
if (medge->flag & ME_FREESTYLE_EDGE) {
found = 1;
break;
}
medge++;
}
if (found) {
FreestyleEdge *fed = CustomData_add_layer(&me->edata, CD_FREESTYLE_EDGE, CD_CALLOC, NULL, me->totedge);
medge = me->medge;
for (i = 0; i < me->totedge; i++) {
if (medge->flag & ME_FREESTYLE_EDGE) {
medge->flag &= ~ME_FREESTYLE_EDGE;
fed->flag |= FREESTYLE_EDGE_MARK;
}
medge++;
fed++;
}
printf("Migrated to CustomData-based Freestyle edge marks\n");
}
/* Freestyle face marks */
found = 0;
mpoly = me->mpoly;
for (i = 0; i < me->totpoly; i++) {
if (mpoly->flag & ME_FREESTYLE_FACE) {
found = 1;
break;
}
mpoly++;
}
if (found) {
FreestyleFace *ffa = CustomData_add_layer(&me->pdata, CD_FREESTYLE_FACE, CD_CALLOC, NULL, me->totpoly);
mpoly = me->mpoly;
for (i = 0; i < me->totpoly; i++) {
if (mpoly->flag & ME_FREESTYLE_FACE) {
mpoly->flag &= ~ME_FREESTYLE_FACE;
ffa->flag |= FREESTYLE_FACE_MARK;
}
mpoly++;
ffa++;
}
printf("Migrated to CustomData-based Freestyle face marks\n");
}
}
for (sce = main->scene.first; sce; sce = sce->id.next) {
for (srl = sce->r.layers.first; srl; srl = srl->next) {
i = 1;
for (fmc = srl->freestyleConfig.modules.first; fmc; fmc = fmc->next) {
if (fmc->module_path[0] != '\0' && !fmc->script) {
fprintf(stderr, "The external style module below needs to be reconfigured using text datablock:\n");
fprintf(stderr, " %s\n", fmc->module_path);
fprintf(stderr, " in scene \"%s\", render layer \"%s\", style module #%d (%s)\n",
sce->id.name+2, srl->name, i, (fmc->is_displayed) ? "enabled" : "disabled");
}
i++;
}
}
}
}
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init see do_versions_userdef() above! */

@ -28,7 +28,6 @@
#ifndef __DNA_FREESTYLE_TYPES_H__
#define __DNA_FREESTYLE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_listBase.h"
struct FreestyleLineStyle;
@ -111,7 +110,6 @@ typedef struct FreestyleModuleConfig {
struct FreestyleModuleConfig *next, *prev;
struct Text *script;
char module_path[1024] DNA_DEPRECATED; /* FILE_MAX */
short is_displayed;
short pad[3];
} FreestyleModuleConfig;

@ -311,7 +311,6 @@ typedef struct FreestyleFace {
#define ME_LOOSEEDGE (1<<7)
/* #define ME_SEAM_LAST (1<<8) */ /* UNUSED */
#define ME_SHARP (1<<9) /* only reason this flag remains a 'short' */
#define ME_FREESTYLE_EDGE (1<<10) /* TO BE REMOVED when the trunk merger is done */
/* puno = vertexnormal (mface) */
#define ME_PROJXY 16
@ -328,7 +327,6 @@ typedef struct FreestyleFace {
/* flag (mface) */
#define ME_SMOOTH 1
#define ME_FACE_SEL 2
#define ME_FREESTYLE_FACE 4 /* TO BE REMOVED when the trunk merger is done */
/* flag ME_HIDE==16 is used here too */
#define ME_POLY_LOOP_PREV(mloop, mp, i) (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)])

@ -1581,13 +1581,6 @@ static void rna_def_medge(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
#ifdef WITH_FREESTYLE /* TO BE REMOVED when the trunk merger is done */
prop = RNA_def_property(srna, "use_freestyle_edge_mark", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FREESTYLE_EDGE);
RNA_def_property_ui_text(prop, "Freestyle Edge Mark", "Edge mark for Freestyle feature edge detection");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
#endif
prop = RNA_def_property(srna, "is_loose", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_LOOSEEDGE);
RNA_def_property_ui_text(prop, "Loose", "Loose edge");
@ -1644,13 +1637,6 @@ static void rna_def_mface(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Smooth", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
#ifdef WITH_FREESTYLE /* TO BE REMOVED when the trunk merger is done */
prop = RNA_def_property(srna, "use_freestyle_face_mark", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FREESTYLE_FACE);
RNA_def_property_ui_text(prop, "Freestyle Face Mark", "Face mark for Freestyle feature edge detection");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
#endif
prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1.0f, 1.0f);
@ -1748,11 +1734,6 @@ static void rna_def_mpolygon(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Smooth", "");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop = RNA_def_property(srna, "use_freestyle_face_mark", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FREESTYLE_FACE);
RNA_def_property_ui_text(prop, "Freestyle Face Mark", "Face mark for Freestyle feature edge detection");
RNA_def_property_update(prop, 0, "rna_Mesh_update_data");
prop = RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION);
RNA_def_property_array(prop, 3);
RNA_def_property_range(prop, -1.0f, 1.0f);

@ -2686,13 +2686,6 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Style Module", "Python script to define a style module");
RNA_def_property_update(prop, NC_SCENE, NULL);
#if 1 /* TO BE REMOVED when the trunk merger is done */
prop = RNA_def_property(srna, "module_path", PROP_STRING, PROP_FILEPATH);
RNA_def_property_string_sdna(prop, NULL, "module_path");
RNA_def_property_ui_text(prop, "Module Path", "Path to a style module file");
RNA_def_property_update(prop, NC_SCENE, NULL);
#endif
prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "is_displayed", 1);
RNA_def_property_ui_text(prop, "Use", "Enable or disable this style module during stroke rendering");

@ -161,19 +161,6 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
dm->copyPolyArray(dm, CDDM_get_polys(result));
}
#if 1 /* WITH_FREESTYLE generic changes */
/* if the source DM does not have edge/poly CD_ORIGINDEX layer, then
* the corresponding layer of the result DM is filled with zeros
* (see CDDM_from_template()) */
if (!CustomData_has_layer(&dm->edgeData, CD_ORIGINDEX)) {
range_vn_i(DM_get_edge_data_layer(result, CD_ORIGINDEX), maxEdges, 0);
}
if (!CustomData_has_layer(&dm->polyData, CD_ORIGINDEX)) {
DM_add_poly_layer(result, CD_ORIGINDEX, CD_CALLOC, NULL);
range_vn_i(DM_get_poly_data_layer(result, CD_ORIGINDEX), maxPolys, 0);
}
#endif
/* copy customdata to new geometry,
* copy from its self because this data may have been created in the checks above */
DM_copy_vert_data(result, result, 0, maxVerts, maxVerts);

@ -374,27 +374,6 @@ static DerivedMesh *applyModifier(
DM_copy_poly_data(dm, result, 0, 0, numFaces);
DM_copy_poly_data(dm, result, 0, numFaces, numFaces);
#if 1 /* WITH_FREESTYLE generic changes */
/* When the input DM has no edge CD_ORIGINDEX layer (i.e., the corresponding
* layer of the result DM is filled with zeros; see CDDM_from_template()),
* set the layer to an identity mapping */
if (!CustomData_has_layer(&dm->edgeData, CD_ORIGINDEX)) {
int *index = DM_get_edge_data_layer(result, CD_ORIGINDEX);
range_vn_i(index, numEdges, 0);
range_vn_i(index+numEdges, numEdges, 0);
}
/* Do the same for poly CD_ORIGINDEX layer */
if (!CustomData_has_layer(&dm->polyData, CD_ORIGINDEX)) {
int *index, a;
DM_add_poly_layer(result, CD_ORIGINDEX, CD_CALLOC, NULL);
index = DM_get_poly_data_layer(result, CD_ORIGINDEX);
range_vn_i(index, numFaces, 0);
range_vn_i(index+numFaces, numFaces, 0);
for (a = 0; a < newFaces; a++)
index[numFaces*2+a] = ORIGINDEX_NONE;
}
#endif
/* if the original has it, get the result so we can update it */
face_nors_result = CustomData_get_layer(&result->polyData, CD_NORMAL);