Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-08 16:52:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-08 16:52:38 +0300
commita868e8623ca7218dfa363962e178293f4a8f0690 (patch)
tree2c0e08b1b9b810b60c7b19d9dac4fd6e2fb41c36 /source
parent7079047538da71961102478a23cccdbd62c7cf9d (diff)
- RNA support for returning copied strings from functions, flagging strings as PROP_THICK_WRAP does this.
- scene.render_data.frame_path(frame=num), returns the output path for rending images of video. - scene.render_data.file_extension, readonly attribute, gives the extension ".jpg", ".mov" etc - player support was guessing names, use the above functions to get the actual names used, accounting for #'s replacing numbers.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_image.h4
-rw-r--r--source/blender/blenkernel/BKE_writeavi.h7
-rw-r--r--source/blender/blenkernel/BKE_writeffmpeg.h1
-rw-r--r--source/blender/blenkernel/intern/image.c8
-rw-r--r--source/blender/blenkernel/intern/writeavi.c25
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c5
-rw-r--r--source/blender/editors/screen/screen_ops.c2
-rw-r--r--source/blender/editors/screen/screendump.c4
-rw-r--r--source/blender/editors/space_file/writeimage.c2
-rw-r--r--source/blender/editors/space_image/image_ops.c3
-rw-r--r--source/blender/makesrna/intern/makesrna.c21
-rw-r--r--source/blender/makesrna/intern/rna_define.c7
-rw-r--r--source/blender/makesrna/intern/rna_internal.h3
-rw-r--r--source/blender/makesrna/intern/rna_scene.c29
-rw-r--r--source/blender/makesrna/intern/rna_scene_api.c24
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c16
-rw-r--r--source/blender/quicktime/apple/quicktime_export.c4
-rw-r--r--source/blender/quicktime/quicktime_export.h1
-rw-r--r--source/blender/render/intern/source/pipeline.c6
20 files changed, 131 insertions, 43 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 85c3c716b8b..7f18fb1624d 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -47,8 +47,8 @@ void free_image(struct Image *me);
void BKE_stamp_info(struct Scene *scene, struct ImBuf *ibuf);
void BKE_stamp_buf(struct Scene *scene, unsigned char *rect, float *rectf, int width, int height, int channels);
int BKE_write_ibuf(struct Scene *scene, struct ImBuf *ibuf, char *name, int imtype, int subimtype, int quality);
-void BKE_makepicstring(struct Scene *scene, char *string, char *base, int frame, int imtype);
-void BKE_add_image_extension(struct Scene *scene, char *string, int imtype);
+void BKE_makepicstring(char *string, char *base, int frame, int imtype, int use_ext);
+void BKE_add_image_extension(char *string, int imtype);
int BKE_ftype_to_imtype(int ftype);
int BKE_imtype_to_ftype(int imtype);
int BKE_imtype_is_movie(int imtype);
diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h
index a8d38dda103..e2778ebb54c 100644
--- a/source/blender/blenkernel/BKE_writeavi.h
+++ b/source/blender/blenkernel/BKE_writeavi.h
@@ -40,19 +40,16 @@ struct RenderData;
struct ReportList;
struct Scene;
-int start_avi(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports);
-void end_avi(void);
-int append_avi(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports);
-void makeavistring (struct RenderData *rd, char *string);
-
typedef struct bMovieHandle {
int (*start_movie)(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports);
int (*append_movie)(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports);
void (*end_movie)(void);
int (*get_next_frame)(struct RenderData *rd, struct ReportList *reports); /* optional */
+ void (*get_movie_path)(char *string, struct RenderData *rd); /* optional */
} bMovieHandle;
bMovieHandle *BKE_get_movie_handle(int imtype);
+void BKE_makeanimstring(char *string, struct RenderData *rd);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h
index 6ec8320f026..98c385ea2e1 100644
--- a/source/blender/blenkernel/BKE_writeffmpeg.h
+++ b/source/blender/blenkernel/BKE_writeffmpeg.h
@@ -63,6 +63,7 @@ struct Scene;
extern int start_ffmpeg(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports);
extern void end_ffmpeg(void);
extern int append_ffmpeg(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports);
+void filepath_ffmpeg(char* string, struct RenderData* rd);
extern void ffmpeg_set_preset(struct RenderData *rd, int preset);
extern void ffmpeg_verify_image_type(struct RenderData *rd);
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index e3bb443fe7c..ff5b5019206 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -883,7 +883,7 @@ int BKE_imtype_is_movie(int imtype)
return 0;
}
-void BKE_add_image_extension(Scene *scene, char *string, int imtype)
+void BKE_add_image_extension(char *string, int imtype)
{
char *extension="";
@@ -1409,7 +1409,7 @@ int BKE_write_ibuf(Scene *scene, ImBuf *ibuf, char *name, int imtype, int subimt
}
-void BKE_makepicstring(struct Scene *scene, char *string, char *base, int frame, int imtype)
+void BKE_makepicstring(char *string, char *base, int frame, int imtype, int use_ext)
{
if (string==NULL) return;
@@ -1422,8 +1422,8 @@ void BKE_makepicstring(struct Scene *scene, char *string, char *base, int frame,
BLI_convertstringcode(string, G.sce);
BLI_convertstringframe(string, frame);
- if(scene->r.scemode & R_EXTENSION)
- BKE_add_image_extension(scene, string, imtype);
+ if(use_ext)
+ BKE_add_image_extension(string, imtype);
}
diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c
index ec3d1185179..9ff5ee00bfb 100644
--- a/source/blender/blenkernel/intern/writeavi.c
+++ b/source/blender/blenkernel/intern/writeavi.c
@@ -45,6 +45,11 @@
#include "BKE_writeavi.h"
#include "AVI_avi.h"
+/* callbacks */
+static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *reports);
+static void end_avi(void);
+static int append_avi(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports);
+static void filepath_avi(char *string, RenderData *rd);
/* ********************** general blender movie support ***************************** */
@@ -67,6 +72,7 @@ bMovieHandle *BKE_get_movie_handle(int imtype)
mh.append_movie= append_avi;
mh.end_movie= end_avi;
mh.get_next_frame = NULL;
+ mh.get_movie_path = filepath_avi;
/* do the platform specific handles */
#ifdef __sgi
@@ -86,6 +92,7 @@ bMovieHandle *BKE_get_movie_handle(int imtype)
mh.start_movie= start_qt;
mh.append_movie= append_qt;
mh.end_movie= end_qt;
+ mh.get_movie_path = filepath_qt;
}
#endif
#ifdef WITH_FFMPEG
@@ -93,6 +100,7 @@ bMovieHandle *BKE_get_movie_handle(int imtype)
mh.start_movie = start_ffmpeg;
mh.append_movie = append_ffmpeg;
mh.end_movie = end_ffmpeg;
+ mh.get_movie_path = filepath_ffmpeg;
}
#endif
if (imtype == R_FRAMESERVER) {
@@ -111,7 +119,7 @@ bMovieHandle *BKE_get_movie_handle(int imtype)
static AviMovie *avi=NULL;
static int sframe;
-void makeavistring (RenderData *rd, char *string)
+static void filepath_avi (char *string, RenderData *rd)
{
char txt[64];
@@ -128,7 +136,7 @@ void makeavistring (RenderData *rd, char *string)
}
}
-int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *reports)
+static int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *reports)
{
int x, y;
char name[256];
@@ -136,7 +144,7 @@ int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *re
int quality;
double framerate;
- makeavistring(rd, name);
+ filepath_avi(name, rd);
sframe = (rd->sfra);
x = rectx;
@@ -174,7 +182,7 @@ int start_avi(Scene *scene, RenderData *rd, int rectx, int recty, ReportList *re
return 1;
}
-int append_avi(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports)
+static int append_avi(RenderData *rd, int frame, int *pixels, int rectx, int recty, ReportList *reports)
{
unsigned int *rt1, *rt2, *rectot;
int x, y;
@@ -218,3 +226,12 @@ void end_avi(void)
avi= NULL;
}
+/* similar to BKE_makepicstring() */
+void BKE_makeanimstring(char *string, RenderData *rd)
+{
+ bMovieHandle *mh= BKE_get_movie_handle(rd->imtype);
+ if(mh->get_movie_path)
+ mh->get_movie_path(string, rd);
+ else
+ string[0]= '\0';
+}
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 5b58f0bfedc..920ff255bcc 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -75,7 +75,6 @@
#endif
extern void do_init_ffmpeg();
-static void makeffmpegstring(RenderData* rd, char* string);
static int ffmpeg_type = 0;
static int ffmpeg_codec = CODEC_ID_MPEG4;
@@ -638,7 +637,7 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
do_init_ffmpeg();
/* Determine the correct filename */
- makeffmpegstring(rd, name);
+ filepath_ffmpeg(name, rd);
fprintf(stderr, "Starting output to %s(ffmpeg)...\n"
" Using type=%d, codec=%d, audio_codec=%d,\n"
" video_bitrate=%d, audio_bitrate=%d,\n"
@@ -772,7 +771,7 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
********************************************************************** */
/* Get the output filename-- similar to the other output formats */
-static void makeffmpegstring(RenderData* rd, char* string) {
+void filepath_ffmpeg(char* string, RenderData* rd) {
// XXX quick define, solve!
#define FILE_MAXDIR 256
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index c938f0997ea..4125ced4e71 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -3413,7 +3413,7 @@ static int screen_opengl_render_modal(bContext *C, wmOperator *op, wmEvent *even
printf("Append frame %d", scene->r.cfra);
}
else {
- BKE_makepicstring(scene, name, scene->r.pic, scene->r.cfra, scene->r.imtype);
+ BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION);
ok= BKE_write_ibuf(scene, ibuf, name, scene->r.imtype, scene->r.subimtype, scene->r.quality);
if(ok==0) printf("write error: cannot save %s\n", name);
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 088be194fe8..7fea28304ba 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -84,7 +84,7 @@ static int screenshot_exec(bContext *C, wmOperator *op)
/* BKE_add_image_extension() checks for if extension was already set */
if(scene->r.scemode & R_EXTENSION)
if(strlen(path)<FILE_MAXDIR+FILE_MAXFILE-5)
- BKE_add_image_extension(scene, path, scene->r.imtype);
+ BKE_add_image_extension(path, scene->r.imtype);
ibuf= IMB_allocImBuf(scd->dumpsx, scd->dumpsy, 24, 0, 0);
ibuf->rect= scd->dumprect;
@@ -258,7 +258,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update)
char name[FILE_MAXDIR+FILE_MAXFILE];
int ok;
- BKE_makepicstring(sj->scene, name, rd.pic, cfra, rd.imtype);
+ BKE_makepicstring(name, rd.pic, cfra, rd.imtype, rd.scemode & R_EXTENSION);
ibuf->rect= sj->dumprect;
ok= BKE_write_ibuf(sj->scene, ibuf, name, rd.imtype, rd.subimtype, rd.quality);
diff --git a/source/blender/editors/space_file/writeimage.c b/source/blender/editors/space_file/writeimage.c
index 045c790b9cd..9e8e3b7b058 100644
--- a/source/blender/editors/space_file/writeimage.c
+++ b/source/blender/editors/space_file/writeimage.c
@@ -102,7 +102,7 @@ static void save_rendered_image_cb_real(char *name, int confirm)
/* BKE_add_image_extension() checks for if extension was already set */
if(scene->r.scemode & R_EXTENSION)
if(strlen(name)<FILE_MAXDIR+FILE_MAXFILE-5)
- BKE_add_image_extension(scene, name, scene->r.imtype);
+ BKE_add_image_extension(name, scene->r.imtype);
strcpy(str, name);
BLI_convertstringcode(str, G.sce);
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index f204d7702f0..827b2ddeac2 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -785,8 +785,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, Scene *scene, wmOpera
BLI_convertstringframe(name, scene->r.cfra);
if(scene->r.scemode & R_EXTENSION) {
- BKE_add_image_extension(scene, name, sima->imtypenr);
- BKE_add_image_extension(scene, name, sima->imtypenr);
+ BKE_add_image_extension(name, sima->imtypenr);
}
/* enforce user setting for RGB or RGBA, but skip BW */
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index aa7939c644f..a03903eb652 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -1238,9 +1238,12 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
ptrstr= "*";
else if(dparm->prop==func->c_ret)
ptrstr= ((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR))? "*": "";
- else if ((dparm->prop->flag & PROP_RETURN))
- ptrstr= ((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR))? "**": "*";
- else
+ else if ((dparm->prop->flag & PROP_RETURN)) {
+ if ((dparm->prop->flag & PROP_THICK_WRAP) && (dparm->prop->type == PROP_STRING))
+ ptrstr= "";
+ else
+ ptrstr= ((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR))? "**": "*";
+ } else
ptrstr= (dparm->prop->type == PROP_POINTER)? "*": "";
fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier);
@@ -1276,8 +1279,12 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA
else
fprintf(f, "\t%s= %s((%s%s**)_data);\n", dparm->prop->identifier, ptrstr, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
}
- else
- fprintf(f, "\t%s= %s((%s%s*)_data);\n", dparm->prop->identifier, ptrstr, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
+ else {
+ if ((dparm->prop->flag & PROP_THICK_WRAP) && (dparm->prop->type == PROP_STRING))
+ fprintf(f, "\t%s= %s((%s%s)_data);\n", dparm->prop->identifier, ptrstr, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
+ else
+ fprintf(f, "\t%s= %s((%s%s*)_data);\n", dparm->prop->identifier, ptrstr, rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop));
+ }
if(dparm->next)
fprintf(f, "\t_data+= %d;\n", rna_parameter_size(dparm->prop));
@@ -1614,7 +1621,9 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA
if(!first) fprintf(f, ", ");
first= 0;
- if((dparm->prop->flag & PROP_RETURN))
+ if((dparm->prop->type == PROP_STRING && dparm->prop->flag & PROP_THICK_WRAP))
+ ptrstr= "";
+ else if(dparm->prop->flag & PROP_RETURN)
ptrstr= "*";
else
ptrstr= "";
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 767752af0ea..ed10c0819fd 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -2470,7 +2470,12 @@ int rna_parameter_size(PropertyRNA *parm)
case PROP_FLOAT:
return sizeof(float);
case PROP_STRING:
- return sizeof(char *);
+ /* return valyes dont store a pointer to the original */
+ if(parm->flag & PROP_THICK_WRAP) {
+ StringPropertyRNA *sparm= (StringPropertyRNA*)parm;
+ return sizeof(char) * sparm->maxlength;
+ } else
+ return sizeof(char *);
case PROP_POINTER: {
#ifdef RNA_RUNTIME
if(parm->flag & PROP_RNAPTR)
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 91443e8f9fa..b154647e10e 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -225,7 +225,8 @@ void RNA_api_material(StructRNA *srna);
void RNA_api_mesh(struct StructRNA *srna);
void RNA_api_object(struct StructRNA *srna);
void RNA_api_pose_channel(struct StructRNA *srna);
-void RNA_api_scene(struct StructRNA *srna);
+void RNA_api_scene(struct StructRNA *srna);
+void RNA_api_scene_render(struct StructRNA *srna);
void RNA_api_text(struct StructRNA *srna);
void RNA_api_ui_layout(struct StructRNA *srna);
void RNA_api_wm(struct StructRNA *srna);
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index b8a85b6521b..8830583045b 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -101,6 +101,7 @@ EnumPropertyItem snap_element_items[] = {
#include "BKE_pointcache.h"
#include "BKE_scene.h"
#include "BKE_depsgraph.h"
+#include "BKE_image.h"
#include "BKE_mesh.h"
#include "BLI_threads.h"
@@ -359,6 +360,21 @@ static void rna_SceneRenderData_file_format_set(PointerRNA *ptr, int value)
#endif
}
+static int rna_SceneRender_file_ext_length(PointerRNA *ptr)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ char ext[8];
+
+ BKE_add_image_extension(ext, rd->imtype);
+ return strlen(ext);
+}
+
+static void rna_SceneRender_file_ext_get(PointerRNA *ptr, char *str)
+{
+ RenderData *rd= (RenderData*)ptr->data;
+ BKE_add_image_extension(str, rd->imtype);
+}
+
void rna_SceneRenderData_jpeg2k_preset_update(RenderData *rd)
{
rd->subimtype &= ~(R_JPEG2K_12BIT|R_JPEG2K_16BIT | R_JPEG2K_CINE_PRESET|R_JPEG2K_CINE_48FPS);
@@ -2100,7 +2116,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Color Management", "Use color profiles and gamma corrected imaging pipeline");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS|NC_MATERIAL|ND_SHADING, NULL);
- prop= RNA_def_property(srna, "file_extensions", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_file_extension", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXTENSION);
RNA_def_property_ui_text(prop, "File Extensions", "Add the file format extensions to the rendered file name (eg: filename + .jpg)");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
@@ -2111,7 +2127,13 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_enum_funcs(prop, NULL, "rna_SceneRenderData_file_format_set", NULL);
RNA_def_property_ui_text(prop, "File Format", "File format to save the rendered images as.");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
-
+
+ prop= RNA_def_property(srna, "file_extension", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, "rna_SceneRender_file_ext_get", "rna_SceneRender_file_ext_length", NULL);
+ RNA_def_property_ui_text(prop, "Extension", "The file extension used for saving renders.");
+ RNA_def_struct_name_property(srna, prop);
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+
prop= RNA_def_property(srna, "free_image_textures", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE);
RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing.");
@@ -2317,6 +2339,9 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_use_game_engine_get", NULL);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine.");
+
+ /* Scene API */
+ RNA_api_scene_render(srna);
}
diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c
index 4efbed167a6..84dc3e6971e 100644
--- a/source/blender/makesrna/intern/rna_scene_api.c
+++ b/source/blender/makesrna/intern/rna_scene_api.c
@@ -36,12 +36,15 @@
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
+#include "BKE_utildefines.h"
#ifdef RNA_RUNTIME
#include "BKE_animsys.h"
#include "BKE_scene.h"
+#include "BKE_image.h"
#include "BKE_depsgraph.h"
+#include "BKE_writeavi.h"
#include "ED_object.h"
#include "ED_anim_api.h"
@@ -84,6 +87,14 @@ static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports,
}
}
+static void rna_SceneRender_get_frame_path(RenderData *rd, int frame, char *name)
+{
+ if(BKE_imtype_is_movie(rd->imtype))
+ BKE_makeanimstring(name, rd);
+ else
+ BKE_makepicstring(name, rd->pic, (frame==INT_MIN) ? rd->cfra : frame, rd->imtype, rd->scemode & R_EXTENSION);
+}
+
#else
void RNA_api_scene(StructRNA *srna)
@@ -113,5 +124,18 @@ void RNA_api_scene(StructRNA *srna)
RNA_def_boolean(func, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'.");
}
+void RNA_api_scene_render(StructRNA *srna)
+{
+ FunctionRNA *func;
+ PropertyRNA *parm;
+
+ func= RNA_def_function(srna, "frame_path", "rna_SceneRender_get_frame_path");
+ RNA_def_function_ui_description(func, "Set scene frame updating all objects immediately.");
+ parm= RNA_def_int(func, "frame", INT_MIN, INT_MIN, INT_MAX, "", "Frame number to use, if unset the current frame will be used.", MINAFRAME, MAXFRAME);
+ parm= RNA_def_string(func, "name", "", FILE_MAX, "File Name", "the resulting filename from the scenes render settings.");
+ RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */
+ RNA_def_function_return_mark(func, parm);
+}
+
#endif
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c
index e63e5802507..ebb7c1e8478 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_outputFile.c
@@ -62,7 +62,7 @@ static void node_composit_exec_output_file(void *data, bNode *node, bNodeStack *
}
}
- BKE_makepicstring((Scene *)node->id, string, nif->name, rd->cfra, nif->imtype);
+ BKE_makepicstring(string, nif->name, rd->cfra, nif->imtype, ((Scene *)node->id)->r.scemode & R_EXTENSION);
if(0 == BKE_write_ibuf((Scene *)node->id, ibuf, string, nif->imtype, nif->subimtype, nif->imtype==R_OPENEXR?nif->codec:nif->quality))
printf("Cannot save Node File Output to %s\n", string);
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 5e255baf341..34e4599f463 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -2325,6 +2325,8 @@ static int foreach_compat_buffer(RawPropertyType raw_type, int attr_signed, cons
return (f=='f') ? 1:0;
case PROP_RAW_DOUBLE:
return (f=='d') ? 1:0;
+ case PROP_RAW_UNSET:
+ return 0;
}
return 0;
@@ -2389,6 +2391,9 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
case PROP_RAW_DOUBLE:
((double *)array)[i]= (double)PyFloat_AsDouble(item);
break;
+ case PROP_RAW_UNSET:
+ /* should never happen */
+ break;
}
Py_DECREF(item);
@@ -2440,6 +2445,9 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
case PROP_RAW_DOUBLE:
item= PyFloat_FromDouble( (double) ((double *)array)[i] );
break;
+ case PROP_RAW_UNSET:
+ /* should never happen */
+ break;
}
PySequence_SetItem(seq, i, item);
@@ -2584,7 +2592,7 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
{
PyObject *ret;
int type = RNA_property_type(prop);
-
+ int flag = RNA_property_flag(prop);
int a;
if(RNA_property_array_check(ptr, prop)) {
@@ -2647,7 +2655,10 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
break;
case PROP_STRING:
{
- ret = PyUnicode_FromString( *(char**)data );
+ if(flag & PROP_THICK_WRAP)
+ ret = PyUnicode_FromString( (char*)data );
+ else
+ ret = PyUnicode_FromString( *(char**)data );
break;
}
case PROP_ENUM:
@@ -2659,7 +2670,6 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
{
PointerRNA newptr;
StructRNA *type= RNA_property_pointer_type(ptr, prop);
- int flag = RNA_property_flag(prop);
if(flag & PROP_RNAPTR) {
/* in this case we get the full ptr */
diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c
index 3f9a6de3c2a..bd1705db13a 100644
--- a/source/blender/quicktime/apple/quicktime_export.c
+++ b/source/blender/quicktime/apple/quicktime_export.c
@@ -488,7 +488,7 @@ static void QT_EndAddVideoSamplesToMedia (void)
}
-void makeqtstring (RenderData *rd, char *string) {
+void filepath_qt(char *string, RenderData *rd) {
char txt[64];
if (string==0) return;
@@ -539,7 +539,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R
sframe = (rd->sfra);
- makeqtstring(rd, name);
+ filepath_qt(name, rd);
#ifdef __APPLE__
EnterMoviesOnThread(0);
diff --git a/source/blender/quicktime/quicktime_export.h b/source/blender/quicktime/quicktime_export.h
index 2ccda8eb526..cf4f55769ba 100644
--- a/source/blender/quicktime/quicktime_export.h
+++ b/source/blender/quicktime/quicktime_export.h
@@ -50,6 +50,7 @@ struct ReportList;
int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, struct ReportList *reports); //for movie handle (BKE writeavi.c now)
int append_qt(struct RenderData *rd, int frame, int *pixels, int rectx, int recty, struct ReportList *reports);
void end_qt(void);
+static void filepath_qt(char *string, struct RenderData *rd);
/*RNA helper functions */
void quicktime_verify_image_type(struct RenderData *rd); //used by RNA for defaults values init, if needed
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 73f253209e8..54f89a65566 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -2777,7 +2777,7 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, R
printf("Append frame %d", scene->r.cfra);
}
else {
- BKE_makepicstring(scene, name, scene->r.pic, scene->r.cfra, scene->r.imtype);
+ BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION);
if(re->r.imtype==R_MULTILAYER) {
if(re->result) {
@@ -2810,7 +2810,7 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, R
if(ok && scene->r.imtype==R_OPENEXR && (scene->r.subimtype & R_PREVIEW_JPG)) {
if(BLI_testextensie(name, ".exr"))
name[strlen(name)-4]= 0;
- BKE_add_image_extension(scene, name, R_JPEG90);
+ BKE_add_image_extension(name, R_JPEG90);
ibuf->depth= 24;
BKE_write_ibuf(scene, ibuf, name, R_JPEG90, scene->r.subimtype, scene->r.quality);
printf("\nSaved: %s", name);
@@ -2895,7 +2895,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra, Repo
/* Touch/NoOverwrite options are only valid for image's */
if(BKE_imtype_is_movie(scene->r.imtype) == 0) {
if(scene->r.mode & (R_NO_OVERWRITE | R_TOUCH))
- BKE_makepicstring(scene, name, scene->r.pic, scene->r.cfra, scene->r.imtype);
+ BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype, scene->r.scemode & R_EXTENSION);
if(scene->r.mode & R_NO_OVERWRITE && BLI_exist(name)) {
printf("skipping existing frame \"%s\"\n", name);