Merge branch 'blender-v2.93-release'
This commit is contained in:
commit
89bc6b5508
|
@ -557,12 +557,18 @@ static void mesh_batch_cache_discard_surface_batches(MeshBatchCache *cache)
|
|||
static void mesh_batch_cache_discard_shaded_tri(MeshBatchCache *cache)
|
||||
{
|
||||
FOREACH_MESH_BUFFER_CACHE (cache, mbufcache) {
|
||||
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.pos_nor);
|
||||
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.uv);
|
||||
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.tan);
|
||||
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.vcol);
|
||||
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.orco);
|
||||
}
|
||||
/* Discard batches using vbo.uv. */
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edituv_faces);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edituv_faces_stretch_area);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edituv_faces_stretch_angle);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edituv_edges);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edituv_verts);
|
||||
|
||||
mesh_batch_cache_discard_surface_batches(cache);
|
||||
mesh_cd_layers_type_clear(&cache->cd_used);
|
||||
}
|
||||
|
@ -659,8 +665,17 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, eMeshBatchDirtyMode mode)
|
|||
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.lnor);
|
||||
}
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.surface);
|
||||
/* Discard batches using vbo.pos_nor. */
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.wire_loops);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.wire_edges);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.all_verts);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.all_edges);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.loose_edges);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edge_detection);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.surface_weights);
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_mesh_analysis);
|
||||
/* Discard batches using vbo.lnor. */
|
||||
GPU_BATCH_DISCARD_SAFE(cache->batch.edit_lnor);
|
||||
mesh_batch_cache_discard_surface_batches(cache);
|
||||
cache->batch_ready &= ~(MBC_SURFACE | MBC_WIRE_EDGES | MBC_WIRE_LOOPS);
|
||||
break;
|
||||
|
|
|
@ -6830,6 +6830,7 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
|
|||
|
||||
uiLayout *ui_abs = uiLayoutAbsolute(layout, false);
|
||||
uiBlock *block = uiLayoutGetBlock(ui_abs);
|
||||
eUIEmbossType previous_emboss = UI_block_emboss_get(block);
|
||||
|
||||
UI_fontstyle_set(&style->widgetlabel);
|
||||
int width = BLF_width(style->widgetlabel.uifont_id, report->message, report->len);
|
||||
|
@ -6904,6 +6905,8 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
|
|||
width + UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
"Show in Info Log");
|
||||
|
||||
UI_block_emboss_set(block, previous_emboss);
|
||||
}
|
||||
|
||||
void uiTemplateInputStatus(uiLayout *layout, struct bContext *C)
|
||||
|
|
|
@ -95,6 +95,7 @@ typedef struct SequencerAddData {
|
|||
#define SEQPROP_NOPATHS (1 << 2)
|
||||
#define SEQPROP_NOCHAN (1 << 3)
|
||||
#define SEQPROP_FIT_METHOD (1 << 4)
|
||||
#define SEQPROP_VIEW_TRANSFORM (1 << 4)
|
||||
|
||||
static const EnumPropertyItem scale_fit_methods[] = {
|
||||
{SEQ_SCALE_TO_FIT, "FIT", 0, "Scale to Fit", "Scale image to fit within the canvas"},
|
||||
|
@ -152,6 +153,14 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
|
|||
"Fit Method",
|
||||
"Scale fit method");
|
||||
}
|
||||
|
||||
if (flag & SEQPROP_VIEW_TRANSFORM) {
|
||||
ot->prop = RNA_def_boolean(ot->srna,
|
||||
"set_view_transform",
|
||||
true,
|
||||
"Set view transform",
|
||||
"Set appropriate view transform based on media colorspace");
|
||||
}
|
||||
}
|
||||
|
||||
static void sequencer_generic_invoke_path__internal(bContext *C,
|
||||
|
@ -284,6 +293,11 @@ static void load_data_init_from_operator(SeqLoadData *load_data, bContext *C, wm
|
|||
load_data->flags |= SEQ_LOAD_MOVIE_SYNC_FPS;
|
||||
}
|
||||
|
||||
if ((prop = RNA_struct_find_property(op->ptr, "set_view_transform")) &&
|
||||
RNA_property_boolean_get(op->ptr, prop)) {
|
||||
load_data->flags |= SEQ_LOAD_SET_VIEW_TRANSFORM;
|
||||
}
|
||||
|
||||
if ((prop = RNA_struct_find_property(op->ptr, "use_multiview")) &&
|
||||
RNA_property_boolean_get(op->ptr, prop)) {
|
||||
if (op->customdata) {
|
||||
|
@ -368,8 +382,23 @@ static int sequencer_add_scene_strip_exec(bContext *C, wmOperator *op)
|
|||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
static void sequencer_disable_one_time_properties(bContext *C, wmOperator *op)
|
||||
{
|
||||
Editing *ed = SEQ_editing_get(CTX_data_scene(C), false);
|
||||
/* Disable following properties if there are any existing strips, unless overridden by user. */
|
||||
if (ed && ed->seqbasep && ed->seqbasep->first) {
|
||||
if (RNA_struct_find_property(op->ptr, "use_framerate")) {
|
||||
RNA_boolean_set(op->ptr, "use_framerate", false);
|
||||
}
|
||||
if (RNA_struct_find_property(op->ptr, "set_view_transform")) {
|
||||
RNA_boolean_set(op->ptr, "set_view_transform", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int sequencer_add_scene_strip_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
sequencer_disable_one_time_properties(C, op);
|
||||
if (!RNA_struct_property_is_set(op->ptr, "scene")) {
|
||||
return WM_enum_search_invoke(C, op, event);
|
||||
}
|
||||
|
@ -702,13 +731,9 @@ static int sequencer_add_movie_strip_invoke(bContext *C,
|
|||
{
|
||||
PropertyRNA *prop;
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
Editing *ed = SEQ_editing_get(scene, false);
|
||||
|
||||
/* Only enable "use_framerate" if there aren't any existing strips, unless overridden by user.
|
||||
*/
|
||||
if (ed && ed->seqbasep && ed->seqbasep->first) {
|
||||
RNA_boolean_set(op->ptr, "use_framerate", false);
|
||||
}
|
||||
sequencer_disable_one_time_properties(C, op);
|
||||
|
||||
RNA_enum_set(op->ptr, "fit_method", SEQ_tool_settings_fit_method_get(scene));
|
||||
|
||||
/* This is for drag and drop. */
|
||||
|
@ -775,7 +800,8 @@ void SEQUENCER_OT_movie_strip_add(struct wmOperatorType *ot)
|
|||
WM_FILESEL_SHOW_PROPS | WM_FILESEL_DIRECTORY,
|
||||
FILE_DEFAULTDISPLAY,
|
||||
FILE_SORT_DEFAULT);
|
||||
sequencer_generic_props__internal(ot, SEQPROP_STARTFRAME | SEQPROP_FIT_METHOD);
|
||||
sequencer_generic_props__internal(
|
||||
ot, SEQPROP_STARTFRAME | SEQPROP_FIT_METHOD | SEQPROP_VIEW_TRANSFORM);
|
||||
RNA_def_boolean(ot->srna, "sound", true, "Sound", "Load sound with the movie");
|
||||
RNA_def_boolean(ot->srna,
|
||||
"use_framerate",
|
||||
|
@ -1053,6 +1079,8 @@ static int sequencer_add_image_strip_invoke(bContext *C,
|
|||
PropertyRNA *prop;
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
|
||||
sequencer_disable_one_time_properties(C, op);
|
||||
|
||||
const SequencerToolSettings *tool_settings = scene->toolsettings->sequencer_tool_settings;
|
||||
RNA_enum_set(op->ptr, "fit_method", tool_settings->fit_method);
|
||||
|
||||
|
@ -1100,8 +1128,8 @@ void SEQUENCER_OT_image_strip_add(struct wmOperatorType *ot)
|
|||
WM_FILESEL_SHOW_PROPS | WM_FILESEL_DIRECTORY,
|
||||
FILE_DEFAULTDISPLAY,
|
||||
FILE_SORT_DEFAULT);
|
||||
sequencer_generic_props__internal(ot,
|
||||
SEQPROP_STARTFRAME | SEQPROP_ENDFRAME | SEQPROP_FIT_METHOD);
|
||||
sequencer_generic_props__internal(
|
||||
ot, SEQPROP_STARTFRAME | SEQPROP_ENDFRAME | SEQPROP_FIT_METHOD | SEQPROP_VIEW_TRANSFORM);
|
||||
|
||||
RNA_def_boolean(ot->srna,
|
||||
"use_placeholders",
|
||||
|
|
|
@ -36,6 +36,7 @@ typedef enum eSeqLoadFlags {
|
|||
SEQ_LOAD_SOUND_CACHE = (1 << 1),
|
||||
SEQ_LOAD_SOUND_MONO = (1 << 2),
|
||||
SEQ_LOAD_MOVIE_SYNC_FPS = (1 << 3),
|
||||
SEQ_LOAD_SET_VIEW_TRANSFORM = (1 << 4),
|
||||
} eSeqLoadFlags;
|
||||
|
||||
/* Api for adding new sequence strips. */
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
#include "DEG_depsgraph_query.h"
|
||||
|
||||
#include "IMB_colormanagement.h"
|
||||
#include "IMB_imbuf.h"
|
||||
#include "IMB_imbuf_types.h"
|
||||
#include "IMB_metadata.h"
|
||||
|
@ -128,6 +129,24 @@ static void seq_add_set_name(Sequence *seq, SeqLoadData *load_data)
|
|||
}
|
||||
}
|
||||
|
||||
static void seq_add_set_view_transform(Scene *scene, Sequence *seq, SeqLoadData *load_data)
|
||||
{
|
||||
const char *strip_colorspace = seq->strip->colorspace_settings.name;
|
||||
|
||||
if (load_data->flags & SEQ_LOAD_SET_VIEW_TRANSFORM) {
|
||||
const char *role_colorspace_byte;
|
||||
role_colorspace_byte = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_BYTE);
|
||||
|
||||
if (STREQ(strip_colorspace, role_colorspace_byte)) {
|
||||
struct ColorManagedDisplay *display = IMB_colormanagement_display_get_named(
|
||||
scene->display_settings.display_device);
|
||||
const char *default_view_transform =
|
||||
IMB_colormanagement_display_get_default_view_transform_name(display);
|
||||
STRNCPY(scene->view_settings.view_transform, default_view_transform);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add scene strip.
|
||||
*
|
||||
|
@ -344,6 +363,7 @@ Sequence *SEQ_add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
|
|||
|
||||
/* Set Last active directory. */
|
||||
BLI_strncpy(scene->ed->act_imagedir, seq->strip->dir, sizeof(scene->ed->act_imagedir));
|
||||
seq_add_set_view_transform(scene, seq, load_data);
|
||||
seq_add_set_name(seq, load_data);
|
||||
seq_add_generic_update(scene, seqbase, seq);
|
||||
|
||||
|
@ -559,6 +579,7 @@ Sequence *SEQ_add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
|
|||
strip->stripdata->orig_height = orig_height;
|
||||
BLI_split_dirfile(load_data->path, strip->dir, se->name, sizeof(strip->dir), sizeof(se->name));
|
||||
|
||||
seq_add_set_view_transform(scene, seq, load_data);
|
||||
seq_add_set_name(seq, load_data);
|
||||
seq_add_generic_update(scene, seqbase, seq);
|
||||
|
||||
|
|
Loading…
Reference in New Issue