- Added panel for Bake render (tabbed now in 'anim' panel).
(Empty space will get OSA options, that I add tomorrow or so) - Removed a lot of old unused variables in renderdata. Also meant I had to remove this from python API... please check if this gives valid scripts? - Cleaned up bad formatted code for FFMPG buttons (spaces instead of tabs)
This commit is contained in:
@@ -44,7 +44,7 @@ struct ListBase;
|
||||
struct MemFile;
|
||||
|
||||
#define BLENDER_VERSION 242
|
||||
#define BLENDER_SUBVERSION 3
|
||||
#define BLENDER_SUBVERSION 4
|
||||
|
||||
#define BLENDER_MINVERSION 240
|
||||
#define BLENDER_MINSUBVERSION 0
|
||||
|
||||
@@ -198,20 +198,16 @@ Scene *add_scene(char *name)
|
||||
sce->r.framelen= 1.0;
|
||||
sce->r.frs_sec= 25;
|
||||
|
||||
sce->r.postgamma= 1.0;
|
||||
sce->r.postsat= 1.0;
|
||||
sce->r.postmul= 1.0;
|
||||
|
||||
sce->r.focus= 0.9;
|
||||
sce->r.zgamma= 1.0;
|
||||
sce->r.zsigma= 4.0;
|
||||
sce->r.zblur= 10.0;
|
||||
sce->r.zmin= 0.8;
|
||||
sce->r.bake_mode= 1; /* prevent to include render stuff here */
|
||||
sce->r.bake_filter= 2;
|
||||
sce->r.bake_osa= 5;
|
||||
sce->r.bake_flag= R_BAKE_CLEAR;
|
||||
|
||||
sce->r.xplay= 640;
|
||||
sce->r.yplay= 480;
|
||||
sce->r.freqplay= 60;
|
||||
sce->r.depth= 32;
|
||||
|
||||
sce->r.threads= 1;
|
||||
|
||||
sce->r.stereomode = 1; // no stereo
|
||||
|
||||
@@ -4875,16 +4875,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
/* have to check the exact multiplier */
|
||||
}
|
||||
|
||||
if(main->versionfile <= 210) {
|
||||
Scene *sce= main->scene.first;
|
||||
|
||||
while(sce) {
|
||||
if(sce->r.postmul== 0.0) sce->r.postmul= 1.0;
|
||||
if(sce->r.postgamma== 0.0) sce->r.postgamma= 1.0;
|
||||
sce= sce->id.next;
|
||||
}
|
||||
}
|
||||
|
||||
if(main->versionfile <= 211) {
|
||||
/* Render setting: per scene, the applicable gamma value
|
||||
* can be set. Default is 1.0, which means no
|
||||
@@ -4892,11 +4882,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
bActuator *act;
|
||||
bObjectActuator *oa;
|
||||
Object *ob;
|
||||
Scene *sce= main->scene.first;
|
||||
while(sce) {
|
||||
sce->r.gamma = 2.0;
|
||||
sce= sce->id.next;
|
||||
}
|
||||
|
||||
/* added alpha in obcolor */
|
||||
ob= main->object.first;
|
||||
@@ -5636,7 +5621,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
tex= tex->id.next;
|
||||
}
|
||||
while(sce) {
|
||||
sce->r.postsat= 1.0;
|
||||
ed= sce->ed;
|
||||
if(ed) {
|
||||
WHILE_SEQ(&ed->seqbase) {
|
||||
@@ -5656,16 +5640,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
bScreen *sc;
|
||||
|
||||
while(sce) {
|
||||
|
||||
if(sce->r.postsat==0.0) sce->r.postsat= 1.0f;
|
||||
|
||||
if(sce->r.zgamma==0.0) {
|
||||
sce->r.focus= 0.9f;
|
||||
sce->r.zgamma= 1.0f;
|
||||
sce->r.zsigma= 4.0f;
|
||||
sce->r.zblur= 10.0f;
|
||||
sce->r.zmin= 0.8f;
|
||||
}
|
||||
if(sce->editbutsize==0.0) sce->editbutsize= 0.1f;
|
||||
|
||||
sce= sce->id.next;
|
||||
@@ -6364,7 +6338,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
||||
}
|
||||
|
||||
/* improved triangle to quad conversion settings */
|
||||
for(sce= main->scene.first; sce; sce=sce->id.next) sce->toolsettings->jointrilimit = 0.8f;
|
||||
for(sce= main->scene.first; sce; sce=sce->id.next)
|
||||
sce->toolsettings->jointrilimit = 0.8f;
|
||||
}
|
||||
|
||||
if(main->subversionfile < 4) {
|
||||
for(sce= main->scene.first; sce; sce= sce->id.next) {
|
||||
sce->r.bake_mode= 1; /* prevent to include render stuff here */
|
||||
sce->r.bake_filter= 2;
|
||||
sce->r.bake_osa= 5;
|
||||
sce->r.bake_flag= R_BAKE_CLEAR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ struct EditVert;
|
||||
extern int join_mesh(void);
|
||||
|
||||
extern void sort_faces(void);
|
||||
extern void objects_bake_render(void);
|
||||
extern void objects_bake_render(int use_menu);
|
||||
|
||||
extern long mesh_octree_table(struct Object *ob, float *co, char mode);
|
||||
extern int mesh_get_x_mirror_vert(struct Object *ob, int index);
|
||||
|
||||
@@ -157,13 +157,14 @@ typedef struct SceneRenderLayer {
|
||||
|
||||
|
||||
typedef struct RenderData {
|
||||
|
||||
struct AviCodecData *avicodecdata;
|
||||
struct QuicktimeCodecData *qtcodecdata;
|
||||
struct FFMpegCodecData ffcodecdata;
|
||||
|
||||
int cfra, sfra, efra; /* fames as in 'images' */
|
||||
|
||||
int images, framapto, pad3;
|
||||
int images, framapto;
|
||||
short flag, threads;
|
||||
|
||||
float ctime; /* use for calcutions */
|
||||
@@ -217,34 +218,11 @@ typedef struct RenderData {
|
||||
|
||||
/**
|
||||
* Flags for render settings. Use bit-masking to access the settings.
|
||||
* 0: enable sequence output rendering
|
||||
* 1: render daemon
|
||||
* 4: add extensions to filenames
|
||||
*/
|
||||
short scemode;
|
||||
|
||||
/**
|
||||
* Flags for render settings. Use bit-masking to access the settings.
|
||||
* The bits have these meanings:
|
||||
* 0: do oversampling
|
||||
* 1: do shadows
|
||||
* 2: do gamma correction
|
||||
* 3: ortho (not used?)
|
||||
* 4: do envmap
|
||||
* 5: edge shading
|
||||
* 6: field rendering
|
||||
* 7: Disables time difference in field calculations
|
||||
* 8: radio rendering
|
||||
* 9: borders
|
||||
* 10: panorama
|
||||
* 11: crop
|
||||
* 12: save SGI movies with Cosmo hardware
|
||||
* 13: odd field first rendering
|
||||
* 14: motion blur
|
||||
* 15: use unified renderer for this pic
|
||||
* 16: enable raytracing
|
||||
* 17: gauss sampling for subpixels
|
||||
* 18: keep float buffer after render
|
||||
*/
|
||||
int mode;
|
||||
|
||||
@@ -256,20 +234,13 @@ typedef struct RenderData {
|
||||
* blending for the background
|
||||
*/
|
||||
short alphamode;
|
||||
/**
|
||||
* Toggles whether to apply a gamma correction for subpixel to
|
||||
* pixel blending
|
||||
*/
|
||||
short dogamma;
|
||||
|
||||
/**
|
||||
* The number of samples to use per pixel.
|
||||
*/
|
||||
short osa;
|
||||
short frs_sec, edgeint;
|
||||
|
||||
/** For unified renderer: reduce intensity on boundaries with
|
||||
* identical materials with this number.*/
|
||||
short same_mat_redux;
|
||||
short frs_sec, edgeint;
|
||||
|
||||
/* safety, border and display rect */
|
||||
rctf safety, border;
|
||||
@@ -281,17 +252,14 @@ typedef struct RenderData {
|
||||
int pad2;
|
||||
|
||||
/**
|
||||
* The gamma for the normal rendering. Used when doing
|
||||
* oversampling, to correctly blend subpixels to pixels. */
|
||||
float gamma, gauss;
|
||||
/** post-production settings. */
|
||||
float postmul, postgamma, postadd, postigamma, posthue, postsat;
|
||||
* Value used to define filter size for all filter options */
|
||||
float gauss;
|
||||
|
||||
/* Dither noise intensity */
|
||||
float dither_intensity;
|
||||
|
||||
/* Zblur settings */
|
||||
float zmin, focus, zgamma, zsigma, zblur;
|
||||
/* Bake Render options */
|
||||
short bake_osa, bake_filter, bake_mode, bake_flag;
|
||||
|
||||
/* yafray: global panel params. TODO: move elsewhere */
|
||||
short GIquality, GIcache, GImethod, GIphotons, GIdirect;
|
||||
@@ -303,6 +271,7 @@ typedef struct RenderData {
|
||||
float GIshadowquality, GIrefinement, GIpower, GIindirpower;
|
||||
float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
|
||||
|
||||
/* paths to backbufffer, output, ftype */
|
||||
char backbuf[160], pic[160], ftype[160];
|
||||
|
||||
} RenderData;
|
||||
@@ -504,7 +473,7 @@ typedef struct Scene {
|
||||
#define R_COSMO 0x1000
|
||||
#define R_ODDFIELD 0x2000
|
||||
#define R_MBLUR 0x4000
|
||||
#define R_UNIFIED 0x8000
|
||||
/* unified was here */
|
||||
#define R_RAYTRACE 0x10000
|
||||
/* R_GAUSS is obsolete, but used to retrieve setting from old files */
|
||||
#define R_GAUSS 0x20000
|
||||
@@ -584,6 +553,10 @@ typedef struct Scene {
|
||||
#define R_OPENEXR_ZBUF 2
|
||||
#define R_PREVIEW_JPG 4
|
||||
|
||||
/* bake_mode: same as RE_BAKE_xxx defines */
|
||||
/* bake_flag: */
|
||||
#define R_BAKE_CLEAR 1
|
||||
#define R_BAKE_OSA 2
|
||||
|
||||
/* **************** SCENE ********************* */
|
||||
#define RAD_PHASE_PATCHES 1
|
||||
|
||||
@@ -87,11 +87,7 @@ enum rend_constants {
|
||||
#define EXPP_RENDER_ATTR_QUALITY 11
|
||||
#define EXPP_RENDER_ATTR_GAUSS 13
|
||||
#define EXPP_RENDER_ATTR_BLURFAC 14
|
||||
#define EXPP_RENDER_ATTR_POSTADD 15
|
||||
#define EXPP_RENDER_ATTR_POSTGAMMA 16
|
||||
#define EXPP_RENDER_ATTR_POSTMUL 17
|
||||
#define EXPP_RENDER_ATTR_POSTHUE 18
|
||||
#define EXPP_RENDER_ATTR_POSTSAT 19
|
||||
|
||||
#define EXPP_RENDER_ATTR_YF_EXPOSURE 20
|
||||
#define EXPP_RENDER_ATTR_YF_GAMMA 21
|
||||
#define EXPP_RENDER_ATTR_YF_GIDEPTH 22
|
||||
@@ -368,15 +364,6 @@ PyObject *M_Render_EnableDispWin( PyObject * self )
|
||||
return EXPP_incr_ret( Py_None );
|
||||
}
|
||||
|
||||
PyObject *M_Render_EnableEdgeShift( PyObject * self, PyObject * args )
|
||||
{
|
||||
return M_Render_BitToggleInt( args, 1, &G.compat );
|
||||
}
|
||||
|
||||
PyObject *M_Render_EnableEdgeAll( PyObject * self, PyObject * args )
|
||||
{
|
||||
return M_Render_BitToggleInt( args, 1, &G.notonlysolid );
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
/* BPy_RenderData Function Definitions */
|
||||
@@ -610,13 +597,6 @@ PyObject *RenderData_GetEdgeColor( BPy_RenderData * self )
|
||||
return PyString_FromString( rgb );
|
||||
}
|
||||
|
||||
PyObject *RenderData_EdgeAntiShift( BPy_RenderData * self, PyObject * args )
|
||||
{
|
||||
return M_Render_GetSetAttributeShort( args,
|
||||
&self->renderContext->
|
||||
same_mat_redux, 0, 255 );
|
||||
}
|
||||
|
||||
PyObject *RenderData_EnableOversampling( BPy_RenderData * self,
|
||||
PyObject * args )
|
||||
{
|
||||
@@ -1053,13 +1033,6 @@ PyObject *RenderData_SizePreset( BPy_RenderData * self, PyObject * args )
|
||||
return EXPP_incr_ret( Py_None );
|
||||
}
|
||||
|
||||
PyObject *RenderData_EnableUnifiedRenderer( BPy_RenderData * self,
|
||||
PyObject * args )
|
||||
{
|
||||
return M_Render_BitToggleInt( args, R_UNIFIED,
|
||||
&self->renderContext->mode );
|
||||
}
|
||||
|
||||
PyObject *RenderData_SetYafrayGIQuality( BPy_RenderData * self,
|
||||
PyObject * args )
|
||||
{
|
||||
@@ -1352,51 +1325,6 @@ PyObject *RenderData_GetGameFrameColor( BPy_RenderData * self )
|
||||
return PyString_FromString( rgb );
|
||||
}
|
||||
|
||||
PyObject *RenderData_GammaLevel( BPy_RenderData * self, PyObject * args )
|
||||
{
|
||||
if( self->renderContext->mode & R_UNIFIED ) {
|
||||
return M_Render_GetSetAttributeFloat( args,
|
||||
&self->renderContext->
|
||||
gamma, 0.2f, 5.0f );
|
||||
} else
|
||||
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"Unified Render must be enabled" ) );
|
||||
}
|
||||
|
||||
PyObject *RenderData_PostProcessAdd( BPy_RenderData * self, PyObject * args )
|
||||
{
|
||||
if( self->renderContext->mode & R_UNIFIED ) {
|
||||
return M_Render_GetSetAttributeFloat( args,
|
||||
&self->renderContext->
|
||||
postadd, -1.0f, 1.0f );
|
||||
} else
|
||||
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"Unified Render must be enabled" ) );
|
||||
}
|
||||
|
||||
PyObject *RenderData_PostProcessMultiply( BPy_RenderData * self,
|
||||
PyObject * args )
|
||||
{
|
||||
if( self->renderContext->mode & R_UNIFIED ) {
|
||||
return M_Render_GetSetAttributeFloat( args,
|
||||
&self->renderContext->
|
||||
postmul, 0.01f, 4.0f );
|
||||
} else
|
||||
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"Unified Render must be enabled" ) );
|
||||
}
|
||||
|
||||
PyObject *RenderData_PostProcessGamma( BPy_RenderData * self, PyObject * args )
|
||||
{
|
||||
if( self->renderContext->mode & R_UNIFIED ) {
|
||||
return M_Render_GetSetAttributeFloat( args,
|
||||
&self->renderContext->
|
||||
postgamma, 0.2f, 2.0f );
|
||||
} else
|
||||
return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
|
||||
"Unified Render must be enabled" ) );
|
||||
}
|
||||
|
||||
#ifdef __sgi
|
||||
PyObject *RenderData_SGIMaxsize( BPy_RenderData * self, PyObject * args )
|
||||
{
|
||||
@@ -1655,7 +1583,7 @@ static int RenderData_setModeBit( BPy_RenderData* self, PyObject *value,
|
||||
|
||||
#define MODE_MASK ( R_OSA | R_SHADOW | R_GAMMA | R_ENVMAP | R_EDGE | \
|
||||
R_FIELDS | R_FIELDSTILL | R_RADIO | R_BORDER | R_PANORAMA | R_CROP | \
|
||||
R_ODDFIELD | R_MBLUR | R_UNIFIED | R_RAYTRACE | R_THREADS )
|
||||
R_ODDFIELD | R_MBLUR | R_RAYTRACE | R_THREADS )
|
||||
|
||||
static PyObject *RenderData_getMode( BPy_RenderData *self )
|
||||
{
|
||||
@@ -2082,10 +2010,6 @@ static PyGetSetDef BPy_RenderData_getseters[] = {
|
||||
(getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
|
||||
"Motion blur enabled",
|
||||
(void *)R_MBLUR},
|
||||
{"unified",
|
||||
(getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
|
||||
"Unified Renderer enabled",
|
||||
(void *)R_UNIFIED},
|
||||
{"rayTracing",
|
||||
(getter)RenderData_getModeBit, (setter)RenderData_setModeBit,
|
||||
"Ray tracing enabled",
|
||||
@@ -2135,7 +2059,7 @@ static PyGetSetDef BPy_RenderData_getseters[] = {
|
||||
NULL},
|
||||
{"edgeColor",
|
||||
(getter)RenderData_getEdgeColor, (setter)RenderData_setEdgeColor,
|
||||
"RGB color triplet for edges in Toon shading (unified renderer)",
|
||||
"RGB color triplet for edges in Toon shading",
|
||||
NULL},
|
||||
{"OSALevel",
|
||||
(getter)RenderData_getOSALevel, (setter)RenderData_setOSALevel,
|
||||
@@ -2299,9 +2223,6 @@ static PyMethodDef BPy_RenderData_methods[] = {
|
||||
"(f,f,f) - set the edge color for toon shading - Red,Green,Blue expected."},
|
||||
{"getEdgeColor", ( PyCFunction ) RenderData_GetEdgeColor, METH_NOARGS,
|
||||
"() - get the edge color for toon shading - Red,Green,Blue expected."},
|
||||
{"edgeAntiShift", ( PyCFunction ) RenderData_EdgeAntiShift,
|
||||
METH_VARARGS,
|
||||
"(int) - with the unified renderer to reduce intensity on boundaries."},
|
||||
{"enableOversampling", ( PyCFunction ) RenderData_EnableOversampling,
|
||||
METH_VARARGS,
|
||||
"(bool) - enable/disable oversampling (anit-aliasing)."},
|
||||
@@ -2362,9 +2283,6 @@ static PyMethodDef BPy_RenderData_methods[] = {
|
||||
"(bool) - enable/disable small cut-out rendering"},
|
||||
{"setBorder", ( PyCFunction ) RenderData_SetBorder, METH_VARARGS,
|
||||
"(f,f,f,f) - set the border for border rendering"},
|
||||
{"enableGammaCorrection",
|
||||
( PyCFunction ) RenderData_EnableGammaCorrection, METH_VARARGS,
|
||||
"(bool) - enable/disable gamma correction"},
|
||||
{"gaussFilterSize", ( PyCFunction ) RenderData_GaussFilterSize,
|
||||
METH_VARARGS,
|
||||
"(float) - get/sets the Gauss filter size"},
|
||||
@@ -2406,9 +2324,6 @@ static PyMethodDef BPy_RenderData_methods[] = {
|
||||
"() - images are saved with RGB and Alpha data (if supported)"},
|
||||
{"sizePreset", ( PyCFunction ) RenderData_SizePreset, METH_VARARGS,
|
||||
"(enum) - get/set the render to one of a few preget/sets"},
|
||||
{"enableUnifiedRenderer",
|
||||
( PyCFunction ) RenderData_EnableUnifiedRenderer, METH_VARARGS,
|
||||
"(bool) - use the unified renderer"},
|
||||
{"setYafrayGIQuality", ( PyCFunction ) RenderData_SetYafrayGIQuality,
|
||||
METH_VARARGS,
|
||||
"(enum) - get/set yafray global Illumination quality"},
|
||||
@@ -2483,17 +2398,6 @@ static PyMethodDef BPy_RenderData_methods[] = {
|
||||
{"getGameFrameColor", ( PyCFunction ) RenderData_GetGameFrameColor,
|
||||
METH_NOARGS,
|
||||
"() - get the red, green, blue component of the bars"},
|
||||
{"gammaLevel", ( PyCFunction ) RenderData_GammaLevel, METH_VARARGS,
|
||||
"(float) - get/set the gamma value for blending oversampled images (1.0 = no correction"},
|
||||
{"postProcessAdd", ( PyCFunction ) RenderData_PostProcessAdd,
|
||||
METH_VARARGS,
|
||||
"(float) - get/set post processing add"},
|
||||
{"postProcessMultiply", ( PyCFunction ) RenderData_PostProcessMultiply,
|
||||
METH_VARARGS,
|
||||
"(float) - get/set post processing multiply"},
|
||||
{"postProcessGamma", ( PyCFunction ) RenderData_PostProcessGamma,
|
||||
METH_VARARGS,
|
||||
"(float) - get/set post processing gamma"},
|
||||
{"SGIMaxsize", ( PyCFunction ) RenderData_SGIMaxsize, METH_VARARGS,
|
||||
"(int) - get/set maximum size per frame to save in an SGI movie"},
|
||||
{"enableSGICosmo", ( PyCFunction ) RenderData_EnableSGICosmo,
|
||||
@@ -2604,11 +2508,6 @@ struct PyMethodDef M_Render_methods[] = {
|
||||
{"SetRenderWinPos", ( PyCFunction ) M_Render_SetRenderWinPos,
|
||||
METH_VARARGS,
|
||||
"([string list]) - position the rendering window in around the edge of the screen"},
|
||||
{"EnableEdgeShift", ( PyCFunction ) M_Render_EnableEdgeShift,
|
||||
METH_VARARGS,
|
||||
"(bool) - with the unified renderer the outlines are shifted a bit."},
|
||||
{"EnableEdgeAll", ( PyCFunction ) M_Render_EnableEdgeAll, METH_VARARGS,
|
||||
"(bool) - also consider transparent faces for edge-rendering with the unified renderer"},
|
||||
{NULL, NULL, 0, NULL}
|
||||
};
|
||||
|
||||
@@ -2631,7 +2530,6 @@ static PyObject *M_Render_ModesDict( void )
|
||||
PyConstant_Insert( d, "CROP", PyInt_FromLong( R_CROP ) );
|
||||
PyConstant_Insert( d, "ODDFIELD", PyInt_FromLong( R_ODDFIELD ) );
|
||||
PyConstant_Insert( d, "MBLUR", PyInt_FromLong( R_MBLUR ) );
|
||||
PyConstant_Insert( d, "UNIFIED", PyInt_FromLong( R_UNIFIED ) );
|
||||
PyConstant_Insert( d, "RAYTRACING", PyInt_FromLong( R_RAYTRACE ) );
|
||||
PyConstant_Insert( d, "THREADS", PyInt_FromLong( R_THREADS ) );
|
||||
}
|
||||
|
||||
@@ -1488,6 +1488,7 @@ static int get_next_bake_face(BakeShade *bs)
|
||||
if(ibuf->rect_float)
|
||||
imb_freerectImBuf(ibuf);
|
||||
/* clear image */
|
||||
if(R.r.bake_flag & R_BAKE_CLEAR)
|
||||
IMB_rectfill(ibuf, vec);
|
||||
|
||||
/* might be read by UI to set active image for display */
|
||||
@@ -1626,8 +1627,8 @@ int RE_bake_shade_all_selected(Render *re, int type)
|
||||
for(ima= G.main->image.first; ima; ima= ima->id.next) {
|
||||
if((ima->id.flag & LIB_DOIT)==0) {
|
||||
ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
|
||||
for(a=0; a<re->r.bake_filter; a++)
|
||||
IMB_filter_extend(ibuf);
|
||||
IMB_filter_extend(ibuf); /* 2nd pixel extra */
|
||||
ibuf->userflags |= IB_BITMAPDIRTY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "BIF_keyval.h"
|
||||
#include "BIF_mainqueue.h"
|
||||
#include "BIF_mywindow.h"
|
||||
#include "BIF_meshtools.h"
|
||||
#include "BIF_resources.h"
|
||||
#include "BIF_renderwin.h"
|
||||
#include "BIF_screen.h"
|
||||
@@ -92,6 +93,7 @@
|
||||
#include "BSE_seqaudio.h"
|
||||
#include "BSE_headerbuttons.h"
|
||||
|
||||
#include "RE_pipeline.h"
|
||||
|
||||
#include "butspace.h" // own module
|
||||
|
||||
@@ -1208,6 +1210,42 @@ static void render_panel_output(void)
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
static void do_bake_func(void *unused_v, void *unused_p)
|
||||
{
|
||||
objects_bake_render(0);
|
||||
}
|
||||
|
||||
static void render_panel_bake(void)
|
||||
{
|
||||
uiBlock *block;
|
||||
uiBut *but;
|
||||
|
||||
block= uiNewBlock(&curarea->uiblocks, "render_panel_bake", UI_EMBOSS, UI_HELV, curarea->win);
|
||||
uiNewPanelTabbed("Anim", "Render");
|
||||
if(uiNewPanel(curarea, block, "Bake", "Render", 320, 0, 318, 204)==0) return;
|
||||
|
||||
but= uiDefBut(block, BUT, B_NOP, "BAKE", 10, 150, 190,40, 0, 0, 0, 0, 0, "Start the bake render");
|
||||
uiButSetFunc(but, do_bake_func, NULL, NULL);
|
||||
#if 0
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitS(block, TOG, R_BAKE_OSA, B_DIFF, "OSA", 10,120,190,20, &G.scene->r.bake_flag, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
|
||||
uiDefButS(block, ROW,B_DIFF,"5", 10,100,50,20,&G.scene->r.bake_osa,2.0,5.0, 0, 0, "Sets oversample level to 5");
|
||||
uiDefButS(block, ROW,B_DIFF,"8", 60,100,45,20,&G.scene->r.bake_osa,2.0,8.0, 0, 0, "Sets oversample level to 8");
|
||||
uiDefButS(block, ROW,B_DIFF,"11", 105,100,45,20,&G.scene->r.bake_osa,2.0,11.0, 0, 0, "Sets oversample level to 11");
|
||||
uiDefButS(block, ROW,B_DIFF,"16", 150,100,50,20,&G.scene->r.bake_osa,2.0,16.0, 0, 0, "Sets oversample level to 16");
|
||||
#endif
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButS(block, ROW,B_DIFF,"Full Render", 210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, "");
|
||||
uiDefButS(block, ROW,B_DIFF,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, "");
|
||||
uiDefButS(block, ROW,B_DIFF,"Normals", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, "");
|
||||
uiDefButS(block, ROW,B_DIFF,"Textures", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButBitS(block, TOG, R_BAKE_CLEAR, B_DIFF, "Clear", 210,80,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking");
|
||||
|
||||
uiDefButS(block, NUM, B_DIFF,"Margin:", 210,50,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter");
|
||||
}
|
||||
|
||||
static void render_panel_render(void)
|
||||
{
|
||||
uiBlock *block;
|
||||
@@ -1228,7 +1266,7 @@ static void render_panel_render(void)
|
||||
#endif /* disable yafray */
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_OSA, 0, "OSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
|
||||
uiDefButBitI(block, TOG, R_OSA, B_DIFF, "OSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
|
||||
uiDefButS(block, ROW,B_DIFF,"5", 369,88,29,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Sets oversample level to 5");
|
||||
uiDefButS(block, ROW,B_DIFF,"8", 400,88,29,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Sets oversample level to 8 (Recommended)");
|
||||
uiDefButS(block, ROW,B_DIFF,"11", 431,88,29,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Sets oversample level to 11");
|
||||
@@ -1363,15 +1401,17 @@ static void set_ffmpeg_preset(int preset)
|
||||
|
||||
static void render_panel_ffmpeg_video(void)
|
||||
{
|
||||
uiBlock *block;
|
||||
int yofs;
|
||||
int xcol1;
|
||||
int xcol2;
|
||||
uiBlock *block;
|
||||
|
||||
block = uiNewBlock(&curarea->uiblocks, "render_panel_ffmpeg_video",
|
||||
UI_EMBOSS, UI_HELV, curarea->win);
|
||||
|
||||
uiNewPanelTabbed("Format", "Render");
|
||||
if (uiNewPanel(curarea, block, "Video", "Render", 960, 0, 318, 204)
|
||||
== 0) return;
|
||||
if (uiNewPanel(curarea, block, "Video", "Render", 960, 0, 318, 204)== 0)
|
||||
return;
|
||||
|
||||
if (ffmpeg_preset_sel != 0) {
|
||||
set_ffmpeg_preset(ffmpeg_preset_sel);
|
||||
@@ -1429,8 +1469,7 @@ static void render_panel_ffmpeg_video(void)
|
||||
0, 1, 0,0, "Autosplit output at 2GB boundary.");
|
||||
|
||||
|
||||
if (G.scene->r.ffcodecdata.type == FFMPEG_AVI
|
||||
|| G.scene->r.ffcodecdata.type == FFMPEG_MOV) {
|
||||
if (ELEM(G.scene->r.ffcodecdata.type, FFMPEG_AVI, FFMPEG_MOV)) {
|
||||
uiDefBut(block, LABEL, 0, "Codec",
|
||||
xcol1, yofs-44, 110, 20, 0, 0, 0, 0, 0, "");
|
||||
uiDefButI(block, MENU,B_REDR, ffmpeg_codec_pup(),
|
||||
@@ -1438,18 +1477,18 @@ static void render_panel_ffmpeg_video(void)
|
||||
&G.scene->r.ffcodecdata.codec,
|
||||
0,0,0,0, "FFMpeg codec to use");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void render_panel_ffmpeg_audio(void)
|
||||
{
|
||||
uiBlock *block;
|
||||
int yofs;
|
||||
int xcol;
|
||||
uiBlock *block;
|
||||
|
||||
block = uiNewBlock(&curarea->uiblocks, "render_panel_ffmpeg_audio", UI_EMBOSS, UI_HELV, curarea->win);
|
||||
uiNewPanelTabbed("Format", "Render");
|
||||
if (uiNewPanel(curarea, block, "Audio", "Render", 960, 0, 318, 204)
|
||||
== 0) return;
|
||||
if (uiNewPanel(curarea, block, "Audio", "Render", 960, 0, 318, 204) == 0) return;
|
||||
|
||||
yofs = 54;
|
||||
xcol = 892;
|
||||
|
||||
@@ -1865,10 +1904,10 @@ void render_panels()
|
||||
{
|
||||
|
||||
render_panel_output();
|
||||
// render_panel_sfx();
|
||||
render_panel_layers();
|
||||
render_panel_render();
|
||||
render_panel_anim();
|
||||
render_panel_bake();
|
||||
|
||||
render_panel_format();
|
||||
#ifdef WITH_FFMPEG
|
||||
|
||||
@@ -1683,7 +1683,7 @@ static void do_info_rendermenu(void *arg, int event)
|
||||
extern_set_butspace(F10KEY, 0);
|
||||
break;
|
||||
case 8:
|
||||
objects_bake_render();
|
||||
objects_bake_render(1);
|
||||
break;
|
||||
}
|
||||
allqueue(REDRAWINFO, 0);
|
||||
|
||||
@@ -785,11 +785,15 @@ static void *do_bake_render(void *bake_v)
|
||||
}
|
||||
|
||||
/* all selected meshes with UV maps are rendered for current scene visibility */
|
||||
void objects_bake_render(void)
|
||||
void objects_bake_render(int use_menu)
|
||||
{
|
||||
short event;
|
||||
|
||||
if(use_menu)
|
||||
event= pupmenu("Bake Selected Meshes %t|Full Render %x1|Ambient Occlusion %x2|Normals %x3|Texture Only %x4");
|
||||
else
|
||||
event= G.scene->r.bake_mode;
|
||||
|
||||
if(event>0) {
|
||||
Render *re= RE_NewRender("_Bake View_");
|
||||
ScrArea *area= biggest_image_area();
|
||||
|
||||
@@ -1562,7 +1562,7 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
}
|
||||
}
|
||||
else if(G.qual== (LR_ALTKEY|LR_CTRLKEY))
|
||||
objects_bake_render();
|
||||
objects_bake_render(1);
|
||||
else if(G.qual==0)
|
||||
borderselect();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user