Merge branch 'master' into blender2.8

This commit is contained in:
Bastien Montagne 2017-08-10 15:57:59 +02:00
commit 4a4c6da0f8
16 changed files with 661 additions and 535 deletions

View File

@ -91,13 +91,7 @@ ifndef NPROCS
ifeq ($(OS), Linux)
NPROCS:=$(shell nproc)
endif
ifeq ($(OS), Darwin)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), FreeBSD)
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
ifeq ($(OS), NetBSD)
ifneq (,$(filter $(OS),Darwin FreeBSD NetBSD))
NPROCS:=$(shell sysctl -n hw.ncpu)
endif
endif

View File

@ -1769,7 +1769,7 @@ compile_LLVM() {
cd $_src
# XXX Ugly patching hack!
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_llvm.patch"
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_llvm.diff"
cd $CWD
@ -1875,7 +1875,7 @@ compile_OSL() {
git reset --hard
# XXX Ugly patching hack!
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_osl.patch"
patch -p1 -i "$SCRIPT_DIR/patches/install_deps_osl.diff"
fi
# Always refresh the whole build!

View File

@ -220,6 +220,7 @@ class USERPREF_PT_interface(Panel):
col = row.column()
col.label(text="Display:")
col.prop(view, "ui_scale", text="Scale")
col.prop(view, "ui_line_width", text="Line Width")
col.prop(view, "show_tooltips")
col.prop(view, "show_tooltips_python")
col.prop(view, "show_object_info", text="Object Info")

View File

@ -335,7 +335,8 @@ bool BKE_sequence_base_shuffle(
bool BKE_sequence_base_shuffle_time(ListBase *seqbasep, struct Scene *evil_scene);
bool BKE_sequence_base_isolated_sel_check(struct ListBase *seqbase);
void BKE_sequencer_free_imbuf(struct Scene *scene, struct ListBase *seqbasep, bool for_render);
struct Sequence *BKE_sequence_dupli_recursive(struct Scene *scene, struct Scene *scene_to, struct Sequence *seq, int dupe_flag);
struct Sequence *BKE_sequence_dupli_recursive(
const struct Scene *scene_src, struct Scene *scene_dst, struct Sequence *seq, int dupe_flag);
int BKE_sequence_swap(struct Sequence *seq_a, struct Sequence *seq_b, const char **error_str);
bool BKE_sequence_check_depend(struct Sequence *seq, struct Sequence *cur);
@ -352,7 +353,7 @@ void BKE_sequencer_refresh_sound_length(struct Scene *scene);
void BKE_sequence_base_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq);
void BKE_sequence_base_dupli_recursive(
const struct Scene *scene, struct Scene *scene_to, struct ListBase *nseqbase, const struct ListBase *seqbase,
const struct Scene *scene_src, struct Scene *scene_dst, struct ListBase *nseqbase, const struct ListBase *seqbase,
int dupe_flag, const int flag);
bool BKE_sequence_is_valid_check(struct Sequence *seq);

View File

@ -248,7 +248,7 @@ static int foreach_libblock_remap_callback(void *user_data, ID *id_self, ID **id
return IDWALK_RET_NOP;
}
/* Some reamapping unfortunately require extra and/or specific handling, tackle those here. */
/* Some remapping unfortunately require extra and/or specific handling, tackle those here. */
static void libblock_remap_data_preprocess_scene_base_unlink(
IDRemap *r_id_remap_data, Scene *sce, BaseLegacy *base, const bool skip_indirect, const bool is_indirect)
{
@ -352,7 +352,7 @@ static void libblock_remap_data_preprocess(IDRemap *r_id_remap_data)
}
}
static void libblock_remap_data_postprocess_object_fromgroup_update(Main *bmain, Object *old_ob, Object *new_ob)
static void libblock_remap_data_postprocess_object_update(Main *bmain, Object *old_ob, Object *new_ob)
{
if (old_ob->flag & OB_FROMGROUP) {
/* Note that for Scene's BaseObject->flag, either we:
@ -371,6 +371,13 @@ static void libblock_remap_data_postprocess_object_fromgroup_update(Main *bmain,
new_ob->flag |= OB_FROMGROUP;
}
}
if (old_ob->type == OB_MBALL) {
for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->type == OB_MBALL && BKE_mball_is_basis_for(ob, old_ob)) {
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
}
}
static void libblock_remap_data_postprocess_group_scene_unlink(Main *UNUSED(bmain), Scene *sce, ID *old_id)
@ -575,7 +582,7 @@ void BKE_libblock_remap_locked(
*/
switch (GS(old_id->name)) {
case ID_OB:
libblock_remap_data_postprocess_object_fromgroup_update(bmain, (Object *)old_id, (Object *)new_id);
libblock_remap_data_postprocess_object_update(bmain, (Object *)old_id, (Object *)new_id);
break;
case ID_GR:
if (!new_id) { /* Only affects us in case group was unlinked. */
@ -685,8 +692,7 @@ void BKE_libblock_relink_ex(
switch (GS(old_id->name)) {
case ID_OB:
{
libblock_remap_data_postprocess_object_fromgroup_update(
bmain, (Object *)old_id, (Object *)new_id);
libblock_remap_data_postprocess_object_update(bmain, (Object *)old_id, (Object *)new_id);
break;
}
case ID_GR:
@ -701,7 +707,7 @@ void BKE_libblock_relink_ex(
else {
/* No choice but to check whole objects/groups. */
for (Object *ob = bmain->object.first; ob; ob = ob->id.next) {
libblock_remap_data_postprocess_object_fromgroup_update(bmain, ob, NULL);
libblock_remap_data_postprocess_object_update(bmain, ob, NULL);
}
for (Group *grp = bmain->group.first; grp; grp = grp->id.next) {
libblock_remap_data_postprocess_group_scene_unlink(bmain, sce, NULL);

View File

@ -5373,9 +5373,8 @@ Sequence *BKE_sequencer_add_movie_strip(bContext *C, ListBase *seqbasep, SeqLoad
return seq;
}
static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dupe_flag, const int flag)
static Sequence *seq_dupli(const Scene *scene_src, Scene *scene_dst, Sequence *seq, int dupe_flag, const int flag)
{
Scene *sce_audio = scene_to ? scene_to : scene;
Sequence *seqn = MEM_dupallocN(seq);
seq->tmp = seqn;
@ -5418,7 +5417,7 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup
else if (seq->type == SEQ_TYPE_SCENE) {
seqn->strip->stripdata = NULL;
if (seq->scene_sound)
seqn->scene_sound = BKE_sound_scene_add_scene_sound_defaults(sce_audio, seqn);
seqn->scene_sound = BKE_sound_scene_add_scene_sound_defaults(scene_dst, seqn);
}
else if (seq->type == SEQ_TYPE_MOVIECLIP) {
/* avoid assert */
@ -5435,7 +5434,7 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup
seqn->strip->stripdata =
MEM_dupallocN(seq->strip->stripdata);
if (seq->scene_sound)
seqn->scene_sound = BKE_sound_add_scene_sound_defaults(sce_audio, seqn);
seqn->scene_sound = BKE_sound_add_scene_sound_defaults(scene_dst, seqn);
if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
id_us_plus((ID *)seqn->sound);
@ -5459,11 +5458,15 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup
BLI_assert(0);
}
if (dupe_flag & SEQ_DUPE_UNIQUE_NAME)
BKE_sequence_base_unique_name_recursive(&scene->ed->seqbase, seqn);
if (scene_src == scene_dst) {
if (dupe_flag & SEQ_DUPE_UNIQUE_NAME) {
BKE_sequence_base_unique_name_recursive(&scene_dst->ed->seqbase, seqn);
}
if (dupe_flag & SEQ_DUPE_ANIM)
BKE_sequencer_dupe_animdata(scene, seq->name + 2, seqn->name + 2);
if (dupe_flag & SEQ_DUPE_ANIM) {
BKE_sequencer_dupe_animdata(scene_dst, seq->name + 2, seqn->name + 2);
}
}
return seqn;
}
@ -5490,16 +5493,16 @@ static void seq_new_fix_links_recursive(Sequence *seq)
}
}
Sequence *BKE_sequence_dupli_recursive(Scene *scene, Scene *scene_to, Sequence *seq, int dupe_flag)
Sequence *BKE_sequence_dupli_recursive(const Scene *scene_src, Scene *scene_dst, Sequence *seq, int dupe_flag)
{
Sequence *seqn;
seq->tmp = NULL;
seqn = seq_dupli(scene, scene_to, seq, dupe_flag, 0);
seqn = seq_dupli(scene_src, scene_dst, seq, dupe_flag, 0);
if (seq->type == SEQ_TYPE_META) {
Sequence *s;
for (s = seq->seqbase.first; s; s = s->next) {
Sequence *n = BKE_sequence_dupli_recursive(scene, scene_to, s, dupe_flag);
Sequence *n = BKE_sequence_dupli_recursive(scene_src, scene_dst, s, dupe_flag);
if (n) {
BLI_addtail(&seqn->seqbase, n);
}
@ -5512,19 +5515,19 @@ Sequence *BKE_sequence_dupli_recursive(Scene *scene, Scene *scene_to, Sequence *
}
void BKE_sequence_base_dupli_recursive(
const Scene *scene, Scene *scene_to, ListBase *nseqbase, const ListBase *seqbase,
const Scene *scene_src, Scene *scene_dst, ListBase *nseqbase, const ListBase *seqbase,
int dupe_flag, const int flag)
{
Sequence *seq;
Sequence *seqn = NULL;
Sequence *last_seq = BKE_sequencer_active_get((Scene *)scene);
Sequence *last_seq = BKE_sequencer_active_get((Scene *)scene_src);
/* always include meta's strips */
int dupe_flag_recursive = dupe_flag | SEQ_DUPE_ALL;
for (seq = seqbase->first; seq; seq = seq->next) {
seq->tmp = NULL;
if ((seq->flag & SELECT) || (dupe_flag & SEQ_DUPE_ALL)) {
seqn = seq_dupli((Scene *)scene, scene_to, seq, dupe_flag, flag);
seqn = seq_dupli(scene_src, scene_dst, seq, dupe_flag, flag);
if (seqn) { /*should never fail */
if (dupe_flag & SEQ_DUPE_CONTEXT) {
seq->flag &= ~SEQ_ALLSEL;
@ -5534,13 +5537,13 @@ void BKE_sequence_base_dupli_recursive(
BLI_addtail(nseqbase, seqn);
if (seq->type == SEQ_TYPE_META) {
BKE_sequence_base_dupli_recursive(
scene, scene_to, &seqn->seqbase, &seq->seqbase,
scene_src, scene_dst, &seqn->seqbase, &seq->seqbase,
dupe_flag_recursive, flag);
}
if (dupe_flag & SEQ_DUPE_CONTEXT) {
if (seq == last_seq) {
BKE_sequencer_active_set(scene_to, seqn);
BKE_sequencer_active_set(scene_dst, seqn);
}
}
}

View File

@ -727,7 +727,7 @@ static Sequence *cut_seq_hard(Scene *scene, Sequence *seq, int cutframe)
if (!skip_dup) {
/* Duplicate AFTER the first change */
seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
}
if (seqn) {
@ -820,7 +820,7 @@ static Sequence *cut_seq_soft(Scene *scene, Sequence *seq, int cutframe)
if (!skip_dup) {
/* Duplicate AFTER the first change */
seqn = BKE_sequence_dupli_recursive(scene, NULL, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
seqn = BKE_sequence_dupli_recursive(scene, scene, seq, SEQ_DUPE_UNIQUE_NAME | SEQ_DUPE_ANIM);
}
if (seqn) {
@ -2139,7 +2139,7 @@ static int sequencer_add_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
if (ed == NULL)
return OPERATOR_CANCELLED;
BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT, 0);
BKE_sequence_base_dupli_recursive(scene, scene, &nseqbase, ed->seqbasep, SEQ_DUPE_CONTEXT, 0);
if (nseqbase.first) {
Sequence *seq = nseqbase.first;
@ -3177,7 +3177,7 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, ed->seqbasep, SEQ_DUPE_UNIQUE_NAME, 0);
BKE_sequence_base_dupli_recursive(scene, scene, &nseqbase, ed->seqbasep, SEQ_DUPE_UNIQUE_NAME, 0);
/* To make sure the copied strips have unique names between each other add
* them temporarily to the end of the original seqbase. (bug 25932)
@ -3244,7 +3244,7 @@ static int sequencer_paste_exec(bContext *C, wmOperator *UNUSED(op))
ED_sequencer_deselect_all(scene);
ofs = scene->r.cfra - seqbase_clipboard_frame;
BKE_sequence_base_dupli_recursive(scene, NULL, &nseqbase, &seqbase_clipboard, SEQ_DUPE_UNIQUE_NAME, 0);
BKE_sequence_base_dupli_recursive(scene, scene, &nseqbase, &seqbase_clipboard, SEQ_DUPE_UNIQUE_NAME, 0);
/* transform pasted strips before adding */
if (ofs) {

File diff suppressed because it is too large Load Diff

View File

@ -49,36 +49,36 @@ static int txtfmt_ini_find_keyword(const char *string)
{
int i, len;
/* Language Directives */
if (STR_LITERAL_STARTSWITH(string, "append", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "break", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "case", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "debug", len)) i = len;
if (STR_LITERAL_STARTSWITH(string, "deprecated", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "statistics", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "declare", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "default", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "deprecated", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "elseif", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "else", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "end", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "error", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "fclose", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "fopen", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "for", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ifdef", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ifndef", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "if", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "version", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "warning", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "include", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "fclose", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ifndef", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "append", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "elseif", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "debug", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "error", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "fopen", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ifdef", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "local", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "macro", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "range", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "read", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "render", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "statistics", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "break", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "switch", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "undef", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "version", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "warning", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "while", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "write", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "case", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "else", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "read", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "end", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "for", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "if", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "I", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "S", len)) i = len;
@ -104,13 +104,47 @@ static int txtfmt_ini_find_reserved(const char *string)
* list is from...
* http://www.povray.org/documentation/view/3.7.0/212/
*/
if (STR_LITERAL_STARTSWITH(string, "Antialias_Threshold", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Bounding_Method", len)) i = len;
if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Create_Continue_Trace_Log", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "HideWhenMainMinimized", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Confidence", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseExtensions", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ReadWriteSourceDir", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionLeft", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionTop", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionRight", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionBottom", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionX", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionY", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Threshold", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Gamma", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Depth", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "input_file_name", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Subset_Start_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Subset_End_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseToolbar", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseTooltips", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Frame_Step", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Cyclic_Animation", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Field_Render", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Odd_Field", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "final_clock", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "final_frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "frame_number", len)) i = len;
@ -118,15 +152,6 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "initial_frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "image_height", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "image_width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "input_file_name", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Subset_Start_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Subset_End_Frame", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Frame_Step", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Cyclic_Animation", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Field_Render", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Odd_Field", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Height", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Start_Column", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Start_Row", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "End_Column", len)) i = len;
@ -134,7 +159,7 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Test_Abort_Count", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Test_Abort", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Continue_Trace", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Create_Continue_Trace_Log", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Bounding_Method", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Create_Ini", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Display_Gamma", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Display", len)) i = len;
@ -151,19 +176,6 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Bits_Per_Color", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Compression", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Dither_Method", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Dither", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Command", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Pre_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Scene_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Post_Frame_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "User_Abort_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Fatal_Error_Return", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Include_Header", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Library_Path", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Debug_Console", len)) i = len;
@ -187,7 +199,9 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Remove_Bounds", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Split_Unions", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Glare_Desaturation", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Sampling_Method", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Stochastic_Seed", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Jitter_Amount", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Jitter", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Antialias_Depth", len)) i = len;
@ -221,25 +235,14 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "Band3Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Band4Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ShowCmd", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionLeft", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionTop", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionRight", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionBottom", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseToolbar", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseTooltips", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionX", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NormalPositionY", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Flags", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Transparency", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Use8BitMode", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "MakeActive", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "KeepAboveMain", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "HideWhenMainMinimized", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "AutoClose", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "PreserveBitmap", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "FontSize", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "FontWeight", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Font", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "KeepMessages", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "AlertSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Completion", len)) i = len;
@ -250,14 +253,6 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "PreventSleep", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NoShelloutWait", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "SystemNoActive", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSoundEnabled", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderCompleteSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ParseErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "RenderErrorSound", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "UseExtensions", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "ReadWriteSourceDir", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "NoShellOuts", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "VideoSource", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "SceneFile", len)) i = len;
@ -269,6 +264,14 @@ static int txtfmt_ini_find_reserved(const char *string)
else if (STR_LITERAL_STARTSWITH(string, "RenderwinClose", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Append_File", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Warning Level", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_delta", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock_on", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "clock", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Height", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Width", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Dither", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Flags", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "Font", len)) i = len;
/* Filetypes */
else if (STR_LITERAL_STARTSWITH(string, "df3", len)) i = len;
else if (STR_LITERAL_STARTSWITH(string, "exr", len)) i = len;

View File

@ -2565,6 +2565,14 @@ const char *IMB_colormanagement_colorspace_get_indexed_name(int index)
void IMB_colormanagment_colorspace_from_ibuf_ftype(ColorManagedColorspaceSettings *colorspace_settings, ImBuf *ibuf)
{
/* Don't modify non-color data space, it does not change with file type. */
ColorSpace *colorspace = colormanage_colorspace_get_named(colorspace_settings->name);
if (colorspace && colorspace->is_data) {
return;
}
/* Get color space from file type. */
const ImFileType *type;
for (type = IMB_FILE_TYPES; type < IMB_FILE_TYPES_LAST; type++) {

View File

@ -588,7 +588,7 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
img_fol_t img_fol; /* only needed for cinema presets */
memset(&img_fol, 0, sizeof(img_fol_t));
if (ibuf->float_colorspace) {
if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) {
/* float buffer was managed already, no need in color space conversion */
chanel_colormanage_cb = channel_colormanage_noop;
}

View File

@ -152,7 +152,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
compression = (int)(((float)(ibuf->foptions.quality) / 11.1111f));
compression = compression < 0 ? 0 : (compression > 9 ? 9 : compression);
if (ibuf->float_colorspace) {
if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) {
/* float buffer was managed already, no need in color space conversion */
chanel_colormanage_cb = channel_colormanage_noop;
}

View File

@ -822,7 +822,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags)
/* convert from float source */
float rgb[4];
if (ibuf->float_colorspace) {
if (ibuf->float_colorspace || (ibuf->colormanage_flag & IMB_COLORMANAGE_IS_DATA)) {
/* float buffer was managed already, no need in color space conversion */
copy_v3_v3(rgb, &fromf[from_i]);
}

View File

@ -481,7 +481,7 @@ typedef struct UserDef {
int scrollback; /* console scrollback limit */
int dpi; /* range 48-128? */
float ui_scale; /* interface scale */
int pad1;
int ui_line_width; /* interface line width */
char node_margin; /* node insert offset (aka auto-offset) margin, but might be useful for later stuff as well */
char pad2;
short transopts; /* eUserpref_Translation_Flags */

View File

@ -3338,6 +3338,13 @@ static void rna_def_userdef_view(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
static EnumPropertyItem line_width[] = {
{-1, "THIN", 0, "Thin", "Thinner lines than the default"},
{ 0, "AUTO", 0, "Auto", "Automatic line width based on UI scale"},
{ 1, "THICK", 0, "Thick", "Thicker lines than the default"},
{0, NULL, 0, NULL, NULL}
};
PropertyRNA *prop;
StructRNA *srna;
@ -3355,6 +3362,12 @@ static void rna_def_userdef_view(BlenderRNA *brna)
RNA_def_property_float_default(prop, 1.0f);
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
prop = RNA_def_property(srna, "ui_line_width", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, line_width);
RNA_def_property_ui_text(prop, "UI Line Width",
"Changes the thickness of lines and points in the interface");
RNA_def_property_update(prop, 0, "rna_userdef_dpi_update");
/* display */
prop = RNA_def_property(srna, "show_tooltips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_TOOLTIPS);

View File

@ -416,12 +416,12 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win)
void WM_window_set_dpi(wmWindow *win)
{
int auto_dpi = GHOST_GetDPIHint(win->ghostwin);
float auto_dpi = GHOST_GetDPIHint(win->ghostwin);
/* Clamp auto DPI to 96, since our font/interface drawing does not work well
* with lower sizes. The main case we are interested in supporting is higher
* DPI. If a smaller UI is desired it is still possible to adjust UI scale. */
auto_dpi = MAX2(auto_dpi, 96);
auto_dpi = max_ff(auto_dpi, 96.0f);
/* Lazily init UI scale size, preserving backwards compatibility by
* computing UI scale from ratio of previous DPI and auto DPI */
@ -441,13 +441,16 @@ void WM_window_set_dpi(wmWindow *win)
/* Blender's UI drawing assumes DPI 72 as a good default following macOS
* while Windows and Linux use DPI 96. GHOST assumes a default 96 so we
* remap the DPI to Blender's convention. */
auto_dpi *= GHOST_GetNativePixelSize(win->ghostwin);
int dpi = auto_dpi * U.ui_scale * (72.0 / 96.0f);
/* Automatically set larger pixel size for high DPI. */
int pixelsize = MAX2(1, dpi / 54);
int pixelsize = max_ii(1, (int)(dpi / 64));
/* User adjustment for pixel size. */
pixelsize = max_ii(1, pixelsize + U.ui_line_width);
/* Set user preferences globals for drawing, and for forward compatibility. */
U.pixelsize = GHOST_GetNativePixelSize(win->ghostwin) * pixelsize;
U.pixelsize = pixelsize;
U.dpi = dpi / pixelsize;
U.virtual_pixel = (pixelsize == 1) ? VIRTUAL_PIXEL_NATIVE : VIRTUAL_PIXEL_DOUBLE;
U.widget_unit = (U.pixelsize * U.dpi * 20 + 36) / 72;