6 * ***** BEGIN GPL LICENSE BLOCK *****
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
23 * All rights reserved.
25 * The Original Code is: all of this file.
27 * Contributor(s): none yet.
29 * ***** END GPL LICENSE BLOCK *****
45 #include "MEM_guardedalloc.h"
47 #include "DNA_anim_types.h"
48 #include "DNA_armature_types.h"
49 #include "DNA_color_types.h"
50 #include "DNA_constraint_types.h"
51 #include "DNA_curve_types.h"
52 #include "DNA_group_types.h"
53 #include "DNA_lamp_types.h"
54 #include "DNA_material_types.h"
55 #include "DNA_meta_types.h"
56 #include "DNA_object_types.h"
57 #include "DNA_scene_types.h"
58 #include "DNA_screen_types.h"
59 #include "DNA_texture_types.h"
60 #include "DNA_userdef_types.h"
62 #include "BKE_action.h"
64 #include "BKE_animsys.h"
65 #include "BKE_armature.h"
66 #include "BKE_colortools.h"
67 #include "BKE_colortools.h"
68 #include "BKE_constraint.h"
69 #include "BKE_depsgraph.h"
70 #include "BKE_global.h"
71 #include "BKE_group.h"
73 #include "BKE_idprop.h"
74 #include "BKE_image.h"
76 #include "BKE_library.h"
79 #include "BKE_object.h"
80 #include "BKE_paint.h"
81 #include "BKE_pointcache.h"
82 #include "BKE_scene.h"
83 #include "BKE_sequencer.h"
84 #include "BKE_world.h"
85 #include "BKE_utildefines.h"
87 //XXX #include "BIF_previewrender.h"
88 //XXX #include "BIF_editseq.h"
90 #ifndef DISABLE_PYTHON
91 #include "BPY_extern.h"
95 #include "BLI_blenlib.h"
97 //XXX #include "nla.h"
101 #include <sys/time.h>
104 void free_avicodecdata(AviCodecData *acd)
108 MEM_freeN(acd->lpFormat);
109 acd->lpFormat = NULL;
113 MEM_freeN(acd->lpParms);
120 void free_qtcodecdata(QuicktimeCodecData *qcd)
124 MEM_freeN(qcd->cdParms);
131 Scene *copy_scene(Main *bmain, Scene *sce, int type)
137 if(type == SCE_COPY_EMPTY) {
139 scen= add_scene(sce->id.name+2);
146 scen= copy_libblock(sce);
147 BLI_duplicatelist(&(scen->base), &(sce->base));
151 id_us_plus((ID *)scen->world);
152 id_us_plus((ID *)scen->set);
153 id_us_plus((ID *)scen->ima);
154 id_us_plus((ID *)scen->gm.dome.warptext);
159 scen->toolsettings= MEM_dupallocN(sce->toolsettings);
162 ts= scen->toolsettings;
165 ts->vpaint= MEM_dupallocN(ts->vpaint);
166 ts->vpaint->paintcursor= NULL;
167 ts->vpaint->vpaint_prev= NULL;
168 ts->vpaint->wpaint_prev= NULL;
169 copy_paint(&ts->vpaint->paint, &ts->vpaint->paint);
172 ts->wpaint= MEM_dupallocN(ts->wpaint);
173 ts->wpaint->paintcursor= NULL;
174 ts->wpaint->vpaint_prev= NULL;
175 ts->wpaint->wpaint_prev= NULL;
176 copy_paint(&ts->wpaint->paint, &ts->wpaint->paint);
179 ts->sculpt= MEM_dupallocN(ts->sculpt);
180 copy_paint(&ts->sculpt->paint, &ts->sculpt->paint);
183 copy_paint(&ts->imapaint.paint, &ts->imapaint.paint);
184 ts->imapaint.paintcursor= NULL;
186 ts->particle.paintcursor= NULL;
189 BLI_duplicatelist(&(scen->markers), &(sce->markers));
190 BLI_duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces));
191 BLI_duplicatelist(&(scen->r.layers), &(sce->r.layers));
192 BKE_keyingsets_copy(&(scen->keyingsets), &(sce->keyingsets));
194 scen->nodetree= ntreeCopyTree(sce->nodetree, 0);
196 obase= sce->base.first;
197 base= scen->base.first;
199 id_us_plus(&base->object->id);
200 if(obase==sce->basact) scen->basact= base;
207 /* make a private copy of the avicodecdata */
208 if(sce->r.avicodecdata) {
209 scen->r.avicodecdata = MEM_dupallocN(sce->r.avicodecdata);
210 scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat);
211 scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms);
214 /* make a private copy of the qtcodecdata */
215 if(sce->r.qtcodecdata) {
216 scen->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata);
217 scen->r.qtcodecdata->cdParms = MEM_dupallocN(scen->r.qtcodecdata->cdParms);
220 /* NOTE: part of SCE_COPY_LINK_DATA and SCE_COPY_FULL operations
221 * are done outside of blenkernel with ED_objects_single_users! */
224 if(type == SCE_COPY_LINK_DATA || type == SCE_COPY_FULL) {
225 ID_NEW(scen->camera);
229 if(type == SCE_COPY_FULL) {
231 id_us_plus((ID *)scen->world);
232 scen->world= copy_world(scen->world);
239 /* do not free scene itself */
240 void free_scene(Scene *sce)
244 base= sce->base.first;
246 base->object->id.us--;
249 /* do not free objects! */
256 BLI_freelistN(&sce->base);
257 seq_free_editing(sce);
259 BKE_free_animdata((ID *)sce);
260 BKE_keyingsets_free(&sce->keyingsets);
262 if (sce->r.avicodecdata) {
263 free_avicodecdata(sce->r.avicodecdata);
264 MEM_freeN(sce->r.avicodecdata);
265 sce->r.avicodecdata = NULL;
267 if (sce->r.qtcodecdata) {
268 free_qtcodecdata(sce->r.qtcodecdata);
269 MEM_freeN(sce->r.qtcodecdata);
270 sce->r.qtcodecdata = NULL;
272 if (sce->r.ffcodecdata.properties) {
273 IDP_FreeProperty(sce->r.ffcodecdata.properties);
274 MEM_freeN(sce->r.ffcodecdata.properties);
275 sce->r.ffcodecdata.properties = NULL;
278 BLI_freelistN(&sce->markers);
279 BLI_freelistN(&sce->transform_spaces);
280 BLI_freelistN(&sce->r.layers);
282 if(sce->toolsettings) {
283 if(sce->toolsettings->vpaint) {
284 free_paint(&sce->toolsettings->vpaint->paint);
285 MEM_freeN(sce->toolsettings->vpaint);
287 if(sce->toolsettings->wpaint) {
288 free_paint(&sce->toolsettings->wpaint->paint);
289 MEM_freeN(sce->toolsettings->wpaint);
291 if(sce->toolsettings->sculpt) {
292 free_paint(&sce->toolsettings->sculpt->paint);
293 MEM_freeN(sce->toolsettings->sculpt);
295 free_paint(&sce->toolsettings->imapaint.paint);
297 MEM_freeN(sce->toolsettings);
298 sce->toolsettings = NULL;
302 free_forest(sce->theDag);
303 MEM_freeN(sce->theDag);
307 ntreeFreeTree(sce->nodetree);
308 MEM_freeN(sce->nodetree);
312 MEM_freeN(sce->stats);
315 Scene *add_scene(char *name)
318 ParticleEditSettings *pset;
321 sce= alloc_libblock(&G.main->scene, ID_SCE, name);
324 sce->r.mode= R_GAMMA|R_OSA|R_SHADOW|R_SSS|R_ENVMAP|R_RAYTRACE;
328 sce->r.frame_step= 1;
338 sce->r.framapto= 100;
340 sce->r.framelen= 1.0;
342 sce->r.frs_sec_base= 1;
344 sce->r.color_mgt_flag |= R_COLOR_MANAGEMENT;
346 sce->r.bake_mode= 1; /* prevent to include render stuff here */
347 sce->r.bake_filter= 8;
349 sce->r.bake_flag= R_BAKE_CLEAR;
350 sce->r.bake_normal_space= R_BAKE_SPACE_TANGENT;
352 sce->r.scemode= R_DOCOMP|R_DOSEQ|R_EXTENSION;
353 sce->r.stamp= R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_SCENE|R_STAMP_CAMERA;
357 sce->r.simplify_subsurf= 6;
358 sce->r.simplify_particles= 1.0f;
359 sce->r.simplify_shadowsamples= 16;
360 sce->r.simplify_aosss= 1.0f;
362 sce->r.cineonblack= 95;
363 sce->r.cineonwhite= 685;
364 sce->r.cineongamma= 1.7f;
366 sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings),"Tool Settings Struct");
367 sce->toolsettings->cornertype=1;
368 sce->toolsettings->degr = 90;
369 sce->toolsettings->step = 9;
370 sce->toolsettings->turn = 1;
371 sce->toolsettings->extr_offs = 1;
372 sce->toolsettings->doublimit = 0.001;
373 sce->toolsettings->segments = 32;
374 sce->toolsettings->rings = 32;
375 sce->toolsettings->vertices = 32;
376 sce->toolsettings->editbutflag = 1;
377 sce->toolsettings->uvcalc_radius = 1.0f;
378 sce->toolsettings->uvcalc_cubesize = 1.0f;
379 sce->toolsettings->uvcalc_mapdir = 1;
380 sce->toolsettings->uvcalc_mapalign = 1;
381 sce->toolsettings->unwrapper = 1;
382 sce->toolsettings->select_thresh= 0.01f;
383 sce->toolsettings->jointrilimit = 0.8f;
385 sce->toolsettings->selectmode= SCE_SELECT_VERTEX;
386 sce->toolsettings->normalsize= 0.1;
387 sce->toolsettings->autokey_mode= U.autokey_mode;
389 sce->toolsettings->skgen_resolution = 100;
390 sce->toolsettings->skgen_threshold_internal = 0.01f;
391 sce->toolsettings->skgen_threshold_external = 0.01f;
392 sce->toolsettings->skgen_angle_limit = 45.0f;
393 sce->toolsettings->skgen_length_ratio = 1.3f;
394 sce->toolsettings->skgen_length_limit = 1.5f;
395 sce->toolsettings->skgen_correlation_limit = 0.98f;
396 sce->toolsettings->skgen_symmetry_limit = 0.1f;
397 sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
398 sce->toolsettings->skgen_postpro_passes = 1;
399 sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL|SKGEN_FILTER_EXTERNAL|SKGEN_FILTER_SMART|SKGEN_HARMONIC|SKGEN_SUB_CORRELATION|SKGEN_STICK_TO_EMBEDDING;
400 sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
401 sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
402 sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
404 sce->toolsettings->proportional_size = 1.0f;
406 sce->physics_settings.gravity[0] = 0.0f;
407 sce->physics_settings.gravity[1] = 0.0f;
408 sce->physics_settings.gravity[2] = -9.81f;
409 sce->physics_settings.flag = PHYS_GLOBAL_GRAVITY;
411 sce->unit.scale_length = 1.0f;
413 pset= &sce->toolsettings->particle;
414 pset->flag= PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER|PE_AUTO_VELOCITY;
415 pset->emitterdist= 0.25f;
418 pset->brushtype= PE_BRUSH_NONE;
420 pset->fade_frames= 2;
421 pset->selectmode= SCE_SELECT_PATH;
422 for(a=0; a<PE_TOT_BRUSH; a++) {
423 pset->brush[a].strength= 50;
424 pset->brush[a].size= 50;
425 pset->brush[a].step= 10;
427 pset->brush[PE_BRUSH_CUT].strength= 100;
430 sce->r.ffcodecdata.audio_mixrate = 44100;
432 sce->audio.distance_model = 2.0;
433 sce->audio.doppler_factor = 1.0;
434 sce->audio.speed_of_sound = 343.3;
436 strcpy(sce->r.backbuf, "//backbuf");
437 strcpy(sce->r.pic, U.renderdir);
439 BLI_init_rctf(&sce->r.safety, 0.1f, 0.9f, 0.1f, 0.9f);
442 /* note; in header_info.c the scene copy happens..., if you add more to renderdata it has to be checked there */
443 scene_add_render_layer(sce);
446 sce->gm.stereoflag = STEREO_NOSTEREO;
447 sce->gm.stereomode = STEREO_ANAGLYPH;
448 sce->gm.dome.angle = 180;
449 sce->gm.dome.mode = DOME_FISHEYE;
450 sce->gm.dome.res = 4;
451 sce->gm.dome.resbuf = 1.0f;
452 sce->gm.dome.tilt = 0;
456 sce->gm.freqplay= 60;
459 sce->gm.gravity= 9.8f;
460 sce->gm.physicsEngine= WOPHY_BULLET;
461 sce->gm.mode = 32; //XXX ugly harcoding, still not sure we should drop mode. 32 == 1 << 5 == use_occlusion_culling
462 sce->gm.occlusionRes = 128;
463 sce->gm.ticrate = 60;
464 sce->gm.maxlogicstep = 5;
465 sce->gm.physubstep = 1;
466 sce->gm.maxphystep = 5;
468 sce->gm.flag = GAME_DISPLAY_LISTS;
469 sce->gm.matmode = GAME_MAT_MULTITEX;
474 Base *object_in_scene(Object *ob, Scene *sce)
478 base= sce->base.first;
480 if(base->object == ob) return base;
486 void set_scene_bg(Scene *scene)
495 /* check for cyclic sets, for reading old files but also for definite security (py?) */
496 scene_check_setscene(scene);
498 /* deselect objects (for dataselect) */
499 for(ob= G.main->object.first; ob; ob= ob->id.next)
500 ob->flag &= ~(SELECT|OB_FROMGROUP);
502 /* group flags again */
503 for(group= G.main->group.first; group; group= group->id.next) {
504 go= group->gobject.first;
506 if(go->ob) go->ob->flag |= OB_FROMGROUP;
512 DAG_scene_sort(scene);
514 /* ensure dags are built for sets */
515 for(sce= scene->set; sce; sce= sce->set)
516 if(sce->theDag==NULL)
519 /* copy layers and flags from bases to objects */
520 for(base= scene->base.first; base; base= base->next) {
525 base->flag &= ~(OB_FROMGROUP);
526 flag= ob->flag & (OB_FROMGROUP);
529 /* not too nice... for recovering objects with lost data */
530 //if(ob->pose==NULL) base->flag &= ~OB_POSEMODE;
531 ob->flag= base->flag;
533 ob->ctime= -1234567.0; /* force ipo to be calculated later */
535 /* no full animation update, this to enable render code to work (render code calls own animation updates) */
538 /* called from creator.c */
539 void set_scene_name(char *name)
543 for (sce= G.main->scene.first; sce; sce= sce->id.next) {
544 if (BLI_streq(name, sce->id.name+2)) {
550 //XXX error("Can't find scene: %s", name);
553 void unlink_scene(Main *bmain, Scene *sce, Scene *newsce)
559 for(sce1= bmain->scene.first; sce1; sce1= sce1->id.next)
563 /* check all sequences */
564 clear_scene_in_allseqs(sce);
566 /* check render layer nodes in other scenes */
567 clear_scene_in_nodes(bmain, sce);
570 for(sc= bmain->screen.first; sc; sc= sc->id.next)
574 free_libblock(&bmain->scene, sce);
578 * doesnt return the original duplicated object, only dupli's
580 int next_object(Scene *scene, int val, Base **base, Object **ob)
582 static ListBase *duplilist= NULL;
583 static DupliObject *dupob;
584 static int fase= F_START, in_next_object= 0;
592 /* XXX particle systems with metas+dupligroups call this recursively */
595 printf("ERROR: MetaBall generation called recursively, not supported\n");
603 /* run_again is set when a duplilist has been ended */
609 *base= scene->base.first;
611 *ob= (*base)->object;
615 /* exception: empty scene */
616 if(scene->set && scene->set->base.first) {
617 *base= scene->set->base.first;
618 *ob= (*base)->object;
624 if(*base && fase!=F_DUPLI) {
625 *base= (*base)->next;
626 if(*base) *ob= (*base)->object;
629 /* scene is finished, now do the set */
630 if(scene->set && scene->set->base.first) {
631 *base= scene->set->base.first;
632 *ob= (*base)->object;
640 if(*base == NULL) fase= F_START;
643 if( (*base)->object->transflag & OB_DUPLI) {
644 /* groups cannot be duplicated for mballs yet,
645 this enters eternal loop because of
646 makeDispListMBall getting called inside of group_duplilist */
647 if((*base)->object->dup_group == NULL) {
648 duplilist= object_duplilist(scene, (*base)->object);
650 dupob= duplilist->first;
653 free_object_duplilist(duplilist);
660 copy_m4_m4(dupob->ob->obmat, dupob->mat);
662 (*base)->flag |= OB_FROMDUPLI;
668 else if(fase==F_DUPLI) {
670 (*base)->flag &= ~OB_FROMDUPLI;
672 for(dupob= duplilist->first; dupob; dupob= dupob->next) {
673 copy_m4_m4(dupob->ob->obmat, dupob->omat);
676 free_object_duplilist(duplilist);
684 /* reset recursion test */
690 Object *scene_find_camera(Scene *sc)
694 for (base= sc->base.first; base; base= base->next)
695 if (base->object->type==OB_CAMERA)
701 #ifdef DURIAN_CAMERA_SWITCH
702 Object *scene_find_camera_switch(Scene *scene)
705 int cfra = scene->r.cfra;
706 int frame = -(MAXFRAME + 1);
707 Object *camera= NULL;
709 for (m= scene->markers.first; m; m= m->next) {
710 if(m->camera && (m->frame <= cfra) && (m->frame > frame)) {
723 static char *get_cfra_marker_name(Scene *scene)
725 ListBase *markers= &scene->markers;
728 /* search through markers for match */
729 for (m1=markers->first, m2=markers->last; m1 && m2; m1=m1->next, m2=m2->prev) {
743 Base *scene_add_base(Scene *sce, Object *ob)
745 Base *b= MEM_callocN(sizeof(*b), "scene_add_base");
746 BLI_addhead(&sce->base, b);
755 void scene_deselect_all(Scene *sce)
759 for (b= sce->base.first; b; b= b->next) {
761 b->object->flag= b->flag;
765 void scene_select_base(Scene *sce, Base *selbase)
767 scene_deselect_all(sce);
769 selbase->flag |= SELECT;
770 selbase->object->flag= selbase->flag;
772 sce->basact= selbase;
775 /* checks for cycle, returns 1 if it's all OK */
776 int scene_check_setscene(Scene *sce)
781 if(sce->set==NULL) return 1;
784 for(scene= G.main->scene.first; scene; scene= scene->id.next)
787 for(a=0, scene=sce; scene->set; scene=scene->set, a++) {
788 /* more iterations than scenes means we have a cycle */
790 /* the tested scene gets zero'ed, that's typically current scene */
799 /* This (evil) function is needed to cope with two legacy Blender rendering features
800 * mblur (motion blur that renders 'subframes' and blurs them together), and fields
801 * rendering. Thus, the use of ugly globals from object.c
803 // BAD... EVIL... JUJU...!!!!
804 // XXX moved here temporarily
805 float frame_to_float (Scene *scene, int cfra) /* see also bsystem_time in object.c */
807 extern float bluroffs; /* bad stuff borrowed from object.c */
808 extern float fieldoffs;
812 ctime+= bluroffs+fieldoffs;
813 ctime*= scene->r.framelen;
818 static void scene_update_newframe(Scene *sce, unsigned int lay)
822 float ctime = frame_to_float(sce, sce->r.cfra);
824 if(sce->theDag==NULL)
827 DAG_scene_update_flags(sce, lay); // only stuff that moves or needs display still
829 /* All 'standard' (i.e. without any dependencies) animation is handled here,
830 * with an 'local' to 'macro' order of evaluation. This should ensure that
831 * settings stored nestled within a hierarchy (i.e. settings in a Texture block
832 * can be overridden by settings from Scene, which owns the Texture through a hierarchy
833 * such as Scene->World->MTex/Texture) can still get correctly overridden.
835 BKE_animsys_evaluate_all_animation(G.main, ctime);
837 for(base= sce->base.first; base; base= base->next) {
840 object_handle_update(sce, ob); // bke_object.h
842 /* only update layer when an ipo */
843 // XXX old animation system
844 //if(ob->ipo && has_ipo_code(ob->ipo, OB_LAY) ) {
845 // base->lay= ob->lay;
850 /* this is called in main loop, doing tagged updates before redraw */
851 void scene_update_tagged(Scene *scene)
855 float ctime = frame_to_float(scene, scene->r.cfra);
857 /* update all objects: drivers, matrices, displists, etc. flags set
858 by depgraph or manual, no layer check here, gets correct flushed */
860 /* sets first, we allow per definition current scene to have
861 dependencies on sets, but not the other way around. */
863 for(SETLOOPER(scene->set, base))
864 object_handle_update(scene, base->object);
867 for(base= scene->base.first; base; base= base->next) {
868 object_handle_update(scene, base->object);
871 /* recalc scene animation data here (for sequencer) */
873 AnimData *adt= BKE_animdata_from_id(&scene->id);
875 if(adt && (adt->recalc & ADT_RECALC_ANIM))
876 BKE_animsys_evaluate_animdata(&scene->id, adt, ctime, 0);
879 BKE_ptcache_quick_cache_all(scene);
881 /* in the future this should handle updates for all datablocks, not
882 only objects and scenes. - brecht */
885 /* applies changes right away, does all sets too */
886 void scene_update_for_newframe(Scene *sce, unsigned int lay)
890 /* clear animation overrides */
893 /* sets first, we allow per definition current scene to have dependencies on sets */
894 for(sce= sce->set; sce; sce= sce->set)
895 scene_update_newframe(sce, lay);
897 scene_update_newframe(scene, lay);
900 /* return default layer, also used to patch old files */
901 void scene_add_render_layer(Scene *sce)
903 SceneRenderLayer *srl;
904 // int tot= 1 + BLI_countlist(&sce->r.layers);
906 srl= MEM_callocN(sizeof(SceneRenderLayer), "new render layer");
907 sprintf(srl->name, "RenderLayer");
908 BLI_uniquename(&sce->r.layers, srl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), 32);
909 BLI_addtail(&sce->r.layers, srl);
911 /* note, this is also in render, pipeline.c, to make layer when scenedata doesnt have it */
912 srl->lay= (1<<20) -1;
913 srl->layflag= 0x7FFF; /* solid ztra halo edge strand */
914 srl->passflag= SCE_PASS_COMBINED|SCE_PASS_Z;
917 /* render simplification */
919 int get_render_subsurf_level(RenderData *r, int lvl)
921 if(G.rt == 1 && (r->mode & R_SIMPLIFY))
922 return MIN2(r->simplify_subsurf, lvl);
927 int get_render_child_particle_number(RenderData *r, int num)
929 if(G.rt == 1 && (r->mode & R_SIMPLIFY))
930 return (int)(r->simplify_particles*num);
935 int get_render_shadow_samples(RenderData *r, int samples)
937 if(G.rt == 1 && (r->mode & R_SIMPLIFY) && samples > 0)
938 return MIN2(r->simplify_shadowsamples, samples);
943 float get_render_aosss_error(RenderData *r, float error)
945 if(G.rt == 1 && (r->mode & R_SIMPLIFY))
946 return ((1.0f-r->simplify_aosss)*10.0f + 1.0f)*error;