2011-11-07 12:55:18 +00:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup RNA
|
2011-11-07 12:55:18 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
2013-03-07 02:44:55 +00:00
|
|
|
#include "DNA_movieclip_types.h"
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
2018-04-05 16:34:36 +02:00
|
|
|
#include "RNA_access.h"
|
2011-11-07 12:55:18 +00:00
|
|
|
#include "RNA_define.h"
|
|
|
|
|
|
|
|
#include "rna_internal.h"
|
|
|
|
|
2013-04-05 17:56:54 +00:00
|
|
|
#include "BKE_movieclip.h"
|
|
|
|
#include "BKE_tracking.h"
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
|
|
#include "IMB_imbuf_types.h"
|
|
|
|
#include "IMB_imbuf.h"
|
2018-04-05 16:34:36 +02:00
|
|
|
#include "IMB_metadata.h"
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
#ifdef RNA_RUNTIME
|
|
|
|
|
2017-06-08 10:14:53 +02:00
|
|
|
#include "DEG_depsgraph.h"
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2013-04-04 09:50:51 +00:00
|
|
|
#include "ED_clip.h"
|
|
|
|
|
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
static void rna_MovieClip_reload_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
|
2011-11-07 12:55:18 +00:00
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2018-06-05 15:10:33 +02:00
|
|
|
BKE_movieclip_reload(bmain, clip);
|
2017-06-08 10:14:53 +02:00
|
|
|
DEG_id_tag_update(&clip->id, 0);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_MovieClip_size_get(PointerRNA *ptr, int *values)
|
|
|
|
{
|
2012-05-12 11:01:29 +00:00
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
values[0] = clip->lastsize[0];
|
|
|
|
values[1] = clip->lastsize[1];
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
2018-11-20 10:32:24 +01:00
|
|
|
static float rna_MovieClip_fps_get(PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
MovieClip *clip = (MovieClip *)ptr->id.data;
|
|
|
|
return BKE_movieclip_get_fps(clip);
|
|
|
|
}
|
|
|
|
|
2013-04-04 09:50:51 +00:00
|
|
|
static void rna_MovieClipUser_proxy_render_settings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
|
|
|
|
{
|
|
|
|
ID *id = (ID *) ptr->id.data;
|
|
|
|
MovieClipUser *user = (MovieClipUser *) ptr->data;
|
|
|
|
|
|
|
|
/* when changing render settings of space clip user
|
|
|
|
* clear cache for clip, so all the memory is available
|
|
|
|
* for new render settings
|
|
|
|
*/
|
|
|
|
if (GS(id->name) == ID_SCR) {
|
|
|
|
bScreen *screen = (bScreen *) id;
|
|
|
|
ScrArea *area;
|
|
|
|
SpaceLink *sl;
|
|
|
|
|
|
|
|
for (area = screen->areabase.first; area; area = area->next) {
|
|
|
|
for (sl = area->spacedata.first; sl; sl = sl->next) {
|
|
|
|
if (sl->spacetype == SPACE_CLIP) {
|
|
|
|
SpaceClip *sc = (SpaceClip *) sl;
|
|
|
|
|
|
|
|
if (&sc->user == user) {
|
|
|
|
MovieClip *clip = ED_space_clip_get_clip(sc);
|
|
|
|
|
|
|
|
if (clip && (clip->flag & MCLIP_USE_PROXY))
|
|
|
|
BKE_movieclip_clear_cache(clip);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-05 16:34:36 +02:00
|
|
|
static PointerRNA rna_MovieClip_metadata_get(MovieClip *clip)
|
|
|
|
{
|
|
|
|
if (clip == NULL || clip->anim == NULL) {
|
|
|
|
return PointerRNA_NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
IDProperty *metadata = IMB_anim_load_metadata(clip->anim);
|
|
|
|
if (metadata == NULL) {
|
|
|
|
return PointerRNA_NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
PointerRNA ptr;
|
|
|
|
RNA_pointer_create(NULL, &RNA_IDPropertyWrapPtr, metadata, &ptr);
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
|
2011-11-07 12:55:18 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
static void rna_def_movieclip_proxy(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
static const EnumPropertyItem clip_tc_items[] = {
|
2011-11-07 12:55:18 +00:00
|
|
|
{IMB_TC_NONE, "NONE", 0, "No TC in use", ""},
|
2011-11-08 23:27:31 +00:00
|
|
|
{IMB_TC_RECORD_RUN, "RECORD_RUN", 0, "Record Run", "Use images in the order they are recorded"},
|
|
|
|
{IMB_TC_FREE_RUN, "FREE_RUN", 0, "Free Run", "Use global timestamp written by recording device"},
|
2012-03-18 09:27:36 +00:00
|
|
|
{IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN, "FREE_RUN_REC_DATE", 0, "Free Run (rec date)",
|
|
|
|
"Interpolate a global timestamp using the record date and time "
|
|
|
|
"written by recording device"},
|
|
|
|
{IMB_TC_RECORD_RUN_NO_GAPS, "FREE_RUN_NO_GAPS", 0, "Free Run No Gaps",
|
|
|
|
"Record run, but ignore timecode, changes in framerate or dropouts"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
srna = RNA_def_struct(brna, "MovieClipProxy", NULL);
|
|
|
|
RNA_def_struct_ui_text(srna, "Movie Clip Proxy", "Proxy parameters for a movie clip");
|
|
|
|
RNA_def_struct_sdna(srna, "MovieClipProxy");
|
|
|
|
|
|
|
|
/* build proxy sized */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_25", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_25);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original footage dimension");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_50", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_50);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original footage dimension");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_75", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_75);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original footage dimension");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_100", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_SIZE_100);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "100%", "Build proxy resolution 100% of the original footage dimension");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_undistorted_25", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_25);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_ui_text(prop, "25%", "Build proxy resolution 25% of the original undistorted footage dimension");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_undistorted_50", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_50);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_ui_text(prop, "50%", "Build proxy resolution 50% of the original undistorted footage dimension");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_undistorted_75", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_75);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_ui_text(prop, "75%", "Build proxy resolution 75% of the original undistorted footage dimension");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_undistorted_100", PROP_BOOLEAN, PROP_NONE);
|
2012-02-01 18:08:37 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_size_flag", MCLIP_PROXY_UNDISTORTED_SIZE_100);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "100%",
|
|
|
|
"Build proxy resolution 100% of the original undistorted footage dimension");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* build timecodes */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_record_run", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_RECORD_RUN);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Rec Run", "Build record run time code index");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_free_run", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_FREE_RUN);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Free Run", "Build free run time code index");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "build_free_run_rec_date", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "build_tc_flag", IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Free Run (Rec Date)", "Build free run time code index using Record Date/Time");
|
|
|
|
|
|
|
|
/* quality of proxied image */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "quality", PROP_INT, PROP_UNSIGNED);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "quality");
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-15 20:02:45 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Quality", "JPEG quality of proxy images");
|
2013-04-08 18:55:08 +00:00
|
|
|
RNA_def_property_ui_range(prop, 1, 100, 1, -1);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "timecode", PROP_ENUM, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "tc");
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_enum_items(prop, clip_tc_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Timecode", "");
|
2015-05-20 17:52:27 +05:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* directory */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "directory", PROP_STRING, PROP_DIRPATH);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "dir");
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Directory", "Location to store the proxy files");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_moviecliUser(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem clip_render_size_items[] = {
|
2018-09-27 12:44:51 +02:00
|
|
|
{MCLIP_PROXY_RENDER_SIZE_25, "PROXY_25", 0, "25%", ""},
|
|
|
|
{MCLIP_PROXY_RENDER_SIZE_50, "PROXY_50", 0, "50%", ""},
|
|
|
|
{MCLIP_PROXY_RENDER_SIZE_75, "PROXY_75", 0, "75%", ""},
|
|
|
|
{MCLIP_PROXY_RENDER_SIZE_100, "PROXY_100", 0, "100%", ""},
|
|
|
|
{MCLIP_PROXY_RENDER_SIZE_FULL, "FULL", 0, "None, full render", ""},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieClipUser", NULL);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "Movie Clip User",
|
2015-10-24 02:44:43 +11:00
|
|
|
"Parameters defining how a MovieClip data-block is used by another data-block");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-09-20 12:16:00 +00:00
|
|
|
prop = RNA_def_property(srna, "frame_current", PROP_INT, PROP_TIME);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "framenr");
|
|
|
|
RNA_def_property_range(prop, MINAFRAME, MAXFRAME);
|
|
|
|
RNA_def_property_ui_text(prop, "Current Frame", "Current frame number in movie or image sequence");
|
|
|
|
|
|
|
|
/* render size */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "proxy_render_size", PROP_ENUM, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_enum_sdna(prop, NULL, "render_size");
|
|
|
|
RNA_def_property_enum_items(prop, clip_render_size_items);
|
2018-07-13 01:36:34 +02:00
|
|
|
RNA_def_property_ui_text(prop, "Proxy Render Size",
|
2012-03-18 09:27:36 +00:00
|
|
|
"Draw preview using full resolution or different proxy resolutions");
|
2013-04-04 09:50:51 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClipUser_proxy_render_settings_update");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* render undistorted */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_render_undistorted", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "render_flag", MCLIP_PROXY_RENDER_UNDISTORT);
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Render Undistorted", "Render preview using undistorted proxy");
|
2013-04-04 09:50:51 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClipUser_proxy_render_settings_update");
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void rna_def_movieClipScopes(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieClipScopes", NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_ui_text(srna, "MovieClipScopes", "Scopes for statistical view of a movie clip");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void rna_def_movieclip(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
StructRNA *srna;
|
|
|
|
PropertyRNA *prop;
|
2018-04-05 16:34:36 +02:00
|
|
|
FunctionRNA *func;
|
|
|
|
PropertyRNA *parm;
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2017-10-18 15:07:26 +11:00
|
|
|
static const EnumPropertyItem clip_source_items[] = {
|
2011-11-07 12:55:18 +00:00
|
|
|
{MCLIP_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"},
|
|
|
|
{MCLIP_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"},
|
2019-02-03 14:01:45 +11:00
|
|
|
{0, NULL, 0, NULL, NULL},
|
2012-05-12 11:01:29 +00:00
|
|
|
};
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
srna = RNA_def_struct(brna, "MovieClip", "ID");
|
2015-10-24 02:44:43 +11:00
|
|
|
RNA_def_struct_ui_text(srna, "MovieClip", "MovieClip data-block referencing an external movie file");
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_struct_ui_icon(srna, ICON_SEQUENCE);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_string_sdna(prop, NULL, "name");
|
2011-11-15 12:20:58 +00:00
|
|
|
RNA_def_property_ui_text(prop, "File Path", "Filename of the movie or sequence file");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "tracking", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieTracking");
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "proxy", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_struct_type(prop, "MovieClipProxy");
|
|
|
|
|
|
|
|
/* use proxy */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_proxy", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Use Proxy / Timecode",
|
|
|
|
"Use a preview proxy and/or timecode index for this clip");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
2012-04-29 15:47:02 +00:00
|
|
|
prop = RNA_def_int_vector(srna, "size", 2, NULL, 0, 0, "Size",
|
|
|
|
"Width and height in pixels, zero when image data cant be loaded", 0, 0);
|
|
|
|
RNA_def_property_int_funcs(prop, "rna_MovieClip_size_get", NULL, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_float_sdna(prop, NULL, "aspx");
|
|
|
|
RNA_def_property_array(prop, 2);
|
2013-11-25 05:26:25 +01:00
|
|
|
RNA_def_property_range(prop, 0.1f, FLT_MAX);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
|
|
|
|
RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this clip, does not affect rendering");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* source */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_enum_items(prop, clip_source_items);
|
|
|
|
RNA_def_property_ui_text(prop, "Source", "Where the clip comes from");
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
|
|
|
|
/* custom proxy directory */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "use_proxy_custom_directory", PROP_BOOLEAN, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_boolean_sdna(prop, NULL, "flag", MCLIP_USE_PROXY_CUSTOM_DIR);
|
2012-02-17 08:13:45 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
|
2012-03-18 09:27:36 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Proxy Custom Directory",
|
|
|
|
"Create proxy images in a custom directory (default is movie location)");
|
2012-05-12 11:01:29 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");
|
2011-11-07 12:55:18 +00:00
|
|
|
|
|
|
|
/* grease pencil */
|
2012-03-05 23:30:41 +00:00
|
|
|
prop = RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "gpd");
|
|
|
|
RNA_def_property_struct_type(prop, "GreasePencil");
|
2018-07-31 10:22:19 +02:00
|
|
|
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_GPencil_datablocks_annotations_poll");
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-12-01 01:52:06 +13:00
|
|
|
RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
|
2011-11-07 12:55:18 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this movie clip");
|
2012-06-10 15:26:50 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
|
2012-06-05 18:38:09 +00:00
|
|
|
|
2012-06-12 21:25:23 +00:00
|
|
|
/* start_frame */
|
2012-08-04 10:47:31 +00:00
|
|
|
prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE);
|
2012-06-05 18:38:09 +00:00
|
|
|
RNA_def_property_int_sdna(prop, NULL, "start_frame");
|
2012-06-18 20:22:23 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Start Frame", "Global scene frame number at which this movie starts playing "
|
|
|
|
"(affects all data associated with a clip)");
|
2012-06-12 21:25:23 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");
|
|
|
|
|
|
|
|
/* frame_offset */
|
|
|
|
prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "frame_offset");
|
2012-06-18 20:22:23 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Frame Offset", "Offset of footage first frame relative to it's file name "
|
|
|
|
"(affects only how footage is loading, does not change data associated with a clip)");
|
2012-06-05 18:38:09 +00:00
|
|
|
RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_MovieClip_reload_update");
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2012-09-24 15:26:54 +00:00
|
|
|
/* length */
|
2012-09-24 22:41:10 +00:00
|
|
|
prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE);
|
2012-09-24 15:26:54 +00:00
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_int_sdna(prop, NULL, "len");
|
|
|
|
RNA_def_property_ui_text(prop, "Duration", "Detected duration of movie clip in frames");
|
|
|
|
|
2018-11-20 10:32:24 +01:00
|
|
|
/* FPS */
|
|
|
|
prop = RNA_def_property(srna, "fps", PROP_FLOAT, PROP_NONE);
|
|
|
|
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
|
|
|
|
RNA_def_property_float_funcs(prop, "rna_MovieClip_fps_get", NULL, NULL);
|
|
|
|
RNA_def_property_ui_text(prop, "Frame Rate", "Detected frame rate of the movie clip in frames per second");
|
|
|
|
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
/* color management */
|
|
|
|
prop = RNA_def_property(srna, "colorspace_settings", PROP_POINTER, PROP_NONE);
|
|
|
|
RNA_def_property_pointer_sdna(prop, NULL, "colorspace_settings");
|
2012-12-24 15:51:27 +00:00
|
|
|
RNA_def_property_struct_type(prop, "ColorManagedInputColorspaceSettings");
|
2012-09-18 07:14:16 +00:00
|
|
|
RNA_def_property_ui_text(prop, "Color Space Settings", "Input color space settings");
|
2016-08-29 13:03:50 +02:00
|
|
|
|
2018-04-05 16:34:36 +02:00
|
|
|
/* metadata */
|
|
|
|
func = RNA_def_function(srna, "metadata", "rna_MovieClip_metadata_get");
|
|
|
|
RNA_def_function_ui_description(func, "Retrieve metadata of the movie file");
|
|
|
|
/* return type */
|
|
|
|
parm = RNA_def_pointer(func, "metadata", "IDPropertyWrapPtr", "", "Dict-like object containing the metadata");
|
|
|
|
RNA_def_parameter_flags(parm, 0, PARM_RNAPTR);
|
|
|
|
RNA_def_function_return(func, parm);
|
|
|
|
|
2016-08-29 13:03:50 +02:00
|
|
|
rna_def_animdata_common(srna);
|
2011-11-07 12:55:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void RNA_def_movieclip(BlenderRNA *brna)
|
|
|
|
{
|
|
|
|
rna_def_movieclip(brna);
|
|
|
|
rna_def_movieclip_proxy(brna);
|
|
|
|
rna_def_moviecliUser(brna);
|
|
|
|
rna_def_movieClipScopes(brna);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|