[Bf-blender-cvs] [c097c7b855d] master: Cleanup: correct unbalanced doxygen groups
Commit: c097c7b855d4b01950494dc369e9def59486b0fd Author: Campbell Barton Date: Tue Dec 14 15:49:31 2021 +1100 Branches: master https://developer.blender.org/rBc097c7b855d4b01950494dc369e9def59486b0fd Cleanup: correct unbalanced doxygen groups Also add groups in some files. === M intern/ghost/intern/GHOST_SystemX11.cpp M intern/ghost/intern/GHOST_XrSession.cpp M source/blender/blenkernel/BKE_DerivedMesh.h M source/blender/blenkernel/BKE_lattice.h M source/blender/blenkernel/BKE_node.h M source/blender/blenkernel/BKE_undo_system.h M source/blender/blenkernel/intern/attribute_access.cc M source/blender/blenkernel/intern/blender_user_menu.c M source/blender/blenkernel/intern/bvhutils.cc M source/blender/blenkernel/intern/displist_tangent.c M source/blender/blenkernel/intern/fcurve_driver.c M source/blender/blenkernel/intern/fluid.c M source/blender/blenkernel/intern/geometry_component_curve.cc M source/blender/blenkernel/intern/gpencil.c M source/blender/blenkernel/intern/gpencil_geom.cc M source/blender/blenkernel/intern/icons.cc M source/blender/blenkernel/intern/idprop.c M source/blender/blenkernel/intern/image_gpu.cc M source/blender/blenkernel/intern/layer.c M source/blender/blenkernel/intern/layer_utils.c M source/blender/blenkernel/intern/mesh_evaluate.cc M source/blender/blenkernel/intern/mesh_remap.c M source/blender/blenkernel/intern/mesh_runtime.c M source/blender/blenkernel/intern/mesh_validate.c M source/blender/blenkernel/intern/movieclip.c M source/blender/blenkernel/intern/object.cc M source/blender/blenkernel/intern/object_deform.c M source/blender/blenkernel/intern/undo_system.c M source/blender/blenlib/BLI_dlrbTree.h M source/blender/blenlib/BLI_ghash.h M source/blender/blenlib/BLI_math_geom.h M source/blender/blenlib/BLI_math_matrix.h M source/blender/blenlib/BLI_math_rotation.h M source/blender/blenlib/BLI_math_time.h M source/blender/blenlib/BLI_string.h M source/blender/blenlib/BLI_string_utf8.h M source/blender/blenlib/intern/BLI_ghash.c M source/blender/blenlib/intern/boxpack_2d.c M source/blender/blenlib/intern/math_geom.c M source/blender/blenlib/intern/math_matrix.c M source/blender/blenlib/intern/string.c M source/blender/blenlib/tests/BLI_color_test.cc M source/blender/blenloader/intern/readfile.c M source/blender/bmesh/intern/bmesh_walkers_impl.c M source/blender/bmesh/operators/bmo_connect_pair.c M source/blender/bmesh/tools/bmesh_bisect_plane.c M source/blender/bmesh/tools/bmesh_path.c M source/blender/bmesh/tools/bmesh_path_uv.c M source/blender/bmesh/tools/bmesh_region_match.c M source/blender/draw/engines/eevee/eevee_lightprobes.c M source/blender/draw/engines/eevee/eevee_shaders.c M source/blender/draw/engines/overlay/overlay_armature.c M source/blender/draw/intern/draw_cache.c M source/blender/draw/intern/draw_cache_extract_mesh.cc M source/blender/draw/intern/draw_cache_extract_mesh_render_data.c M source/blender/draw/intern/draw_cache_impl_gpencil.c M source/blender/draw/intern/draw_cache_impl_metaball.c M source/blender/draw/intern/draw_instance_data.c M source/blender/draw/intern/draw_manager.c M source/blender/draw/intern/draw_select_buffer.c M source/blender/draw/intern/draw_view.c M source/blender/draw/intern/mesh_extractors/extract_mesh.h M source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_edituv.cc M source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_fdots.cc M source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_adjacency.cc M source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc M source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_points.cc M source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_nor.cc M source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc M source/blender/editors/armature/armature_intern.h M source/blender/editors/asset/intern/asset_list.cc M source/blender/editors/curve/editfont.c M source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c M source/blender/editors/gpencil/gpencil_edit.c M source/blender/editors/gpencil/gpencil_edit_curve.c M source/blender/editors/gpencil/gpencil_select.c M source/blender/editors/include/UI_interface.h M source/blender/editors/interface/interface_context_path.cc M source/blender/editors/interface/interface_eyedropper.c M source/blender/editors/interface/interface_region_hud.c M source/blender/editors/interface/interface_region_menu_pie.c M source/blender/ed
[Bf-blender-cvs] [c1f5d8d023c] master: Fix T91005: Autosplit produces unusable files
Commit: c1f5d8d023c6fdef67efbc6ce2af49e384c9bd98 Author: Richard Antalik Date: Tue Dec 14 01:16:24 2021 +0100 Branches: master https://developer.blender.org/rBc1f5d8d023c6fdef67efbc6ce2af49e384c9bd98 Fix T91005: Autosplit produces unusable files Audio PTS was reset for each new file. This caused misalignment of video and audio streams. In Blender, these files can't be loaded, other players will fail to align audio and video. Since timestamps are reset intentionally, reset also video stream timestamps. There were other bugs: After timestamp was reset for audio, write_audio_frames started encoding from timeline start until target frame, so each split video had more audio than it should. Also audio for last frame before splitting was written into new file. Differential Revision: https://developer.blender.org/D13280 === M source/blender/blenkernel/intern/writeffmpeg.c === diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index a20c918c517..035e56993f9 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -87,6 +87,7 @@ typedef struct FFMpegContext { AVStream *video_stream; AVStream *audio_stream; AVFrame *current_frame; /* Image frame in output pixel format. */ + int video_time; /* Image frame in Blender's own pixel format, may need conversion to the output pixel format. */ AVFrame *img_convert_frame; @@ -96,6 +97,7 @@ typedef struct FFMpegContext { uint8_t *audio_deinterleave_buffer; int audio_input_samples; double audio_time; + double audio_time_total; bool audio_deinterleave; int audio_sample_size; @@ -318,14 +320,15 @@ static const char **get_file_extensions(int format) } /* Write a frame to the output file */ -static int write_video_frame(FFMpegContext *context, int cfra, AVFrame *frame, ReportList *reports) +static int write_video_frame(FFMpegContext *context, AVFrame *frame, ReportList *reports) { int ret, success = 1; AVPacket *packet = av_packet_alloc(); AVCodecContext *c = context->video_codec; - frame->pts = cfra; + frame->pts = context->video_time; + context->video_time++; ret = avcodec_send_frame(c, frame); if (ret < 0) { @@ -804,6 +807,8 @@ static AVStream *alloc_video_stream(FFMpegContext *context, avcodec_parameters_from_context(st->codecpar, c); + context->video_time = 0.0f; + return st; } @@ -1397,9 +1402,10 @@ static void write_audio_frames(FFMpegContext *context, double to_pts) AVCodecContext *c = context->audio_codec; while (context->audio_stream) { -if ((context->audio_time >= to_pts) || !write_audio_frame(context)) { +if ((context->audio_time_total >= to_pts) || !write_audio_frame(context)) { break; } +context->audio_time_total += (double)context->audio_input_samples / (double)c->sample_rate; context->audio_time += (double)context->audio_input_samples / (double)c->sample_rate; } } @@ -1423,22 +1429,23 @@ int BKE_ffmpeg_append(void *context_v, if (context->video_stream) { avframe = generate_video_frame(context, (unsigned char *)pixels); -success = (avframe && write_video_frame(context, frame - start_frame, avframe, reports)); +success = (avframe && write_video_frame(context, avframe, reports)); +# ifdef WITH_AUDASPACE +/* Add +1 frame because we want to encode audio up until the next video frame. */ +write_audio_frames( +context, (frame - start_frame + 1) / (((double)rd->frs_sec) / (double)rd->frs_sec_base)); +# endif if (context->ffmpeg_autosplit) { if (avio_tell(context->outfile->pb) > FFMPEG_AUTOSPLIT_SIZE) { end_ffmpeg_impl(context, true); context->ffmpeg_autosplit_count++; + success &= start_ffmpeg_impl(context, rd, rectx, recty, suffix, reports); } } } -# ifdef WITH_AUDASPACE - /* Add +1 frame because we want to encode audio up until the next video frame. */ - write_audio_frames( - context, (frame - start_frame + 1) / (((double)rd->frs_sec) / (double)rd->frs_sec_base)); -# endif return success; } @@ -1881,6 +1888,7 @@ void *BKE_ffmpeg_context_create(void) context->ffmpeg_autosplit_count = 0; context->ffmpeg_preview = false; context->stamp_data = NULL; + context->audio_time_total = 0.0; return context; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [b6475099133] master: Fix T93844: High memory usage during VSE preview
Commit: b64750991334517a0d0cfc94c21d7276d5e5e833 Author: Richard Antalik Date: Tue Dec 14 00:18:24 2021 +0100 Branches: master https://developer.blender.org/rBb64750991334517a0d0cfc94c21d7276d5e5e833 Fix T93844: High memory usage during VSE preview Since 88c02bf826df FFmpeg handles are freed if image is not displayed. This change did not work correctly if strips are inside meta strip, because overlap did not consider meta strip boundary, only strips inside of meta strip. Pass frame range to `sequencer_all_free_anim_ibufs`, if strip is inside of meta strip, frame range is reduced to fit meta strip boundary, but if meta strip is being edited, range must be set to +/-`MAXFRAME`, otherwise playback performance would be too bad. === M source/blender/sequencer/SEQ_relations.h M source/blender/sequencer/intern/strip_relations.c === diff --git a/source/blender/sequencer/SEQ_relations.h b/source/blender/sequencer/SEQ_relations.h index 3c3fe2fdd83..9571e826759 100644 --- a/source/blender/sequencer/SEQ_relations.h +++ b/source/blender/sequencer/SEQ_relations.h @@ -54,6 +54,9 @@ void SEQ_relations_invalidate_cache_in_range(struct Scene *scene, struct Sequence *seq, struct Sequence *range_mask, int invalidate_types); +/** + * Release FFmpeg handles of strips that are not currently displayed to minimize memory usage. + */ void SEQ_relations_free_all_anim_ibufs(struct Scene *scene, int timeline_frame); /** * A debug and development function which checks whether sequences have unique UUIDs. diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index 7baae5afabd..7e7fc9e6bf7 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -29,6 +29,7 @@ #include "BLI_ghash.h" #include "BLI_listbase.h" +#include "BLI_math.h" #include "BLI_session_uuid.h" #include "BKE_main.h" @@ -281,14 +282,31 @@ void SEQ_relations_free_imbuf(Scene *scene, ListBase *seqbase, bool for_render) } } -static void sequencer_all_free_anim_ibufs(ListBase *seqbase, int timeline_frame) +static void sequencer_all_free_anim_ibufs(Editing *ed, + ListBase *seqbase, + int timeline_frame, + const int frame_range[2]) { for (Sequence *seq = seqbase->first; seq != NULL; seq = seq->next) { -if (!SEQ_time_strip_intersects_frame(seq, timeline_frame)) { +if (!SEQ_time_strip_intersects_frame(seq, timeline_frame) || +!((frame_range[0] <= timeline_frame) && (frame_range[1] > timeline_frame))) { SEQ_relations_sequence_free_anim(seq); } if (seq->type == SEQ_TYPE_META) { - sequencer_all_free_anim_ibufs(&seq->seqbase, timeline_frame); + int meta_range[2]; + + MetaStack *ms = SEQ_meta_stack_active_get(ed); + if (ms != NULL && ms->parseq == seq) { +meta_range[0] = -MAXFRAME; +meta_range[1] = MAXFRAME; + } + else { +/* Limit frame range to meta strip. */ +meta_range[0] = max_ii(frame_range[0], seq->startdisp); +meta_range[1] = min_ii(frame_range[1], seq->enddisp); + } + + sequencer_all_free_anim_ibufs(ed, &seq->seqbase, timeline_frame, meta_range); } } } @@ -299,7 +317,9 @@ void SEQ_relations_free_all_anim_ibufs(Scene *scene, int timeline_frame) if (ed == NULL) { return; } - sequencer_all_free_anim_ibufs(&ed->seqbase, timeline_frame); + + const int frame_range[2] = {-MAXFRAME, MAXFRAME}; + sequencer_all_free_anim_ibufs(ed, &ed->seqbase, timeline_frame, frame_range); } static Sequence *sequencer_check_scene_recursion(Scene *scene, ListBase *seqbase) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a603bb34591] master: Cleanup: clang-format
Commit: a603bb34591c8b68977b026204658ce602a5dae6 Author: Campbell Barton Date: Tue Dec 14 09:42:44 2021 +1100 Branches: master https://developer.blender.org/rBa603bb34591c8b68977b026204658ce602a5dae6 Cleanup: clang-format === M intern/cycles/scene/object.cpp M source/blender/makesdna/intern/dna_defaults.c M source/blender/makesrna/intern/rna_gpencil_modifier.c === diff --git a/intern/cycles/scene/object.cpp b/intern/cycles/scene/object.cpp index 77c6c6614e3..05f6f6ce197 100644 --- a/intern/cycles/scene/object.cpp +++ b/intern/cycles/scene/object.cpp @@ -533,7 +533,8 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s void ObjectManager::device_update_prim_offsets(Device *device, DeviceScene *dscene, Scene *scene) { BVHLayoutMask layout_mask = device->get_bvh_layout_mask(); - if (layout_mask != BVH_LAYOUT_METAL && layout_mask != BVH_LAYOUT_MULTI_METAL && layout_mask != BVH_LAYOUT_MULTI_METAL_EMBREE) { + if (layout_mask != BVH_LAYOUT_METAL && layout_mask != BVH_LAYOUT_MULTI_METAL && + layout_mask != BVH_LAYOUT_MULTI_METAL_EMBREE) { return; } diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index 6c8b4d0acb1..1d4257328a4 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -556,7 +556,7 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = { SDNA_DEFAULT_DECL(LengthGpencilModifierData), SDNA_DEFAULT_DECL(DashGpencilModifierData), SDNA_DEFAULT_DECL(DashGpencilModifierSegment), -SDNA_DEFAULT_DECL(ShrinkwrapGpencilModifierData) +SDNA_DEFAULT_DECL(ShrinkwrapGpencilModifierData), }; #undef SDNA_DEFAULT_DECL #undef SDNA_DEFAULT_DECL_EX diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index 7ca77e1c290..e06aac31124 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -3491,9 +3491,8 @@ static void rna_def_modifier_gpencillength(BlenderRNA *brna) prop = RNA_def_property(srna, "random_start_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rand_start_fac"); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 1); - RNA_def_property_ui_text(prop, - "Random Start Factor", - "Size of random length added to the start of each stroke"); + RNA_def_property_ui_text( + prop, "Random Start Factor", "Size of random length added to the start of each stroke"); RNA_def_property_update(prop, 0, "rna_GpencilModifier_update"); prop = RNA_def_property(srna, "random_end_factor", PROP_FLOAT, PROP_NONE); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2a0a6a0541e] master: Remove G.save_over
Commit: 2a0a6a0541eaff06659a06ef18cac05e5674c844 Author: Campbell Barton Date: Tue Dec 14 09:42:46 2021 +1100 Branches: master https://developer.blender.org/rB2a0a6a0541eaff06659a06ef18cac05e5674c844 Remove G.save_over The difference between G.save_over and G.relbase_valid was minor. There is one change in functionality. When saving the default-startup file from an already loaded blend file - future save actions will continue to write to the originally loaded file instead of prompting the user to select a location to save the file. This change makes saving the startup file behave the same way "Save a Copy" does. Reviewed By: brecht Ref D13556 === M source/blender/blenkernel/BKE_global.h M source/blender/windowmanager/intern/wm_files.c M source/blender/windowmanager/intern/wm_window.c M source/creator/creator_args.c === diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 1464a905c80..184ebb8e934 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -52,12 +52,6 @@ typedef struct Global { /** When set: `G_MAIN->filepath` contains valid relative base path. */ bool relbase_valid; - /** - * When set: - * - Saving writes to `G_MAIN->filepath` without prompting for a file-path. - * - The title-bar displays `G_MAIN->filepath`. - */ - bool save_over; /** * Strings of recently opened files to show in the file menu. diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index e753c083805..f3cf5dca040 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -957,11 +957,9 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports) /* When recovering a session from an unsaved file, this can have a blank path. */ if (BKE_main_blendfile_path(bmain)[0] != '\0') { -G.save_over = 1; G.relbase_valid = 1; } else { -G.save_over = 0; G.relbase_valid = 0; } @@ -1357,9 +1355,6 @@ void wm_homefile_read_ex(bContext *C, WM_check(C); /* opens window(s), checks keymaps */ bmain->filepath[0] = '\0'; - -/* start with save preference untitled.blend */ -G.save_over = 0; } { @@ -1850,8 +1845,6 @@ static bool wm_file_write(bContext *C, if (use_save_as_copy == false) { G.relbase_valid = 1; STRNCPY(bmain->filepath, filepath); /* is guaranteed current file */ - - G.save_over = 1; /* disable untitled.blend convention */ } SET_FLAG_FROM_TEST(G.fileflags, fileflags & G_FILE_COMPRESS, G_FILE_COMPRESS); @@ -2126,7 +2119,6 @@ static int wm_homefile_write_exec(bContext *C, wmOperator *op) printf("ok\n"); BKE_report(op->reports, RPT_INFO, "Startup file saved"); - G.save_over = 0; BKE_callback_exec_null(bmain, BKE_CB_EVT_SAVE_POST); @@ -3011,7 +3003,7 @@ void WM_OT_recover_auto_save(wmOperatorType *ot) static void wm_filepath_default(char *filepath) { - if (G.save_over == false) { + if (G.relbase_valid == false) { BLI_path_filename_ensure(filepath, FILE_MAX, "untitled.blend"); } } @@ -3022,7 +3014,7 @@ static void save_set_compress(wmOperator *op) prop = RNA_struct_find_property(op->ptr, "compress"); if (!RNA_property_is_set(op->ptr, prop)) { -if (G.save_over) { /* keep flag for existing file */ +if (G.relbase_valid) { /* keep flag for existing file */ RNA_property_boolean_set(op->ptr, prop, (G.fileflags & G_FILE_COMPRESS) != 0); } else { /* use userdef for new file */ @@ -3210,7 +3202,7 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *U } } - if (G.save_over) { + if (G.relbase_valid) { char path[FILE_MAX]; RNA_string_get(op->ptr, "filepath", path); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 86abfe881ff..fbced87d19c 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -428,7 +428,7 @@ void wm_window_title(wmWindowManager *wm, wmWindow *win) } else if (win->ghostwin) { /* this is set to 1 if you don't have startup.blend open */ -if (G.save_over && BKE_main_blendfile_path_from_global()[0]) { +if (G.relbase_valid && BKE_main_blendfile_path_from_global()[0]) { char str[sizeof(((Main *)NULL)->filepath) + 24]; BLI_snprintf(str, sizeof(str), diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 0259e028e63..2d86587d096 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -1996,7 +1996,6 @@ static int arg_handle_load_file(int UNUSED(argc), const ch
[Bf-blender-cvs] [e688c927eb3] master: Fix T94022: Both options GPU/CPU checked under preferences cause viewport render crash. (ARM/Metal)
Commit: e688c927eb3a82b21ba744ec57540ea2cd4f44c8 Author: Michael Jones Date: Mon Dec 13 22:20:16 2021 + Branches: master https://developer.blender.org/rBe688c927eb3a82b21ba744ec57540ea2cd4f44c8 Fix T94022: Both options GPU/CPU checked under preferences cause viewport render crash. (ARM/Metal) This fixes crash T94022 when selecting live viewport render with both GPU & CPU devices selected. It is caused by incorrect `KernelBVHLayout` assignment. Similar to `BVH_LAYOUT_MULTI_OPTIX` for Optix, this patch adds a `BVH_LAYOUT_MULTI_METAL` to correctly redirect to the correct Metal BVH layout type. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13561 === M intern/cycles/bvh/bvh.cpp M intern/cycles/device/multi/device.cpp M intern/cycles/kernel/types.h M intern/cycles/scene/geometry.cpp M intern/cycles/scene/object.cpp === diff --git a/intern/cycles/bvh/bvh.cpp b/intern/cycles/bvh/bvh.cpp index 540bf52f7ac..703639e29f3 100644 --- a/intern/cycles/bvh/bvh.cpp +++ b/intern/cycles/bvh/bvh.cpp @@ -44,6 +44,7 @@ const char *bvh_layout_name(BVHLayout layout) case BVH_LAYOUT_METAL: return "METAL"; case BVH_LAYOUT_MULTI_OPTIX: +case BVH_LAYOUT_MULTI_METAL: case BVH_LAYOUT_MULTI_OPTIX_EMBREE: case BVH_LAYOUT_MULTI_METAL_EMBREE: return "MULTI"; @@ -115,6 +116,7 @@ BVH *BVH::create(const BVHParams ¶ms, break; #endif case BVH_LAYOUT_MULTI_OPTIX: +case BVH_LAYOUT_MULTI_METAL: case BVH_LAYOUT_MULTI_OPTIX_EMBREE: case BVH_LAYOUT_MULTI_METAL_EMBREE: return new BVHMulti(params, geometry, objects); diff --git a/intern/cycles/device/multi/device.cpp b/intern/cycles/device/multi/device.cpp index baab84f4035..5ec3ef1b785 100644 --- a/intern/cycles/device/multi/device.cpp +++ b/intern/cycles/device/multi/device.cpp @@ -124,6 +124,11 @@ class MultiDevice : public Device { return BVH_LAYOUT_MULTI_OPTIX; } +/* With multiple Metal devices, every device needs its own acceleration structure */ +if (bvh_layout_mask == BVH_LAYOUT_METAL) { + return BVH_LAYOUT_MULTI_METAL; +} + /* When devices do not share a common BVH layout, fall back to creating one for each */ const BVHLayoutMask BVH_LAYOUT_OPTIX_EMBREE = (BVH_LAYOUT_OPTIX | BVH_LAYOUT_EMBREE); if ((bvh_layout_mask_all & BVH_LAYOUT_OPTIX_EMBREE) == BVH_LAYOUT_OPTIX_EMBREE) { @@ -155,6 +160,7 @@ class MultiDevice : public Device { } assert(bvh->params.bvh_layout == BVH_LAYOUT_MULTI_OPTIX || + bvh->params.bvh_layout == BVH_LAYOUT_MULTI_METAL || bvh->params.bvh_layout == BVH_LAYOUT_MULTI_OPTIX_EMBREE || bvh->params.bvh_layout == BVH_LAYOUT_MULTI_METAL_EMBREE); @@ -179,6 +185,8 @@ class MultiDevice : public Device { BVHParams params = bvh->params; if (bvh->params.bvh_layout == BVH_LAYOUT_MULTI_OPTIX) params.bvh_layout = BVH_LAYOUT_OPTIX; +else if (bvh->params.bvh_layout == BVH_LAYOUT_MULTI_METAL) + params.bvh_layout = BVH_LAYOUT_METAL; else if (bvh->params.bvh_layout == BVH_LAYOUT_MULTI_OPTIX_EMBREE) params.bvh_layout = sub.device->info.type == DEVICE_OPTIX ? BVH_LAYOUT_OPTIX : BVH_LAYOUT_EMBREE; diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h index c39289224ad..34f909a06d9 100644 --- a/intern/cycles/kernel/types.h +++ b/intern/cycles/kernel/types.h @@ -1224,7 +1224,8 @@ typedef enum KernelBVHLayout { BVH_LAYOUT_MULTI_OPTIX = (1 << 3), BVH_LAYOUT_MULTI_OPTIX_EMBREE = (1 << 4), BVH_LAYOUT_METAL = (1 << 5), - BVH_LAYOUT_MULTI_METAL_EMBREE = (1 << 6), + BVH_LAYOUT_MULTI_METAL = (1 << 6), + BVH_LAYOUT_MULTI_METAL_EMBREE = (1 << 7), /* Default BVH layout to use for CPU. */ BVH_LAYOUT_AUTO = BVH_LAYOUT_EMBREE, diff --git a/intern/cycles/scene/geometry.cpp b/intern/cycles/scene/geometry.cpp index 346b030817f..ca330c5544d 100644 --- a/intern/cycles/scene/geometry.cpp +++ b/intern/cycles/scene/geometry.cpp @@ -166,7 +166,7 @@ bool Geometry::need_build_bvh(BVHLayout layout) const { return is_instanced() || layout == BVH_LAYOUT_OPTIX || layout == BVH_LAYOUT_MULTI_OPTIX || layout == BVH_LAYOUT_METAL || layout == BVH_LAYOUT_MULTI_OPTIX_EMBREE || - layout == BVH_LAYOUT_MULTI_METAL_EMBREE; + layout == BVH_LAYOUT_MULTI_METAL || layout == BVH_LAYOUT_MULTI_METAL_EMBREE; } bool Geometry::is_instanced() const diff --git a/intern/cycles/scene/object.cpp b/intern/cycles/scene/object.cpp index bf224a81af5..77c6c6614e3 100644 --- a/intern/cycles/scene/object.cpp +++ b/intern/cycles/scene/object.cpp @@ -533,7 +533,7 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s void ObjectManager::device_update_pri
[Bf-blender-cvs] [b8952ecec94] master: Cleanup: Remove unused curve types from enum
Commit: b8952ecec947308ded826d6025ddfe7d6ff0325e Author: Piotr Makal Date: Mon Dec 13 15:13:47 2021 -0600 Branches: master https://developer.blender.org/rBb8952ecec947308ded826d6025ddfe7d6ff0325e Cleanup: Remove unused curve types from enum There were a few unused enum values: `CU_CARDINAL` and `CU_BSPLINE` This commit cleans them up from code as they were not used for anything meaningful. Differential Revision: https://developer.blender.org/D13554 === M source/blender/editors/curve/editcurve.c M source/blender/makesdna/DNA_curve_types.h M source/blender/makesrna/intern/rna_curve.c === diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 743b971de61..a034e4bb10e 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3855,11 +3855,6 @@ static int set_spline_type_exec(bContext *C, wmOperator *op) const bool use_handles = RNA_boolean_get(op->ptr, "use_handles"); const int type = RNA_enum_get(op->ptr, "type"); -if (ELEM(type, CU_CARDINAL, CU_BSPLINE)) { - BKE_report(op->reports, RPT_ERROR, "Not yet implemented"); - continue; -} - LISTBASE_FOREACH (Nurb *, nu, editnurb) { if (ED_curve_nurb_select_check(v3d, nu)) { const int pntsu_prev = nu->pntsu; @@ -3903,8 +3898,6 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot) static const EnumPropertyItem type_items[] = { {CU_POLY, "POLY", 0, "Poly", ""}, {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, - // {CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, - // {CU_BSPLINE, "B_SPLINE", 0, "B-Spline", ""}, {CU_NURBS, "NURBS", 0, "NURBS", ""}, {0, NULL, 0, NULL, NULL}, }; diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index dab43d16cbb..c1c8fe06121 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -420,10 +420,8 @@ enum { enum { CU_POLY = 0, CU_BEZIER = 1, - CU_BSPLINE = 2, - CU_CARDINAL = 3, CU_NURBS = 4, - CU_TYPE = (CU_POLY | CU_BEZIER | CU_BSPLINE | CU_CARDINAL | CU_NURBS), + CU_TYPE = (CU_POLY | CU_BEZIER | CU_NURBS), /* only for adding */ CU_PRIMITIVE = 0xF00, diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 5dea3d32bbc..6cca0c51988 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -141,8 +141,6 @@ const EnumPropertyItem rna_enum_beztriple_interpolation_mode_items[] = { static const EnumPropertyItem curve_type_items[] = { {CU_POLY, "POLY", 0, "Poly", ""}, {CU_BEZIER, "BEZIER", 0, "Bezier", ""}, -{CU_BSPLINE, "BSPLINE", 0, "BSpline", ""}, -{CU_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, {CU_NURBS, "NURBS", 0, "Ease", ""}, {0, NULL, 0, NULL, NULL}, }; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0606adceb3b] master: UI: String Search: Add an optional weight parameter
Commit: 0606adceb3b6efa020c7389bdb31fe541b7d1d5f Author: Hans Goudey Date: Mon Dec 13 13:57:55 2021 -0600 Branches: master https://developer.blender.org/rB0606adceb3b6efa020c7389bdb31fe541b7d1d5f UI: String Search: Add an optional weight parameter This builds off of rBf951aa063f7, adding a weight parameter which can be used to change the order of items when they have the same match score. In the future, if string searching gets a C++ API, we could use an optional parameter for the weight, since it is not used yet. This will be used for the node link drag search menu (D8286). Differential Revision: https://developer.blender.org/D13559 === M source/blender/blenlib/BLI_string_search.h M source/blender/blenlib/intern/string_search.cc M source/blender/editors/interface/interface.c M source/blender/editors/interface/interface_template_attribute_search.cc M source/blender/editors/interface/interface_template_search_menu.cc M source/blender/editors/interface/interface_templates.c M source/blender/editors/interface/interface_utils.c M source/blender/editors/space_node/node_select.cc === diff --git a/source/blender/blenlib/BLI_string_search.h b/source/blender/blenlib/BLI_string_search.h index b846a4d3c39..f0bf259d213 100644 --- a/source/blender/blenlib/BLI_string_search.h +++ b/source/blender/blenlib/BLI_string_search.h @@ -26,8 +26,11 @@ StringSearch *BLI_string_search_new(void); /** * Add a new possible result to the search. * The caller keeps ownership of all parameters. + * + * \param weight: Can be used to customize the order when multiple items have the same match score. */ -void BLI_string_search_add(StringSearch *search, const char *str, void *user_data); +void BLI_string_search_add(StringSearch *search, const char *str, void *user_data, int weight); + /** * Filter and sort all previously added search items. * Returns an array containing the filtered user data. diff --git a/source/blender/blenlib/intern/string_search.cc b/source/blender/blenlib/intern/string_search.cc index 02b0b814659..c5528dce2f2 100644 --- a/source/blender/blenlib/intern/string_search.cc +++ b/source/blender/blenlib/intern/string_search.cc @@ -389,6 +389,7 @@ struct SearchItem { blender::Span normalized_words; int length; void *user_data; + int weight; }; struct StringSearch { @@ -401,14 +402,19 @@ StringSearch *BLI_string_search_new() return new StringSearch(); } -void BLI_string_search_add(StringSearch *search, const char *str, void *user_data) +void BLI_string_search_add(StringSearch *search, + const char *str, + void *user_data, + const int weight) { using namespace blender; Vector words; StringRef str_ref{str}; string_search::extract_normalized_words(str_ref, search->allocator, words); - search->items.append( - {search->allocator.construct_array_copy(words.as_span()), (int)str_ref.size(), user_data}); + search->items.append({search->allocator.construct_array_copy(words.as_span()), +(int)str_ref.size(), +user_data, +weight}); } int BLI_string_search_query(StringSearch *search, const char *query, void ***r_data) @@ -449,6 +455,11 @@ int BLI_string_search_query(StringSearch *search, const char *query, void ***r_d std::sort(indices.begin(), indices.end(), [&](int a, int b) { return search->items[a].length < search->items[b].length; }); + /* Prefer items with larger weights. Use `stable_sort` so that if the weights are the same, + * the order won't be changed. */ + std::stable_sort(indices.begin(), indices.end(), [&](int a, int b) { +return search->items[a].weight > search->items[b].weight; + }); } sorted_result_indices.extend(indices); } diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 27ec600943b..df508b87ce4 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -6733,7 +6733,7 @@ static void operator_enum_search_update_fn(const struct bContext *C, StringSearch *search = BLI_string_search_new(); for (const EnumPropertyItem *item = all_items; item->identifier; item++) { - BLI_string_search_add(search, item->name, (void *)item); + BLI_string_search_add(search, item->name, (void *)item, 0); } const EnumPropertyItem **filtered_items; diff --git a/source/blender/editors/interface/interface_template_attribute_search.cc b/source/blender/editors/interface/interface_template_attribute_search.cc index 85a6147432b..6d4b7a37bff 100644 --- a/source/blender/editors/interface/interface_template_attribute_search.cc +++ b/source/blender/ed
[Bf-blender-cvs] [a90c3564676] master: GPencil: Add randomize options to Length modifier
Commit: a90c3564676649aa4a0b74112c852a75de6d3521 Author: Cody Winchester Date: Mon Dec 13 17:14:32 2021 +0100 Branches: master https://developer.blender.org/rBa90c3564676649aa4a0b74112c852a75de6d3521 GPencil: Add randomize options to Length modifier This patch adds a randomize factor for the start/end lengths in the Length modifier. Reviewed By: #grease_pencil, antoniov, pepeland, HooglyBoogly Differential Revision: https://developer.blender.org/D12928 === M source/blender/gpencil_modifiers/intern/MOD_gpencillength.c M source/blender/makesdna/DNA_gpencil_modifier_defaults.h M source/blender/makesdna/DNA_gpencil_modifier_types.h M source/blender/makesrna/intern/rna_gpencil_modifier.c === diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c index 80b60547e92..af0067e06aa 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillength.c @@ -23,8 +23,10 @@ #include +#include "BLI_hash.h" #include "BLI_listbase.h" #include "BLI_math.h" +#include "BLI_rand.h" #include "BLI_utildefines.h" #include "BLT_translation.h" @@ -56,6 +58,7 @@ #include "MOD_gpencil_util.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" static void initData(GpencilModifierData *md) { @@ -71,6 +74,20 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target) BKE_gpencil_modifier_copydata_generic(md, target); } +static float *noise_table(int len, int offset, int seed) +{ + float *table = MEM_callocN(sizeof(float) * len, __func__); + for (int i = 0; i < len; i++) { +table[i] = BLI_hash_int_01(BLI_hash_int_2d(seed, i + offset + 1)); + } + return table; +} + +BLI_INLINE float table_sample(float *table, float x) +{ + return interpf(table[(int)ceilf(x)], table[(int)floor(x)], fractf(x)); +} + static bool gpencil_modify_stroke(bGPDstroke *gps, const float length, const float overshoot_fac, @@ -104,9 +121,15 @@ static bool gpencil_modify_stroke(bGPDstroke *gps, return changed; } -static void applyLength(LengthGpencilModifierData *lmd, bGPdata *gpd, bGPDstroke *gps) +static void applyLength(GpencilModifierData *md, +Depsgraph *depsgraph, +bGPdata *gpd, +bGPDframe *gpf, +bGPDstroke *gps, +Object *ob) { bool changed = false; + LengthGpencilModifierData *lmd = (LengthGpencilModifierData *)md; const float len = (lmd->mode == GP_LENGTH_ABSOLUTE) ? 1.0f : BKE_gpencil_stroke_length(gps, true); const int totpoints = gps->totpoints; @@ -120,11 +143,48 @@ static void applyLength(LengthGpencilModifierData *lmd, bGPdata *gpd, bGPDstroke int first_mode = 1; float second_fac = lmd->end_fac; int second_mode = 2; + + float rand[2] = {0.0f, 0.0f}; + if (lmd->rand_start_fac != 0.0 || lmd->rand_end_fac != 0.0) { +int seed = lmd->seed; + +/* Make sure different modifiers get different seeds. */ +seed += BLI_hash_string(ob->id.name + 2); +seed += BLI_hash_string(md->name); + +if (lmd->flag & GP_LENGTH_USE_RANDOM) { + seed += ((int)DEG_get_ctime(depsgraph)) / lmd->step; +} + +float rand_offset = BLI_hash_int_01(seed); + +/* Get stroke index for random offset. */ +int rnd_index = BLI_findindex(&gpf->strokes, gps); +const uint primes[2] = {2, 3}; +double offset[2] = {0.0f, 0.0f}; +double r[2]; + +float *noise_table_length = noise_table(4, (int)floor(lmd->rand_offset), seed + 2); + +/* To ensure a nice distribution, we use halton sequence and offset using the seed. */ +BLI_halton_2d(primes, offset, rnd_index, r); +for (int j = 0; j < 2; j++) { + float noise = table_sample(noise_table_length, j * 2 + fractf(lmd->rand_offset)); + + rand[j] = fmodf(r[j] + rand_offset, 1.0f); + rand[j] = fabs(fmodf(sin(rand[j] * 12.9898f + j * 78.233f) * 43758.5453f, 1.0f) + noise); +} + +MEM_SAFE_FREE(noise_table_length); + +first_fac = first_fac + rand[0] * lmd->rand_start_fac; +second_fac = second_fac + rand[1] * lmd->rand_end_fac; + } + if (first_fac < 0) { SWAP(float, first_fac, second_fac); SWAP(int, first_mode, second_mode); } - const int first_extra_point_count = ceil(first_fac * lmd->point_density); const int second_extra_point_count = ceil(second_fac * lmd->point_density); @@ -161,10 +221,10 @@ static void applyLength(LengthGpencilModifierData *lmd, bGPdata *gpd, bGPDstroke } static void deformStroke(GpencilModifierData *md, - Depsgraph *UNUSED(depsgraph), +
[Bf-blender-cvs] [459af75d1ed] master: GPencil: New Shrinkwrap modifier
Commit: 459af75d1ed586f08cd43e2aec7a3b270e809132 Author: Antonio Vazquez Date: Mon Dec 13 17:09:22 2021 +0100 Branches: master https://developer.blender.org/rB459af75d1ed586f08cd43e2aec7a3b270e809132 GPencil: New Shrinkwrap modifier his new modifier is equals to the existing mesh modifier but adapted to grease pencil. The underlying functions used to calculate the shrink are the same used in meshes. {F11794101} Reviewed By: pepeland, HooglyBoogly Differential Revision: https://developer.blender.org/D13192 === M source/blender/blenkernel/BKE_gpencil_geom.h M source/blender/blenkernel/BKE_gpencil_modifier.h M source/blender/blenkernel/BKE_shrinkwrap.h M source/blender/blenkernel/intern/gpencil_geom.cc M source/blender/blenkernel/intern/gpencil_modifier.c M source/blender/blenkernel/intern/shrinkwrap.c M source/blender/editors/gpencil/gpencil_edit.c M source/blender/editors/gpencil/gpencil_fill.c M source/blender/editors/gpencil/gpencil_interpolate.c M source/blender/editors/gpencil/gpencil_paint.c M source/blender/editors/gpencil/gpencil_sculpt_paint.c M source/blender/editors/space_outliner/outliner_draw.c M source/blender/gpencil_modifiers/CMakeLists.txt M source/blender/gpencil_modifiers/MOD_gpencil_modifiertypes.h M source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c A source/blender/gpencil_modifiers/intern/MOD_gpencilshrinkwrap.c M source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c M source/blender/makesdna/DNA_gpencil_modifier_defaults.h M source/blender/makesdna/DNA_gpencil_modifier_types.h M source/blender/makesdna/intern/dna_defaults.c M source/blender/makesrna/RNA_enum_items.h M source/blender/makesrna/intern/rna_gpencil_modifier.c M source/blender/makesrna/intern/rna_modifier.c === diff --git a/source/blender/blenkernel/BKE_gpencil_geom.h b/source/blender/blenkernel/BKE_gpencil_geom.h index df6dd6eab92..4b9671c7881 100644 --- a/source/blender/blenkernel/BKE_gpencil_geom.h +++ b/source/blender/blenkernel/BKE_gpencil_geom.h @@ -234,8 +234,12 @@ bool BKE_gpencil_stroke_sample(struct bGPdata *gpd, * \param gps: Stroke to smooth * \param i: Point index * \param inf: Amount of smoothing to apply + * \param smooth_caps: Apply smooth to stroke extremes */ -bool BKE_gpencil_stroke_smooth_point(struct bGPDstroke *gps, int i, float inf); +bool BKE_gpencil_stroke_smooth_point(struct bGPDstroke *gps, + int i, + float inf, + const bool smooth_caps); /** * Apply smooth strength to stroke point. * \param gps: Stroke to smooth diff --git a/source/blender/blenkernel/BKE_gpencil_modifier.h b/source/blender/blenkernel/BKE_gpencil_modifier.h index e7917ffa578..d850dea0c30 100644 --- a/source/blender/blenkernel/BKE_gpencil_modifier.h +++ b/source/blender/blenkernel/BKE_gpencil_modifier.h @@ -407,16 +407,8 @@ void BKE_gpencil_set_lineart_modifier_limits(struct GpencilModifierData *md, bool BKE_gpencil_is_first_lineart_in_stack(const struct Object *ob, const struct GpencilModifierData *md); -/** - * Init grease pencil lattice deform data. - * \param ob: Grease pencil object. - */ -void BKE_gpencil_lattice_init(struct Object *ob); -/** - * Clear grease pencil lattice deform data. - * \param ob: Grease pencil object. - */ -void BKE_gpencil_lattice_clear(struct Object *ob); +void BKE_gpencil_cache_data_init(struct Depsgraph *depsgraph, struct Object *ob); +void BKE_gpencil_cache_data_clear(struct Object *ob); /** * Calculate grease-pencil modifiers. diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index 6ab14628c29..088b270bfed 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -48,6 +48,7 @@ struct Mesh; struct ModifierEvalContext; struct Object; struct ShrinkwrapModifierData; +struct ShrinkwrapGpencilModifierData; struct SpaceTransform; /* Information about boundary edges in the mesh. */ @@ -123,6 +124,13 @@ void shrinkwrapModifier_deform(struct ShrinkwrapModifierData *smd, const int defgrp_index, float (*vertexCos)[3], int numVerts); +/* Implementation of the Shrinkwrap Grease Pencil modifier. */ +void shrinkwrapGpencilModifier_deform(struct ShrinkwrapGpencilModifierData *mmd, + struct Object *ob, + struct MDeformVert *dvert, + const int defgrp_index, + float (*vertexCos)[3], +
[Bf-blender-cvs] [c5edefe4961] temp-gpu-image-engine: Fix uvbounds calculation from the incorrect space.
Commit: c5edefe4961e3df1d47bd365ed8791cb821342ee Author: Jeroen Bakker Date: Mon Dec 13 16:01:53 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rBc5edefe4961e3df1d47bd365ed8791cb821342ee Fix uvbounds calculation from the incorrect space. === M source/blender/draw/engines/image/image_drawing_mode.hh M source/blender/draw/engines/image/image_engine.cc M source/blender/draw/engines/image/image_instance_data.hh M source/blender/draw/engines/image/image_space.hh M source/blender/draw/engines/image/image_space_image.hh M source/blender/draw/engines/image/image_space_node.hh M source/blender/draw/engines/image/image_texture_info.hh === diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh index 49a47b9bfd6..11802a4d8d5 100644 --- a/source/blender/draw/engines/image/image_drawing_mode.hh +++ b/source/blender/draw/engines/image/image_drawing_mode.hh @@ -44,6 +44,21 @@ struct OneTextureMethod { { } + void update_uv_to_texture_matrix(const ARegion *region) + { +// TODO: I remember that there was a function for this somewhere. +unit_m4(instance_data->uv_to_texture); +float scale_x = 1.0 / BLI_rctf_size_x(®ion->v2d.cur); +float scale_y = 1.0 / BLI_rctf_size_y(®ion->v2d.cur); +float translate_x = scale_x * -region->v2d.cur.xmin; +float translate_y = scale_y * -region->v2d.cur.ymin; + +instance_data->uv_to_texture[0][0] = scale_x; +instance_data->uv_to_texture[1][1] = scale_y; +instance_data->uv_to_texture[3][0] = translate_x; +instance_data->uv_to_texture[3][1] = translate_y; + } + /** \brief Update the texture slot uv and screen space bounds. */ void update_screen_space_bounds(const ARegion *region) { @@ -59,27 +74,12 @@ struct OneTextureMethod { } } - void update_uv_bounds() + void update_uv_bounds(const ARegion *region) { -/* Calculate the uv coordinates of the screen space visible corners. */ -float inverse_mat[4][4]; -DRW_view_viewmat_get(NULL, inverse_mat, true); - -rctf new_uv_bounds; -float uv_min[3]; -static const float screen_space_co1[3] = {0.0, 0.0, 0.0}; -mul_v3_m4v3(uv_min, inverse_mat, screen_space_co1); - -static const float screen_space_co2[3] = {1.0, 1.0, 0.0}; -float uv_max[3]; -mul_v3_m4v3(uv_max, inverse_mat, screen_space_co2); -BLI_rctf_init(&new_uv_bounds, uv_min[0], uv_max[0], uv_min[1], uv_max[1]); - -if (!BLI_rctf_compare( -&instance_data->texture_infos[0].uv_bounds, &new_uv_bounds, EPSILON_UV_BOUNDS)) { - instance_data->texture_infos[0].uv_bounds = new_uv_bounds; - instance_data->texture_infos[0].dirty = true; - update_uv_to_texture_matrix(&instance_data->texture_infos[0]); +TextureInfo &info = instance_data->texture_infos[0]; +if (!BLI_rctf_compare(&info.uv_bounds, ®ion->v2d.cur, EPSILON_UV_BOUNDS)) { + info.uv_bounds = region->v2d.cur; + info.dirty = true; } /* Mark the other textures as invalid. */ @@ -87,21 +87,6 @@ struct OneTextureMethod { BLI_rctf_init_minmax(&instance_data->texture_infos[i].clipping_bounds); } } - - void update_uv_to_texture_matrix(TextureInfo *info) - { -// TODO: I remember that there was a function for this somewhere. -unit_m4(info->uv_to_texture); -float scale_x = 1.0 / BLI_rctf_size_x(&info->uv_bounds); -float scale_y = 1.0 / BLI_rctf_size_y(&info->uv_bounds); -float translate_x = scale_x * -info->uv_bounds.xmin; -float translate_y = scale_y * -info->uv_bounds.ymin; - -info->uv_to_texture[0][0] = scale_x; -info->uv_to_texture[1][1] = scale_y; -info->uv_to_texture[3][0] = translate_x; -info->uv_to_texture[3][1] = translate_y; - } }; using namespace blender::bke::image::partial_update; @@ -367,7 +352,7 @@ template class ScreenSpaceDrawingMode : public AbstractD * Construct a variant of the info_uv_to_texture that adds the texel space * transformation.*/ float uv_to_texel[4][4]; -copy_m4_m4(uv_to_texel, texture_info.uv_to_texture); +copy_m4_m4(uv_to_texel, instance_data.uv_to_texture); float scale[3] = {static_cast(texture_width) / static_cast(tile_buffer.x), static_cast(texture_height) / static_cast(tile_buffer.y), 1.0f}; @@ -418,8 +403,9 @@ template class ScreenSpaceDrawingMode : public AbstractD // Step: Find out which screen space textures are needed to draw on the screen. Remove the // screen space textures that aren't needed. const ARegion *region = draw_ctx->region; +method.update_uv_to_texture_matrix(region); method.update_screen_space_bounds(region); -method.update_uv_bounds(); +method.update_uv_bounds(region); // Step: Update the
[Bf-blender-cvs] [315e51ad771] temp-gpu-image-engine: Made view override required.
Commit: 315e51ad771f411fc461cb80add15bab00ca1e3c Author: Jeroen Bakker Date: Mon Dec 13 15:15:32 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB315e51ad771f411fc461cb80add15bab00ca1e3c Made view override required. === M source/blender/draw/engines/image/image_engine.cc M source/blender/draw/engines/image/image_space.hh M source/blender/draw/engines/image/image_space_image.hh M source/blender/draw/engines/image/image_space_node.hh === diff --git a/source/blender/draw/engines/image/image_engine.cc b/source/blender/draw/engines/image/image_engine.cc index 12b03690275..ad02adaa98c 100644 --- a/source/blender/draw/engines/image/image_engine.cc +++ b/source/blender/draw/engines/image/image_engine.cc @@ -88,11 +88,8 @@ class ImageEngine { { IMAGE_InstanceData *instance_data = vedata->instance_data; drawing_mode.cache_init(vedata); -instance_data->view = nullptr; -if (space->has_view_override()) { - const ARegion *region = draw_ctx->region; - instance_data->view = space->create_view_override(region); -} +const ARegion *region = draw_ctx->region; +instance_data->view = space->create_view_override(region); } void cache_populate() diff --git a/source/blender/draw/engines/image/image_space.hh b/source/blender/draw/engines/image/image_space.hh index 2c843713c57..1fd240b9a36 100644 --- a/source/blender/draw/engines/image/image_space.hh +++ b/source/blender/draw/engines/image/image_space.hh @@ -85,16 +85,8 @@ class AbstractSpaceAccessor { bool *r_owns_texture, GPUTexture **r_tex_tile_data) = 0; - /** - * Does this space override the view. - * When so this member should return true and the create_view_override must return the view to - * use during drawing. - */ - virtual bool has_view_override() const = 0; - /** * Override the view for drawing. - * Should match #has_view_override. */ virtual DRWView *create_view_override(const ARegion *UNUSED(region)) = 0; diff --git a/source/blender/draw/engines/image/image_space_image.hh b/source/blender/draw/engines/image/image_space_image.hh index 31df05ee318..9dbd0648b74 100644 --- a/source/blender/draw/engines/image/image_space_image.hh +++ b/source/blender/draw/engines/image/image_space_image.hh @@ -101,11 +101,6 @@ class SpaceImageAccessor : public AbstractSpaceAccessor { } } - bool has_view_override() const override - { -return true; - } - DRWView *create_view_override(const ARegion *region) override { /* Setup a screen pixel view. The backdrop of the node editor doesn't follow the region. */ diff --git a/source/blender/draw/engines/image/image_space_node.hh b/source/blender/draw/engines/image/image_space_node.hh index 3717d45f414..be2667879d4 100644 --- a/source/blender/draw/engines/image/image_space_node.hh +++ b/source/blender/draw/engines/image/image_space_node.hh @@ -54,11 +54,6 @@ class SpaceNodeAccessor : public AbstractSpaceAccessor { BKE_image_release_ibuf(image, ibuf, lock); } - bool has_view_override() const override - { -return true; - } - DRWView *create_view_override(const ARegion *region) override { /* Setup a screen pixel view. The backdrop of the node editor doesn't follow the region. */ ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8c71b6b9ec5] temp-gpu-image-engine: Fix crash when iuser isn't available.
Commit: 8c71b6b9ec56dca95a9322fa2eee744ae69348da Author: Jeroen Bakker Date: Mon Dec 13 13:29:42 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB8c71b6b9ec56dca95a9322fa2eee744ae69348da Fix crash when iuser isn't available. === M source/blender/draw/engines/image/image_drawing_mode.hh === diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh index 940ecd7b72b..49a47b9bfd6 100644 --- a/source/blender/draw/engines/image/image_drawing_mode.hh +++ b/source/blender/draw/engines/image/image_drawing_mode.hh @@ -319,7 +319,10 @@ template class ScreenSpaceDrawingMode : public AbstractD const int texture_width = GPU_texture_width(info.texture); const int texture_height = GPU_texture_height(info.texture); IMB_initImBuf(&texture_buffer, texture_width, texture_height, 0, IB_rectfloat); -ImageUser tile_user = *image_user; +ImageUser tile_user = {0}; +if (image_user) { + tile_user = *image_user; +} void *lock; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [49802af7cd9] master: Cycles: add text explaining minimum requirements for Metal when no device found
Commit: 49802af7cd920d83f2c1805f4047d91842c76311 Author: Brecht Van Lommel Date: Mon Dec 13 15:30:59 2021 +0100 Branches: master https://developer.blender.org/rB49802af7cd920d83f2c1805f4047d91842c76311 Cycles: add text explaining minimum requirements for Metal when no device found === M intern/cycles/blender/addon/properties.py === diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 0b1a86dfdc1..a7deae2c05d 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1473,6 +1473,8 @@ class CyclesPreferences(bpy.types.AddonPreferences): col.label(text="Requires discrete AMD GPU with RDNA architecture", icon='BLANK1') if sys.platform[:3] == "win": col.label(text="and AMD Radeon Pro 21.Q4 driver or newer", icon='BLANK1') +elif device_type == 'METAL': +col.label(text="Requires Apple Silicon and macOS 12.0 or newer", icon='BLANK1') return for device in devices: ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [2dbaa308987] soc-2021-curves: Added functionality to control handle of adjacent `BezTriple`
Commit: 2dbaa308987ae7bd6913c403c8460fe1bd6ea11f Author: dilithjay Date: Sun Dec 12 21:47:43 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB2dbaa308987ae7bd6913c403c8460fe1bd6ea11f Added functionality to control handle of adjacent `BezTriple` === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 3d2364f9e47..c627d856ea9 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -154,25 +154,43 @@ static void remove_handle_movement_constraints(BezTriple *bezt, const bool f1, c } } -/* Move handles or entire #BezTriple to mouse based on selection. */ -static void move_selected_bezt_to_mouse(BezTriple *bezt, -const ViewContext *vc, -const wmEvent *event) +static void move_bezt_handle_or_vertex_to_location(BezTriple *bezt, + const int mval[2], + const short cp_index, + const ViewContext *vc) { float location[3]; - if (BEZT_ISSEL_IDX(bezt, 1)) { -mouse_location_to_worldspace(event->mval, bezt->vec[1], vc, location); + mouse_location_to_worldspace(mval, bezt->vec[cp_index], vc, location); + if (cp_index == 1) { move_bezt_to_location(bezt, location); } + else { +copy_v3_v3(bezt->vec[cp_index], location); +if (bezt->h1 == HD_ALIGN && bezt->h2 == HD_ALIGN) { + float handle_vec[3]; + sub_v3_v3v3(handle_vec, bezt->vec[1], location); + const short other_handle = cp_index == 2 ? 0 : 2; + normalize_v3_length(handle_vec, len_v3v3(bezt->vec[1], bezt->vec[other_handle])); + add_v3_v3v3(bezt->vec[other_handle], bezt->vec[1], handle_vec); +} + } +} + +/* Move handles or entire #BezTriple to mouse based on selection. */ +static void move_selected_bezt_to_location(BezTriple *bezt, + const ViewContext *vc, + const int mval[2]) +{ + if (BEZT_ISSEL_IDX(bezt, 1)) { +move_bezt_handle_or_vertex_to_location(bezt, mval, 1, vc); + } else { remove_handle_movement_constraints(bezt, bezt->f1, bezt->f3); if (BEZT_ISSEL_IDX(bezt, 0)) { - mouse_location_to_worldspace(event->mval, bezt->vec[0], vc, location); - copy_v3_v3(bezt->vec[0], location); + move_bezt_handle_or_vertex_to_location(bezt, mval, 0, vc); } else { - mouse_location_to_worldspace(event->mval, bezt->vec[2], vc, location); - copy_v3_v3(bezt->vec[2], location); + move_bezt_handle_or_vertex_to_location(bezt, mval, 2, vc); } } } @@ -652,8 +670,8 @@ static void add_bp_to_nurb(Nurb *nu, const CutData *data, Curve *cu) BKE_nurb_knot_calc_u(nu); } -/* Make a cut on the nearest nurb at the closest point. */ -static void make_cut(const wmEvent *event, Curve *cu, Nurb **r_nu, const ViewContext *vc) +/* Make a cut on the nearest nurb at the closest point. Return true if spline is nearby. */ +static bool make_cut(const wmEvent *event, Curve *cu, Nurb **r_nu, const ViewContext *vc) { CutData data = {.bezt_index = 0, .bp_index = 0, @@ -676,12 +694,15 @@ static void make_cut(const wmEvent *event, Curve *cu, Nurb **r_nu, const ViewCon if (data.min_dist < threshold_distance) { add_bezt_to_nurb(nu, &data, cu); *r_nu = nu; +return true; } } else if (data.min_dist < threshold_distance) { add_bp_to_nurb(nu, &data, cu); + return true; } } + return false; } /* Add a new vertex connected to the selected vertex. */ @@ -916,7 +937,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) else { ED_curve_nurb_vert_selected_find(vc.obedit->data, vc.v3d, &nu, &bezt, &bp); if (bezt) { - move_selected_bezt_to_mouse(bezt, &vc, event); + move_selected_bezt_to_location(bezt, &vc, event->mval); } else if (bp) { move_bp_to_mouse(bp, event, &vc); @@ -1047,6 +1068,8 @@ static int curve_pen_insert_modal(bContext *C, wmOperator *op, const wmEvent *ev int ret = OPERATOR_RUNNING_MODAL; /* Whether the mouse is clicking and dragging. */ bool dragging = RNA_boolean_get(op->ptr, "dragging"); + /* Whether the previous vertex is to be moved. */ + bool move_adjacent = RNA_boolean_get(op->ptr, "move_adjacent"); if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) { if (!dragging && WM_event_drag_test(event, event->prev_click_xy) && event->val == KM_PRESS) { @@ -1055,14 +1078,36 @@ static int curve_pen_insert_modal(bContext *C, wmOperato
[Bf-blender-cvs] [56e104b8196] soc-2021-curves: Reduced select distance threshold
Commit: 56e104b81962e48e1a840573b3441396dab8d829 Author: dilithjay Date: Sat Dec 11 23:21:02 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB56e104b81962e48e1a840573b3441396dab8d829 Reduced select distance threshold === M release/datafiles/locale M release/scripts/addons M source/blender/editors/curve/curve_intern.h M source/blender/editors/curve/editcurve.c M source/blender/editors/curve/editcurve_pen.c M source/blender/editors/curve/editcurve_query.c M source/blender/editors/include/ED_curve.h === diff --git a/release/datafiles/locale b/release/datafiles/locale index 3a78acbab9f..620b85f16d0 16 --- a/release/datafiles/locale +++ b/release/datafiles/locale @@ -1 +1 @@ -Subproject commit 3a78acbab9f63b18e93c1fa72b68a85e1bdeba05 +Subproject commit 620b85f16d03a6aadd7cae56969c9c29b06b992d diff --git a/release/scripts/addons b/release/scripts/addons index a444e8cc19a..c60fef38175 16 --- a/release/scripts/addons +++ b/release/scripts/addons @@ -1 +1 @@ -Subproject commit a444e8cc19a4353ce35ecdec9bb7894ee73a204a +Subproject commit c60fef38175ad989ee0c45e924cb27e1417c8667 diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h index 23e4502d017..b4e9d9a78a3 100644 --- a/source/blender/editors/curve/curve_intern.h +++ b/source/blender/editors/curve/curve_intern.h @@ -215,6 +215,14 @@ bool ED_curve_pick_vert(struct ViewContext *vc, struct BPoint **r_bp, short *r_handle, struct Base **r_base); +bool ED_curve_pick_vert_thresholded(struct ViewContext *vc, +short sel, +const float sel_dist_mul, +struct Nurb **r_nurb, +struct BezTriple **r_bezt, +struct BPoint **r_bp, +short *r_handle, +struct Base **r_base); void ED_curve_nurb_vert_selected_find( Curve *cu, View3D *v3d, Nurb **r_nu, BezTriple **r_bezt, BPoint **r_bp); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 4772c8dfa98..771c837da08 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4744,9 +4744,18 @@ void CURVE_OT_make_segment(wmOperatorType *ot) /* */ /** \name Pick Select from 3D View * \{ */ - bool ED_curve_editnurb_select_pick( bContext *C, const int mval[2], bool extend, bool deselect, bool toggle) +{ + return ED_curve_editnurb_select_pick_thresholded(C, mval, 1.0f, extend, deselect, toggle); +} + +bool ED_curve_editnurb_select_pick_thresholded(bContext *C, + const int mval[2], + const float sel_dist_mul, + bool extend, + bool deselect, + bool toggle) { Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); ViewContext vc; @@ -4760,7 +4769,7 @@ bool ED_curve_editnurb_select_pick( ED_view3d_viewcontext_init(C, &vc, depsgraph); copy_v2_v2_int(vc.mval, mval); - if (ED_curve_pick_vert(&vc, 1, &nu, &bezt, &bp, &hand, &basact)) { + if (ED_curve_pick_vert_thresholded(&vc, 1, sel_dist_mul, &nu, &bezt, &bp, &hand, &basact)) { Object *obedit = basact->object; Curve *cu = obedit->data; ListBase *editnurb = object_editcurve_get(obedit); diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 1a6389474bd..629db825f28 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -45,6 +45,8 @@ #include "float.h" +#define SEL_DIST_MUL 0.4f + /* Data structure to keep track of details about the cut location */ typedef struct CutData { /* Index of the last #BezTriple or BPoint before the cut. */ @@ -745,7 +747,7 @@ static bool is_spline_nearby(ViewContext *vc, wmOperator *op, const wmEvent *eve update_data_for_all_nurbs(nurbs, vc, &data); - const float threshold_distance = ED_view3d_select_dist_px() * 0.3f; + const float threshold_distance = ED_view3d_select_dist_px() * SEL_DIST_MUL; if (data.nurb && !data.nurb->bp && data.min_dist < threshold_distance) { MoveSegmentData *seg_data; op->customdata = seg_data = MEM_callocN(sizeof(MoveSegmentData), __func__); @@ -966,7 +968,8 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Get currently selected point if any. Used
[Bf-blender-cvs] [9952fa66b85] soc-2021-curves: Removed close curve functionality.
Commit: 9952fa66b85f90256ab4e872b10967623c5052ba Author: dilithjay Date: Sun Dec 12 06:50:26 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB9952fa66b85f90256ab4e872b10967623c5052ba Removed close curve functionality. === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 629db825f28..3d2364f9e47 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -827,41 +827,6 @@ static void move_segment(MoveSegmentData *seg_data, const wmEvent *event, ViewCo } } -/* Close the spline if endpoints are selected consecutively. Return true if cycle was created. */ -static bool make_cyclic_if_endpoints( -Nurb *sel_nu, BezTriple *sel_bezt, BPoint *sel_bp, ViewContext *vc, bContext *C) -{ - if (sel_bezt || sel_bp) { -const bool is_bezt_endpoint = (sel_nu->type == CU_BEZIER && - (sel_bezt == sel_nu->bezt || -sel_bezt == sel_nu->bezt + sel_nu->pntsu - 1)); -const bool is_bp_endpoint = (sel_nu->type != CU_BEZIER && - (sel_bp == sel_nu->bp || - sel_bp == sel_nu->bp + sel_nu->pntsu - 1)); -if (!(is_bezt_endpoint || is_bp_endpoint)) { - return false; -} - -short hand; -Nurb *nu = NULL; -BezTriple *bezt = NULL; -BPoint *bp = NULL; -Base *basact = NULL; -ED_curve_pick_vert(vc, 1, &nu, &bezt, &bp, &hand, &basact); - -if (nu == sel_nu && ((nu->type == CU_BEZIER && bezt != sel_bezt && - (bezt == nu->bezt || bezt == nu->bezt + nu->pntsu - 1)) || - (nu->type != CU_BEZIER && bp != sel_bp && - (bp == nu->bp || bp == nu->bp + nu->pntsu - 1 { - View3D *v3d = CTX_wm_view3d(C); - ListBase *editnurb = object_editcurve_get(vc->obedit); - ed_curve_toggle_cyclic(v3d, editnurb, 0); - return true; -} - } - return false; -} - enum { PEN_MODAL_FREE_MOVE_HANDLE = 1, }; @@ -972,16 +937,7 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) C, event->mval, SEL_DIST_MUL, false, false, false); RNA_boolean_set(op->ptr, "new", !found_point); - if (found_point) { -copy_v2_v2_int(vc.mval, event->mval); -if (nu && !(nu->flagu & CU_NURB_CYCLIC)) { - const bool closed = nu->pntsu > 2 && make_cyclic_if_endpoints(nu, bezt, bp, &vc, C); - - /* Set "new" to true to be able to click and drag to control handles when added. */ - RNA_boolean_set(op->ptr, "new", closed); -} - } - else { + if (!found_point) { if (is_spline_nearby(&vc, op, event)) { RNA_boolean_set(op->ptr, "moving_segment", true); moving_segment = true; ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [96a6d42fb29] soc-2021-curves: Fixed error due to no selected beztriples
Commit: 96a6d42fb2948a1e24efbf2ba2f684e1696937f1 Author: dilithjay Date: Sun Dec 12 22:28:51 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB96a6d42fb2948a1e24efbf2ba2f684e1696937f1 Fixed error due to no selected beztriples === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index c627d856ea9..71ed62e46f5 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -1078,25 +1078,31 @@ static int curve_pen_insert_modal(bContext *C, wmOperator *op, const wmEvent *ev } if (dragging) { ED_curve_nurb_vert_selected_find(vc.obedit->data, vc.v3d, &nu, &bezt, &bp); - if (move_adjacent) { + if (move_adjacent && nu && bezt) { int displacement[2], screen_co_int[2]; float screen_co_fl[2]; -BezTriple *prev_bezt = BKE_nurb_bezt_get_prev(nu, bezt); +BezTriple *adj_bezt = BKE_nurb_bezt_get_prev(nu, bezt); int cp_index = 2; -if (!prev_bezt) { - prev_bezt = BKE_nurb_bezt_get_next(nu, bezt); +if (!adj_bezt) { + adj_bezt = BKE_nurb_bezt_get_next(nu, bezt); cp_index = 0; + + if (!adj_bezt) { +return OPERATOR_FINISHED; + } } +remove_handle_movement_constraints(adj_bezt, true, true); + ED_view3d_project_float_object(vc.region, - prev_bezt->vec[cp_index], + adj_bezt->vec[cp_index], screen_co_fl, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN); sub_v2_v2v2_int(displacement, event->xy, event->prev_xy); screen_co_int[0] = (int)screen_co_fl[0]; screen_co_int[1] = (int)screen_co_fl[1]; add_v2_v2v2_int(screen_co_int, screen_co_int, displacement); -move_bezt_handle_or_vertex_to_location(prev_bezt, screen_co_int, cp_index, &vc); +move_bezt_handle_or_vertex_to_location(adj_bezt, screen_co_int, cp_index, &vc); } else { if (bezt) { @@ -1107,7 +1113,7 @@ static int curve_pen_insert_modal(bContext *C, wmOperator *op, const wmEvent *ev } } if (nu && nu->type == CU_BEZIER) { -// BKE_nurb_handles_calc(nu); +BKE_nurb_handles_calc(nu); } } } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [10b1bfc4bf1] soc-2021-curves: Merge branch 'master' into soc-2021-curves
Commit: 10b1bfc4bf15f674550a4748dbe1d35bd113df8e Author: dilithjay Date: Sat Dec 11 17:20:37 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB10b1bfc4bf15f674550a4748dbe1d35bd113df8e Merge branch 'master' into soc-2021-curves === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [0ea727173e8] soc-2021-curves: Fixed 2 warnings
Commit: 0ea727173e83e227626b9791b3042a8213ec6939 Author: dilithjay Date: Wed Dec 8 06:48:04 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB0ea727173e83e227626b9791b3042a8213ec6939 Fixed 2 warnings === M source/blender/editors/curve/editcurve_pen.c === diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index f508ea7ab36..1a6389474bd 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -506,19 +506,17 @@ static void update_data_for_all_nurbs(const ListBase *nurbs, const ViewContext * } float point[3], fraction; - bool found_min = get_closest_point_on_edge( - point, data->mval, data->cut_loc, data->next_loc, vc, &fraction); - bool check = ED_view3d_project_float_object( + get_closest_point_on_edge(point, data->mval, data->cut_loc, data->next_loc, vc, &fraction); + ED_view3d_project_float_object( vc->region, point, screen_co, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN); - const float dist1 = len_manhattan_v3v3(screen_co, data->mval); + const float dist1 = len_manhattan_v2v2(screen_co, data->mval); data->min_dist = dist1; - found_min = get_closest_point_on_edge( - point, data->mval, data->cut_loc, data->prev_loc, vc, &fraction); - check = ED_view3d_project_float_object( + get_closest_point_on_edge(point, data->mval, data->cut_loc, data->prev_loc, vc, &fraction); + ED_view3d_project_float_object( vc->region, point, screen_co, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN); - const float dist2 = len_manhattan_v3v3(screen_co, data->mval); + const float dist2 = len_manhattan_v2v2(screen_co, data->mval); if (dist2 < dist1) { data->parameter -= fraction / nu->resolu; @@ -1117,7 +1115,6 @@ static int curve_pen_insert_modal(bContext *C, wmOperator *op, const wmEvent *ev float mouse_point[2] = {(float)event->mval[0], (float)event->mval[1]}; get_closest_vertex_to_point_in_nurbs(nurbs, &nu, &bezt, &bp, mouse_point, &vc); - const bool no_point = nu == NULL; make_cut(event, cu, &nu, &vc); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [477efa92971] soc-2021-curves: Merge branch 'master' into soc-2021-curves
Commit: 477efa9297188bd1f76805d71ca16dc8fb5dbc30 Author: dilithjay Date: Thu Dec 9 07:02:46 2021 +0530 Branches: soc-2021-curves https://developer.blender.org/rB477efa9297188bd1f76805d71ca16dc8fb5dbc30 Merge branch 'master' into soc-2021-curves === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [3f96555123d] master: Cycles: enable Metal GPU rendering
Commit: 3f96555123db2b48047c40a45a6b78d6cd760dc4 Author: Brecht Van Lommel Date: Mon Dec 13 13:48:36 2021 +0100 Branches: master https://developer.blender.org/rB3f96555123db2b48047c40a45a6b78d6cd760dc4 Cycles: enable Metal GPU rendering This adds the remaining bits to enable Metal on macOS. There are still performance optimizations and other improvements planned, but it should now be ready for early testing. This is currently only enabled on in Arm builds for M1 GPUs. It is not yet working on AMD or Intel GPUs. Ref T92212 Differential Revision: https://developer.blender.org/D13503 === M CMakeLists.txt M build_files/cmake/config/blender_release.cmake M intern/cycles/cmake/external_libs.cmake M release/scripts/startup/bl_ui/space_userpref.py === diff --git a/CMakeLists.txt b/CMakeLists.txt index 59d07fd1a74..5c5b5eb317e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -463,6 +463,11 @@ if(NOT APPLE) mark_as_advanced(CYCLES_HIP_BINARIES_ARCH) endif() +# Apple Metal +if(APPLE) + option(WITH_CYCLES_DEVICE_METAL "Enable Cycles Apple Metal compute support" ON) +endif() + # Draw Manager option(WITH_DRAW_DEBUG "Add extra debug capabilities to Draw Manager" OFF) mark_as_advanced(WITH_DRAW_DEBUG) diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake index 04074db688d..da8724071b7 100644 --- a/build_files/cmake/config/blender_release.cmake +++ b/build_files/cmake/config/blender_release.cmake @@ -61,6 +61,7 @@ set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE) # platform dependent options if(APPLE) set(WITH_COREAUDIO ON CACHE BOOL "" FORCE) + set(WITH_CYCLES_DEVICE_METAL ON CACHE BOOL "" FORCE) endif() if(NOT WIN32) set(WITH_JACKON CACHE BOOL "" FORCE) diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 9967a775184..f46d18a4926 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -556,12 +556,17 @@ endif() ### if(WITH_CYCLES_DEVICE_METAL) - FIND_LIBRARY(METAL_LIBRARY Metal) - if (METAL_LIBRARY) -message(STATUS "Found Metal: ${METAL_LIBRARY}") - else() + find_library(METAL_LIBRARY Metal) + + # This file was added in the 12.0 SDK, use it as a way to detect the version. + if (METAL_LIBRARY AND NOT EXISTS "${METAL_LIBRARY}/Headers/MTLFunctionStitching.h") +message(STATUS "Metal version too old, must be SDK 12.0 or newer, disabling WITH_CYCLES_DEVICE_METAL") +set(WITH_CYCLES_DEVICE_METAL OFF) + elseif (NOT METAL_LIBRARY) message(STATUS "Metal not found, disabling WITH_CYCLES_DEVICE_METAL") set(WITH_CYCLES_DEVICE_METAL OFF) + else() +message(STATUS "Found Metal: ${METAL_LIBRARY}") endif() endif() diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 4976834dd87..6dbb964e771 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -596,9 +596,11 @@ class USERPREF_PT_system_cycles_devices(SystemPanel, CenterAlignMixIn, Panel): @classmethod def poll(cls, _context): -# No GPU rendering on macOS currently. +# No GPU rendering on macOS x86_64 currently. +import platform import sys -return bpy.app.build_options.cycles and sys.platform != "darwin" +return bpy.app.build_options.cycles and \ + (sys.platform != "darwin" or platform.machine() == "arm64") def draw_centered(self, context, layout): prefs = context.preferences ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8ba63026964] master: Geometry Nodes: fix combining field inputs
Commit: 8ba63026964bce2b8e454f50766627ce629a0da4 Author: Jacques Lucke Date: Mon Dec 13 13:51:28 2021 +0100 Branches: master https://developer.blender.org/rB8ba63026964bce2b8e454f50766627ce629a0da4 Geometry Nodes: fix combining field inputs This was an oversight in rB7b88a4a3ba7eb9b839afa6c42d070812a3af7997. === M source/blender/functions/intern/field.cc === diff --git a/source/blender/functions/intern/field.cc b/source/blender/functions/intern/field.cc index a014fd113e4..5fa493c8336 100644 --- a/source/blender/functions/intern/field.cc +++ b/source/blender/functions/intern/field.cc @@ -571,7 +571,7 @@ static std::shared_ptr combine_field_inputs(Span fiel /* None of the field depends on an input. */ return {}; } - /* Check if all inputs are in the */ + /* Check if all inputs are in the candidate. */ Vector inputs_not_in_candidate; for (const GField &field : fields) { const std::shared_ptr &field_inputs = field.node().field_inputs(); @@ -604,7 +604,7 @@ static std::shared_ptr combine_field_inputs(Span fiel FieldOperation::FieldOperation(const MultiFunction &function, Vector inputs) : FieldNode(false), function_(&function), inputs_(std::move(inputs)) { - field_inputs_ = combine_field_inputs(inputs); + field_inputs_ = combine_field_inputs(inputs_); } /* ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [8709cbb73e7] master: Fix T93704: StructRNA.path_resolve fails silently with missing keys
Commit: 8709cbb73e7d76970780efa2cb6084c881809e2b Author: Campbell Barton Date: Mon Dec 13 23:27:07 2021 +1100 Branches: master https://developer.blender.org/rB8709cbb73e7d76970780efa2cb6084c881809e2b Fix T93704: StructRNA.path_resolve fails silently with missing keys Resolving the path to a missing pose-bone (for example), was not raising an error as it should have. Regression introduced in f9ccd26b037d43f2490d1f0263e45e775d30473d, which didn't update collection lookup logic to fail in the case the key of a collection wasn't found. === M source/blender/makesrna/intern/rna_access.c === diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index ab9568aa3de..b64fa58cf6b 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -4921,6 +4921,10 @@ static char *rna_path_token_in_brackets(const char **path, return buf; } +/** + * \return true when when the key in the path is correctly parsed and found in the collection + * or when the path is empty. + */ static bool rna_path_parse_collection_key(const char **path, PointerRNA *ptr, PropertyRNA *prop, @@ -4936,6 +4940,7 @@ static bool rna_path_parse_collection_key(const char **path, return true; } + bool found = false; if (**path == '[') { bool quoted; char *token; @@ -4950,7 +4955,7 @@ static bool rna_path_parse_collection_key(const char **path, /* check for "" to see if it is a string */ if (quoted) { if (RNA_property_collection_lookup_string(ptr, prop, token, r_nextptr)) { -/* pass */ +found = true; } else { r_nextptr->data = NULL; @@ -4963,7 +4968,7 @@ static bool rna_path_parse_collection_key(const char **path, return false; /* we can be sure the fixedbuf was used in this case */ } if (RNA_property_collection_lookup_int(ptr, prop, intkey, r_nextptr)) { -/* pass */ +found = true; } else { r_nextptr->data = NULL; @@ -4976,7 +4981,7 @@ static bool rna_path_parse_collection_key(const char **path, } else { if (RNA_property_collection_type_get(ptr, prop, r_nextptr)) { - /* pass */ + found = true; } else { /* ensure we quit on invalid values */ @@ -4984,7 +4989,7 @@ static bool rna_path_parse_collection_key(const char **path, } } - return true; + return found; } static bool rna_path_parse_array_index(const char **path, ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1686979747c] master: Geometry Nodes: move up destruct instructions in procedure
Commit: 1686979747c3b551ec91e8a3b1c7a9724ca381b2 Author: Jacques Lucke Date: Mon Dec 13 13:28:33 2021 +0100 Branches: master https://developer.blender.org/rB1686979747c3b551ec91e8a3b1c7a9724ca381b2 Geometry Nodes: move up destruct instructions in procedure This implements an optimization pass for multi-function procedures. It optimizes memory reuse by moving destruct instructions up. For more details see the in-code comment. In very large fields with many short lived intermediate values, this change can improve performance 3-4x. Furthermore, in such cases, peak memory consumption is reduced significantly (e.g. 100x lower peak memory usage). Differential Revision: https://developer.blender.org/D13548 === M source/blender/functions/CMakeLists.txt M source/blender/functions/FN_field.hh A source/blender/functions/FN_multi_function_procedure_optimization.hh M source/blender/functions/intern/field.cc A source/blender/functions/intern/multi_function_procedure_optimization.cc === diff --git a/source/blender/functions/CMakeLists.txt b/source/blender/functions/CMakeLists.txt index 63c11164275..9cfaf3eabea 100644 --- a/source/blender/functions/CMakeLists.txt +++ b/source/blender/functions/CMakeLists.txt @@ -38,6 +38,7 @@ set(SRC intern/multi_function_procedure.cc intern/multi_function_procedure_builder.cc intern/multi_function_procedure_executor.cc + intern/multi_function_procedure_optimization.cc FN_cpp_type.hh FN_cpp_type_make.hh @@ -59,6 +60,7 @@ set(SRC FN_multi_function_procedure.hh FN_multi_function_procedure_builder.hh FN_multi_function_procedure_executor.hh + FN_multi_function_procedure_optimization.hh FN_multi_function_signature.hh ) diff --git a/source/blender/functions/FN_field.hh b/source/blender/functions/FN_field.hh index 57c2753b951..cf96eff62bd 100644 --- a/source/blender/functions/FN_field.hh +++ b/source/blender/functions/FN_field.hh @@ -53,9 +53,6 @@ #include "FN_generic_virtual_array.hh" #include "FN_multi_function_builder.hh" -#include "FN_multi_function_procedure.hh" -#include "FN_multi_function_procedure_builder.hh" -#include "FN_multi_function_procedure_executor.hh" namespace blender::fn { diff --git a/source/blender/functions/FN_multi_function_procedure_optimization.hh b/source/blender/functions/FN_multi_function_procedure_optimization.hh new file mode 100644 index 000..e5ffc12b241 --- /dev/null +++ b/source/blender/functions/FN_multi_function_procedure_optimization.hh @@ -0,0 +1,61 @@ +/* + * 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. + */ + +#pragma once + +/** \file + * \ingroup fn + * + * A #MFProcedure optimization pass takes an existing procedure and changes it in a way that + * improves its performance when executed. + * + * Oftentimes it would also be possible to implement a specific optimization directly during + * construction of the initial #MFProcedure. There is a trade-off between doing that or just + * building a "simple" procedure and then optimizing it uses separate optimization passes. + * - Doing optimizations directly during construction is typically faster than doing it as a + * separate pass. However, it would be much harder to turn the optimization off when it is not + * necessary, making the construction potentially slower in those cases. + * - Doing optimizations directly would also make code more complex, because it mixes the logic + * that generates the procedure from some other data with optimization decisions. + * - Having a separate pass allows us to use it in different places when necessary. + * - Having a separate pass allows us to enable and disable it easily to better understand its + * impact on performance. + */ + +#include "FN_multi_function_procedure.hh" + +namespace blender::fn::procedure_optimization { + +/** + * When generating a procedure, destruct instructions (#MFDestructInstruction) have to be inserted + * for all variables that are not outputs. Often the simplest approach is to add these instructions + * at the very end. However, when the procedure is executed this is not optimal, because many more + * variables are initialized at the sam
[Bf-blender-cvs] [08bd773383c] temp-gpu-image-engine: View single channel buffers in grey scale.
Commit: 08bd773383c34783289aec4877b29fc88f407087 Author: Jeroen Bakker Date: Mon Dec 13 12:59:09 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB08bd773383c34783289aec4877b29fc88f407087 View single channel buffers in grey scale. === M source/blender/imbuf/intern/transform.cc === diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index 86a1eefb419..c83f5c57fd1 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -387,7 +387,7 @@ class ChannelConverter { } else if constexpr (std::is_same_v && SourceNumChannels == 1 && DestinationNumChannels == 4) { - copy_v4_fl4(texel_pointer.get_pointer(), sample[0], 0.0f, 0.0f, 1.0f); + copy_v4_fl4(texel_pointer.get_pointer(), sample[0], sample[0], sample[0], 1.0f); } else { BLI_assert_unreachable(); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [6739b4756de] temp-gpu-image-engine: Moved UVWrapping to template argument of the sampler.
Commit: 6739b4756de4cf0d97f2b1351d71b065f70337c7 Author: Jeroen Bakker Date: Mon Dec 13 12:46:37 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB6739b4756de4cf0d97f2b1351d71b065f70337c7 Moved UVWrapping to template argument of the sampler. This adds back wrap repeat linear sampling. === M source/blender/imbuf/intern/transform.cc === diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index 922e313bada..86a1eefb419 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -138,7 +138,7 @@ class NoDiscard : public BaseDiscard { }; /** - * \brief pointer to a texel to write or read serial. + * \brief Pointer to a texel to write or read serial. */ template< /** @@ -190,7 +190,79 @@ class TexelPointer { } }; -template class Sampler { +/** + * \brief Wrapping mode for the uv coordinates. + * + * Subclasses have the ability to change the UV coordinates before the source buffer will be + * sampled. + */ +class BaseUVWrapping { + public: + /** + * \brief modify the given u coordinate. + */ + virtual float modify_u(const ImBuf *source_buffer, float u) = 0; + + /** + * \brief modify the given v coordinate. + */ + virtual float modify_v(const ImBuf *source_buffer, float v) = 0; +}; + +/** + * \brief UVWrapping method that does not modify the UV coordinates. + */ +class PassThroughUV : public BaseUVWrapping { + public: + float modify_u(const ImBuf *UNUSED(source_buffer), float u) override + { +return u; + } + + float modify_v(const ImBuf *UNUSED(source_buffer), float v) override + { +return v; + } +}; + +/** + * \brief UVWrapping method that wrap repeats the UV coordinates. + */ +class WrapRepeatUV : public BaseUVWrapping { + public: + float modify_u(const ImBuf *source_buffer, float u) override + + { +int x = (int)floor(u); +x = x % source_buffer->x; +if (x < 0) { + x += source_buffer->x; +} +return x; + } + + float modify_v(const ImBuf *source_buffer, float v) override + { +int y = (int)floor(v); +y = y % source_buffer->y; +if (y < 0) { + y += source_buffer->y; +} +return y; + } +}; + +template +class Sampler { + UVWrapping uv_wrapper; + public: using ChannelType = StorageType; static const int ChannelLen = NumChannels; @@ -198,20 +270,45 @@ template && NumChannels == 4) { - bilinear_interpolation_color_fl(source, nullptr, r_sample.begin(), u, v); + bilinear_interpolation_color_fl(source, nullptr, r_sample.begin(), wrapped_u, wrapped_v); } else if constexpr (Filter == IMB_FILTER_NEAREST && std::is_same_v && NumChannels == 4) { - nearest_interpolation_color_char(source, r_sample.begin(), nullptr, u, v); + nearest_interpolation_color_char(source, r_sample.begin(), nullptr, wrapped_u, wrapped_v); } else if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v && NumChannels == 4) { - bilinear_interpolation_color_char(source, r_sample.begin(), nullptr, u, v); + bilinear_interpolation_color_char(source, r_sample.begin(), nullptr, wrapped_u, wrapped_v); +} +else if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v) { + if constexpr (std::is_same_v) { +BLI_bilinear_interpolation_wrap_fl(source->rect_float, + r_sample.begin(), + source->x, + source->y, + NumChannels, + u, + v, + true, + true); + } + else { +BLI_bilinear_interpolation_fl(source->rect_float, + r_sample.begin(), + source->x, + source->y, + NumChannels, + wrapped_u, + wrapped_v); + } } else if constexpr (Filter == IMB_FILTER_NEAREST && std::is_same_v) { - sample_nearest_float(source, u, v, r_sample); + sample_nearest_float(source, wrapped_u, wrapped_v, r_sample); } else { /* Unsupported sampler. */ @@ -298,68 +395,6 @@ class ChannelConverter { } }; -/** - * \brief Wrapping mode for the uv coordinates. - * - * Subclasses have the ability to change the UV coordinates before the source buffer will be - * sampled. - */ -class BaseUVWrapping { - public: - /** - * \brief modify the given u coordinate. - */ - virtual float modif
[Bf-blender-cvs] [bc77184563a] temp-gpu-image-engine: Added support for 1, 2 and 3 channel float buffers.
Commit: bc77184563ae6a704fa4f3d48382b506f30067aa Author: Jeroen Bakker Date: Mon Dec 13 12:11:25 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rBbc77184563ae6a704fa4f3d48382b506f30067aa Added support for 1, 2 and 3 channel float buffers. === M source/blender/draw/engines/image/image_drawing_mode.hh M source/blender/imbuf/intern/transform.cc === diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh index 0328bcc70a2..940ecd7b72b 100644 --- a/source/blender/draw/engines/image/image_drawing_mode.hh +++ b/source/blender/draw/engines/image/image_drawing_mode.hh @@ -377,8 +377,7 @@ template class ScreenSpaceDrawingMode : public AbstractD rctf crop_rect; rctf *crop_rect_ptr = nullptr; -/* TODO: use regular when drawing none repeating single tile buffers. */ -eIMBTransformMode transform_mode; // = IMB_TRANSFORM_MODE_REGULAR; +eIMBTransformMode transform_mode; if (instance_data.flags.do_tile_drawing) { transform_mode = IMB_TRANSFORM_MODE_WRAP_REPEAT; } diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index a62e65b7a7d..922e313bada 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -115,8 +115,8 @@ class CropSource : public BaseDiscard { */ virtual bool should_discard(const TransformUserData &user_data, const float uv[2]) { -return uv[0] < user_data.src_crop.xmin && uv[0] >= user_data.src_crop.xmax && - uv[1] < user_data.src_crop.ymin && uv[1] >= user_data.src_crop.ymax; +return uv[0] < user_data.src_crop.xmin || uv[0] >= user_data.src_crop.xmax || + uv[1] < user_data.src_crop.ymin || uv[1] >= user_data.src_crop.ymax; } }; @@ -196,32 +196,55 @@ template; - virtual void sample(const ImBuf *source, - const float u, - const float v, - StorageType r_sample[NumChannels]) + void sample(const ImBuf *source, const float u, const float v, SampleType &r_sample) { -if constexpr (Filter == IMB_FILTER_NEAREST && std::is_same_v && +if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v && NumChannels == 4) { - nearest_interpolation_color_fl(source, nullptr, r_sample, u, v); -} -else if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v && - NumChannels == 4) { - bilinear_interpolation_color_fl(source, nullptr, r_sample, u, v); + bilinear_interpolation_color_fl(source, nullptr, r_sample.begin(), u, v); } else if constexpr (Filter == IMB_FILTER_NEAREST && std::is_same_v && NumChannels == 4) { - nearest_interpolation_color_char(source, r_sample, nullptr, u, v); + nearest_interpolation_color_char(source, r_sample.begin(), nullptr, u, v); } else if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v && NumChannels == 4) { - bilinear_interpolation_color_char(source, r_sample, nullptr, u, v); + bilinear_interpolation_color_char(source, r_sample.begin(), nullptr, u, v); +} +else if constexpr (Filter == IMB_FILTER_NEAREST && std::is_same_v) { + sample_nearest_float(source, u, v, r_sample); } else { /* Unsupported sampler. */ BLI_assert_unreachable(); } } + + private: + void sample_nearest_float(const ImBuf *source, +const float u, +const float v, +SampleType &r_sample) + { +BLI_STATIC_ASSERT(std::is_same_v); + +/* ImBuf in must have a valid rect or rect_float, assume this is already checked */ +int x1 = (int)(u); +int y1 = (int)(v); + +/* Break when sample outside image is requested. */ +if (x1 < 0 || x1 >= source->x || y1 < 0 || y1 >= source->y) { + for (int i = 0; i < NumChannels; i++) { +r_sample[i] = 0.0f; + } + return; +} + +const size_t offset = ((size_t)source->x * y1 + x1) * NumChannels; +const float *dataF = source->rect_float + offset; +for (int i = 0; i < NumChannels; i++) { + r_sample[i] = dataF[i]; +} + } }; /** @@ -232,6 +255,8 @@ template 4 channel unsigned char. * - 4 channel float -> 4 channel float. * - 3 channel float -> 4 channel float. + * - 2 channel float -> 4 channel float. + * - 1 channel float -> 4 channel float. */ template class ChannelConverter { @@ -259,6 +284,17 @@ class ChannelConverter { DestinationNumChannels == 4) { copy_v4_fl4(texel_pointer.get_pointer(), sample[0], sample[1], sample[2], 1.0f); } +else if constexpr (std::is_same_v && SourceNumChannels == 2 && +
[Bf-blender-cvs] [cb54fae36cf] temp-gpu-image-engine: Added support for 3 channel source buffers.
Commit: cb54fae36cf0d7ac9cb66508074f89a96449404e Author: Jeroen Bakker Date: Mon Dec 13 11:05:31 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rBcb54fae36cf0d7ac9cb66508074f89a96449404e Added support for 3 channel source buffers. === M source/blender/imbuf/intern/transform.cc === diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index 8bfca373aee..a62e65b7a7d 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -21,6 +21,7 @@ * \ingroup imbuf */ +#include #include #include "BLI_math.h" @@ -151,6 +152,10 @@ template< */ int NumChannels = 4> class TexelPointer { + public: + static const int ChannelLen = NumChannels; + + private: StorageType *pointer; public: @@ -170,26 +175,6 @@ class TexelPointer { pointer = nullptr; } } - /* -float *get_float_pointer() -{ - if constexpr (std::is_same_v) { -return pointer; - } - else { -return nullptr; - } -} -unsigned char *get_uchar_pointer() -{ - if constexpr (std::is_same_v) { -return pointer; - } - else { -return nullptr; - } -} -*/ /** * \brief Get pointer to the current texel to write to. @@ -207,6 +192,10 @@ class TexelPointer { template class Sampler { public: + using ChannelType = StorageType; + static const int ChannelLen = NumChannels; + using SampleType = std::array; + virtual void sample(const ImBuf *source, const float u, const float v, @@ -235,6 +224,44 @@ template 4 channel unsigned char. + * - 4 channel float -> 4 channel float. + * - 3 channel float -> 4 channel float. + */ +template +class ChannelConverter { + public: + using SampleType = std::array; + using TexelType = TexelPointer; + + /** + * \brief Convert the number of channels of the given sample to match the texel pointer and store + * it at the location the texel_pointer points at. + */ + void convert_and_store(const SampleType &sample, TexelType &texel_pointer) + { +if constexpr (std::is_same_v) { + BLI_STATIC_ASSERT(SourceNumChannels == 4, "Unsigned chars always have 4 channels."); + BLI_STATIC_ASSERT(DestinationNumChannels == 4, "Unsigned chars always have 4 channels."); + + copy_v4_v4_uchar(texel_pointer.get_pointer(), sample.begin()); +} +else if constexpr (std::is_same_v && SourceNumChannels == 4 && + DestinationNumChannels == 4) { + copy_v4_v4(texel_pointer.get_pointer(), sample.begin()); +} +else if constexpr (std::is_same_v && SourceNumChannels == 3 && + DestinationNumChannels == 4) { + copy_v4_fl4(texel_pointer.get_pointer(), sample[0], sample[1], sample[2], 1.0f); +} + } +}; + /** * \brief Wrapping mode for the uv coordinates. * @@ -326,6 +353,10 @@ class ScanlineProcessor { UVWrapping uv_wrapping; OutputTexelPointer output; Sampler sampler; + ChannelConverter + channel_converter; public: void process(const TransformUserData *user_data, int scanline) @@ -338,11 +369,12 @@ class ScanlineProcessor { output.init_pixel_pointer(user_data->dst, 0, scanline); for (int xi = 0; xi < width; xi++) { if (!discarder.should_discard(*user_data, uv)) { - +typename Sampler::SampleType sample; sampler.sample(user_data->src, uv_wrapping.modify_u(*user_data, uv[0]), uv_wrapping.modify_v(*user_data, uv[1]), - output.get_pointer()); + &sample[0]); +channel_converter.convert_and_store(sample, output); } add_v2_v2(uv, user_data->add_x); @@ -358,7 +390,10 @@ template void transform_scanline_function(void *custom_data, processor.process(user_data, scanline); } -template +template ScanlineThreadFunc get_scanline_function(const eIMBTransformMode mode) { @@ -366,20 +401,20 @@ ScanlineThreadFunc get_scanline_function(const eIMBTransformMode mode) case IMB_TRANSFORM_MODE_REGULAR: return transform_scanline_function< ScanlineProcessor, -TexelPointer, +Sampler, +TexelPointer, PassThroughUV>>; case IMB_TRANSFORM_MODE_CROP_SRC: return transform_scanline_function< ScanlineProcessor, -TexelPointer, +Sampler, +TexelPointer, PassThroughUV>>; case IMB_TRANSFORM_MODE_WRAP_REPEAT: return transform_scanline_function< ScanlineProcessor, -TexelPoin
[Bf-blender-cvs] [86ca5f5e94c] temp-gpu-image-engine: ImBuf transform: Added Sampler.
Commit: 86ca5f5e94c3aae5ff3acbb48548ca8fab346cd0 Author: Jeroen Bakker Date: Mon Dec 13 09:19:12 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB86ca5f5e94c3aae5ff3acbb48548ca8fab346cd0 ImBuf transform: Added Sampler. The sampler will hide the interpolation functions and would allow us to add interpolation functions for none 4 channel buffers. === M source/blender/imbuf/intern/transform.cc === diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index 814e21e730c..8bfca373aee 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -144,24 +144,24 @@ template< * \brief Kind of buffer. * Possible options: float, unsigned char. */ -typename ImBufStorageType = float, +typename StorageType = float, /** * \brief Number of channels of a single pixel. */ int NumChannels = 4> class TexelPointer { - ImBufStorageType *pointer; + StorageType *pointer; public: void init_pixel_pointer(const ImBuf *image_buffer, int x, int y) { const size_t offset = (y * (size_t)image_buffer->x + x) * NumChannels; -if constexpr (std::is_same_v) { +if constexpr (std::is_same_v) { pointer = image_buffer->rect_float + offset; } -else if constexpr (std::is_same_v) { +else if constexpr (std::is_same_v) { pointer = const_cast( static_cast(static_cast(image_buffer->rect)) + offset); @@ -170,24 +170,33 @@ class TexelPointer { pointer = nullptr; } } - - float *get_float_pointer() - { -if constexpr (std::is_same_v) { - return pointer; + /* +float *get_float_pointer() +{ + if constexpr (std::is_same_v) { +return pointer; + } + else { +return nullptr; + } } -else { - return nullptr; +unsigned char *get_uchar_pointer() +{ + if constexpr (std::is_same_v) { +return pointer; + } + else { +return nullptr; + } } - } - unsigned char *get_uchar_pointer() +*/ + + /** + * \brief Get pointer to the current texel to write to. + */ + StorageType *get_pointer() { -if constexpr (std::is_same_v) { - return pointer; -} -else { - return nullptr; -} +return pointer; } void increase_pixel_pointer() @@ -196,6 +205,36 @@ class TexelPointer { } }; +template class Sampler { + public: + virtual void sample(const ImBuf *source, + const float u, + const float v, + StorageType r_sample[NumChannels]) + { +if constexpr (Filter == IMB_FILTER_NEAREST && std::is_same_v && + NumChannels == 4) { + nearest_interpolation_color_fl(source, nullptr, r_sample, u, v); +} +else if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v && + NumChannels == 4) { + bilinear_interpolation_color_fl(source, nullptr, r_sample, u, v); +} +else if constexpr (Filter == IMB_FILTER_NEAREST && + std::is_same_v && NumChannels == 4) { + nearest_interpolation_color_char(source, r_sample, nullptr, u, v); +} +else if constexpr (Filter == IMB_FILTER_BILINEAR && + std::is_same_v && NumChannels == 4) { + bilinear_interpolation_color_char(source, r_sample, nullptr, u, v); +} +else { + /* Unsupported sampler. */ + BLI_assert_unreachable(); +} + } +}; + /** * \brief Wrapping mode for the uv coordinates. * @@ -269,7 +308,7 @@ template< /** * \brief Color interpolation function to read from the source buffer. */ -InterpolationColorFunction ColorInterpolation, +typename Sampler, /** * \brief Kernel to store to the destination buffer. @@ -286,6 +325,7 @@ class ScanlineProcessor { Discard discarder; UVWrapping uv_wrapping; OutputTexelPointer output; + Sampler sampler; public: void process(const TransformUserData *user_data, int scanline) @@ -298,11 +338,11 @@ class ScanlineProcessor { output.init_pixel_pointer(user_data->dst, 0, scanline); for (int xi = 0; xi < width; xi++) { if (!discarder.should_discard(*user_data, uv)) { -ColorInterpolation(user_data->src, - output.get_uchar_pointer(), - output.get_float_pointer(), - uv_wrapping.modify_u(*user_data, uv[0]), - uv_wrapping.modify_v(*user_data, uv[1])); + +sampler.sample(user_data->src, + uv_wrapping.modify_u(*user_data, uv[0]), + uv_wrapping.modify_v(*user_data, uv[1]), + output.get_pointer()); } add_v2_
[Bf-blender-cvs] [a37147347d3] temp-gpu-image-engine: Revert "Revert recent changes to ImBuf transform"
Commit: a37147347d39166931e3f8fad9c1472def98de07 Author: Jeroen Bakker Date: Mon Dec 13 07:45:05 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rBa37147347d39166931e3f8fad9c1472def98de07 Revert "Revert recent changes to ImBuf transform" This reverts commit 5a3d5f751f238e568da2bd2b3e3b08dc9e79e3a1. === M source/blender/imbuf/intern/transform.cc === diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index 0cb363c3bce..a0b39cd5b7c 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -85,23 +85,206 @@ struct TransformUserData { } }; -template -class ScanlineProcessor { - private: - void pixel_from_buffer(const struct ImBuf *ibuf, unsigned char **outI, float **outF, int y) const +/** + * \brief Base class for source discarding. + * + * The class decides if a specific uv coordinate from the source buffer should be ignored. + * This is used to mix multiple images over a single output buffer. Discarded pixels will + * not change the output buffer. + */ +class BaseDiscard { + public: + virtual ~BaseDiscard() = default; + /** + * \brief Should the source pixel at the given uv coordinate be discarded. + */ + virtual bool should_discard(const TransformUserData &user_data, const float uv[2]) = 0; +}; + +/** + * \brief Crop uv-coordinates that are outside the user data src_crop rect. + */ +class CropSource : public BaseDiscard { + public: + /** + * \brief Should the source pixel at the given uv coordinate be discarded. + * + * Uses user_data.src_crop to determine if the uv coordinate should be skipped. + */ + virtual bool should_discard(const TransformUserData &user_data, const float uv[2]) { -const size_t offset = ((size_t)ibuf->x) * y * ChannelLen; +return uv[0] < user_data.src_crop.xmin && uv[0] >= user_data.src_crop.xmax && + uv[1] < user_data.src_crop.ymin && uv[1] >= user_data.src_crop.ymax; + } +}; + +/** + * \brief Discard that does not discard anything. + */ +class NoDiscard : public BaseDiscard { + public: + /** + * \brief Should the source pixel at the given uv coordinate be discarded. + * + * Will never discard any pixels. + */ + virtual bool should_discard(const TransformUserData &UNUSED(user_data), + const float UNUSED(uv[2])) + { +return false; + } +}; + +/** + * \brief pointer to a texel to write or read serial. + */ +template< +/** + * \brief Kind of buffer. + * Possible options: float, unsigned char. + */ +typename ImBufStorageType = float, -if (ibuf->rect) { - *outI = (unsigned char *)ibuf->rect + offset; +/** + * \brief Number of channels of a single pixel. + */ +int NumChannels = 4> +class TexelPointer { + ImBufStorageType *pointer; + + public: + void init_pixel_pointer(const ImBuf *image_buffer, int x, int y) + { +const size_t offset = (y * (size_t)image_buffer->x + x) * NumChannels; + +if constexpr (std::is_same_v) { + pointer = image_buffer->rect_float + offset; +} +else if constexpr (std::is_same_v) { + pointer = image_buffer->rect + offset; } +else { + pointer = nullptr; +} + } -if (ibuf->rect_float) { - *outF = ibuf->rect_float + offset; + float *get_float_pointer() + { +if constexpr (std::is_same_v) { + return pointer; +} +else { + return nullptr; +} + } + unsigned char *get_uchar_pointer() + { +if constexpr (std::is_same_v) { + return pointer; +} +else { + return nullptr; } } + void increase_pixel_pointer() + { +pointer += NumChannels; + } +}; + +/** + * \brief Wrapping mode for the uv coordinates. + * + * Subclasses have the ability to change the UV coordinates before the source buffer will be + * sampled. + */ +class BaseUVWrapping { + public: + /** + * \brief modify the given u coordinate. + */ + virtual float modify_u(const TransformUserData &user_data, float u) = 0; + + /** + * \brief modify the given v coordinate. + */ + virtual float modify_v(const TransformUserData &user_data, float v) = 0; +}; + +/** + * \brief UVWrapping method that does not modify the UV coordinates. + */ +class PassThroughUV : public BaseUVWrapping { + public: + float modify_u(const TransformUserData &UNUSED(user_data), float u) override + { +return u; + } + + float modify_v(const TransformUserData &UNUSED(user_data), float v) override + { +return v; + } +}; + +/** + * \brief UVWrapping method that wrap repeats the UV coordinates. + */ +class WrapRepeatUV : public BaseUVWrapping { + public: + float modify_u(const TransformUserData &user_data, float u) override + + { +int x = (int)floor(u); +x = x % user_data.src->x; +if (x < 0) { + x +=
[Bf-blender-cvs] [a5ed6f98980] temp-gpu-image-engine: Merge branch 'master' into temp-gpu-image-engine
Commit: a5ed6f98980a4ace5d52f33672c3c9cc3f82fe53 Author: Jeroen Bakker Date: Fri Dec 10 15:39:23 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rBa5ed6f98980a4ace5d52f33672c3c9cc3f82fe53 Merge branch 'master' into temp-gpu-image-engine === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [a27bc7c372c] temp-gpu-image-engine: Fix crash in sequencer tests.
Commit: a27bc7c372c9f1b59f3940f820b82822e7bc2f60 Author: Jeroen Bakker Date: Mon Dec 13 08:21:41 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rBa27bc7c372c9f1b59f3940f820b82822e7bc2f60 Fix crash in sequencer tests. === M source/blender/imbuf/intern/transform.cc === diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index a0b39cd5b7c..814e21e730c 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -162,7 +162,9 @@ class TexelPointer { pointer = image_buffer->rect_float + offset; } else if constexpr (std::is_same_v) { - pointer = image_buffer->rect + offset; + pointer = const_cast( + static_cast(static_cast(image_buffer->rect)) + + offset); } else { pointer = nullptr; @@ -316,7 +318,7 @@ template void transform_scanline_function(void *custom_data, processor.process(user_data, scanline); } -template +template ScanlineThreadFunc get_scanline_function(const eIMBTransformMode mode) { @@ -324,17 +326,17 @@ ScanlineThreadFunc get_scanline_function(const eIMBTransformMode mode) case IMB_TRANSFORM_MODE_REGULAR: return transform_scanline_function, + TexelPointer, PassThroughUV>>; case IMB_TRANSFORM_MODE_CROP_SRC: return transform_scanline_function, + TexelPointer, PassThroughUV>>; case IMB_TRANSFORM_MODE_WRAP_REPEAT: return transform_scanline_function, + TexelPointer, WrapRepeatUV>>; } @@ -351,13 +353,13 @@ static void transform(TransformUserData *user_data, const eIMBTransformMode mode constexpr InterpolationColorFunction interpolation_function = Filter == IMB_FILTER_NEAREST ? nearest_interpolation_color_fl : bilinear_interpolation_color_fl; -scanline_func = get_scanline_function(mode); +scanline_func = get_scanline_function(mode); } else if (user_data->dst->rect) { constexpr InterpolationColorFunction interpolation_function = Filter == IMB_FILTER_NEAREST ? nearest_interpolation_color_char : bilinear_interpolation_color_char; -scanline_func = get_scanline_function(mode); +scanline_func = get_scanline_function(mode); } if (scanline_func != nullptr) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [4399a01de2b] temp-gpu-image-engine: Merge branch 'master' into temp-gpu-image-engine
Commit: 4399a01de2b53558573a230ac4c878491fe1b90f Author: Jeroen Bakker Date: Mon Dec 13 07:43:59 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB4399a01de2b53558573a230ac4c878491fe1b90f Merge branch 'master' into temp-gpu-image-engine === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [484eb6b6cb5] temp-gpu-image-engine: Merge branch 'master' into temp-gpu-image-engine
Commit: 484eb6b6cb5316e34ebf4107b348caf5cb73506e Author: Jeroen Bakker Date: Fri Dec 10 12:41:12 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB484eb6b6cb5316e34ebf4107b348caf5cb73506e Merge branch 'master' into temp-gpu-image-engine === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [915464b6977] temp-gpu-image-engine: Fix typo in cmakelists.txt
Commit: 915464b69776e14e1e8af3dd96c9e73b57703ebe Author: Jeroen Bakker Date: Fri Dec 10 11:48:19 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB915464b69776e14e1e8af3dd96c9e73b57703ebe Fix typo in cmakelists.txt === M source/blender/draw/CMakeLists.txt === diff --git a/source/blender/draw/CMakeLists.txt b/source/blender/draw/CMakeLists.txt index a36c7d832bb..b895e18aa3d 100644 --- a/source/blender/draw/CMakeLists.txt +++ b/source/blender/draw/CMakeLists.txt @@ -220,7 +220,7 @@ set(SRC engines/eevee/eevee_lightcache.h engines/eevee/eevee_lut.h engines/eevee/eevee_private.h - engines/external/external_engine.hb + engines/external/external_engine.h engines/image/image_batches.hh engines/image/image_drawing_mode.hh engines/image/image_engine.h ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [cbf56b59160] temp-gpu-image-engine: Merge branch 'master' into temp-gpu-image-engine
Commit: cbf56b59160cf12e0e9fc9d2083b27e578bd3048 Author: Jeroen Bakker Date: Fri Dec 10 09:31:42 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rBcbf56b59160cf12e0e9fc9d2083b27e578bd3048 Merge branch 'master' into temp-gpu-image-engine === === diff --cc source/blender/blenlib/BLI_math_matrix.h index 78bd8371aa7,4beb2508937..a3592b6ca5f --- a/source/blender/blenlib/BLI_math_matrix.h +++ b/source/blender/blenlib/BLI_math_matrix.h @@@ -312,8 -397,12 +397,13 @@@ void invert_m4_m4_safe_ortho(float Ainv void scale_m3_fl(float R[3][3], float scale); void scale_m4_fl(float R[4][4], float scale); +void scale_m4_v2(float R[4][4], const float scale[2]); + /** + * This computes the overall volume scale factor of a transformation matrix. + * For an orthogonal matrix, it is the product of all three scale values. + * Returns a negative value if the transform is flipped by negative scale. + */ float mat3_to_volume_scale(const float M[3][3]); float mat4_to_volume_scale(const float M[4][4]); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [51f9c2fdd4c] temp-gpu-image-engine: Merge branch 'master' into temp-gpu-image-engine
Commit: 51f9c2fdd4c1f38eeefc3658228828ee32fd3fc0 Author: Jeroen Bakker Date: Fri Dec 10 10:41:00 2021 +0100 Branches: temp-gpu-image-engine https://developer.blender.org/rB51f9c2fdd4c1f38eeefc3658228828ee32fd3fc0 Merge branch 'master' into temp-gpu-image-engine === === ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [e549d6c1bd2] master: Fix T93169: Weightpaint falloff popover drawn twice
Commit: e549d6c1bd2ded2f0d33db0489c68a84a822fd34 Author: Philipp Oeser Date: Thu Nov 18 10:45:35 2021 +0100 Branches: master https://developer.blender.org/rBe549d6c1bd2ded2f0d33db0489c68a84a822fd34 Fix T93169: Weightpaint falloff popover drawn twice This came with {rBf8a0e102cf5e}. The panel was meant specifically for the gradient tool, but since it was given the ".weighpaint" context, it would also draw as part of generic header toolsettings drawing. Now remove this context on purpose and only draw this specifically from the gradient tools ToolDef. Maniphest Tasks: T93169 Differential Revision: https://developer.blender.org/D13268 === M release/scripts/startup/bl_ui/space_view3d_toolbar.py === diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index acc3d933b85..01850676519 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -689,7 +689,9 @@ class VIEW3D_PT_tools_brush_stroke_smooth_stroke(Panel, View3DPaintPanel, Smooth class VIEW3D_PT_tools_weight_gradient(Panel, View3DPaintPanel): -bl_context = ".weightpaint" # dot on purpose (access from topbar) +# dont give context on purpose to not show this in the generic header toolsettings +# this is added only in the gradient tool's ToolDef +#bl_context = ".weightpaint" # dot on purpose (access from topbar) bl_label = "Falloff" bl_options = {'DEFAULT_CLOSED'} ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs