srl->lay= (1<<20) -1;
srl->layflag= 0x7FFF; /* solid ztra halo edge strand */
srl->passflag= SCE_PASS_COMBINED|SCE_PASS_Z;
+ FRS_add_freestyle_config( srl );
+
+ return srl;
+ }
+
+ int scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl)
+ {
+ const int act= BLI_findindex(&scene->r.layers, srl);
+ Scene *sce;
+
+ if (act == -1) {
+ return 0;
+ }
+ else if ( (scene->r.layers.first == scene->r.layers.last) &&
+ (scene->r.layers.first == srl))
+ {
+ /* ensure 1 layer is kept */
+ return 0;
+ }
+
+ BLI_remlink(&scene->r.layers, srl);
+ MEM_freeN(srl);
+
+ scene->r.actlay= 0;
+
+ for(sce = bmain->scene.first; sce; sce = sce->id.next) {
+ if(sce->nodetree) {
+ bNode *node;
+ for(node = sce->nodetree->nodes.first; node; node = node->next) {
+ if(node->type==CMP_NODE_R_LAYERS && (Scene*)node->id==scene) {
+ if(node->custom1==act)
+ node->custom1= 0;
+ else if(node->custom1>act)
+ node->custom1--;
+ }
+ }
+ }
+ }
+
+ return 1;
}
/* render simplification */
}
}
+ /* put compatibility code here until next subversion bump */
+ {
+ }
+
+ /* default values in Freestyle settings */
+ {
+ Scene *sce;
+ SceneRenderLayer *srl;
+ FreestyleLineStyle *linestyle;
+
+ for(sce = main->scene.first; sce; sce = sce->id.next) {
+ for(srl= sce->r.layers.first; srl; srl= srl->next) {
+ if (srl->freestyleConfig.mode == 0)
+ srl->freestyleConfig.mode= FREESTYLE_CONTROL_EDITOR_MODE;
+ if (srl->freestyleConfig.raycasting_algorithm == 0)
+ srl->freestyleConfig.raycasting_algorithm= FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE;
+ }
+ }
+ for(linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+ if (linestyle->chaining == 0)
+ linestyle->chaining= LS_CHAINING_PLAIN;
+ if (linestyle->rounds == 0)
+ linestyle->rounds= 3;
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
}
}
+ if (bmain->versionfile < 260 || (bmain->versionfile == 260 && bmain->subversionfile < 5)) {
+ bTheme *btheme;
+
+ for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ SETCOL(btheme->tui.panel.header, 0, 0, 0, 25);
+ btheme->tui.icon_alpha= 1.0;
+ }
+ }
+
+ /* Freestyle color settings */
+ {
+ bTheme *btheme;
+
+ for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ /* check for alpha==0 is safe, then color was never set */
+ if(btheme->tv3d.freestyle_edge_mark[3]==0) {
+ SETCOL(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
+ SETCOL(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
+ }
+ }
+ }
+
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
U.texcollectrate = 60;
G.rendering= 0;
}
- static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, const char *name_override)
+void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene)
+{
+ re->result_ok= 0;
+ if(render_initialize_from_main(re, bmain, scene, NULL, NULL, scene->lay, 0, 0)) {
+ do_render_fields_blur_3d(re);
+ }
+ re->result_ok= 1;
+}
+
+ static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const char *name_override)
{
char name[FILE_MAX];
RenderResult rres;