Array Modifier "Merge" bug? #41983

Closed
opened 2014-09-28 03:21:27 +02:00 by Admiral Potato · 21 comments

System Information
Windows 7 Ultimate, 64 bit, GTX 680
Windows 8 pro, GTX 780ti

Blender Version
Broken: 2.72 RC1
Worked: 2.71

Short description of error
It seems that the Array modifier's "Merge" feature is no longer correctly. It seems to skip over connecting every other generated copy?

Exact steps for others to reproduce the error
In the attached .blend file, take a look at the top of this Octopus in both 2.71 and 2.72. The effect of the breakage seems to be exaggerated when using "alt-a" to play back the animation in an OpenGL shading mode.

8-adaptive_256-diff_100.gif

volume_octopus3_bugreport.blend

(simple example of bug array_mod.blend)

**System Information** Windows 7 Ultimate, 64 bit, GTX 680 Windows 8 pro, GTX 780ti **Blender Version** Broken: 2.72 RC1 Worked: 2.71 **Short description of error** It seems that the Array modifier's "Merge" feature is no longer correctly. It seems to skip over connecting every other generated copy? **Exact steps for others to reproduce the error** In the attached .blend file, take a look at the top of this Octopus in both 2.71 and 2.72. The effect of the breakage seems to be exaggerated when using "alt-a" to play back the animation in an OpenGL shading mode. ![8-adaptive_256-diff_100.gif](https://archive.blender.org/developer/F113275/8-adaptive_256-diff_100.gif) [volume_octopus3_bugreport.blend](https://archive.blender.org/developer/F113274/volume_octopus3_bugreport.blend) (simple example of bug [array_mod.blend](https://archive.blender.org/developer/F114106/array_mod.blend))
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @AdmiralPotato

Added subscriber: @AdmiralPotato

#42031 was marked as duplicate of this issue

#42031 was marked as duplicate of this issue

Added subscriber: @mont29

Added subscriber: @mont29
Bastien Montagne self-assigned this 2014-09-28 08:47:06 +02:00

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Gah, this behavior was intended, from comments in code. Yet, I really see no good reason for it - if it’s the idea that this could end in merging vertices that are farther than threshold distance (neighbor-from-neighbor additive 'error'), it’s way less painful than bug reported here imho.

Campbell, really need your advice here, this simple patch fixes the bug, do you see any issue with it?

P149: (An Untitled Masterwork)

diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index 6679648..d338ac0 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -606,11 +606,6 @@ static DerivedMesh *arrayModifier_doArray(
 					int target = full_doubles_map[prev_chunk_index];
 					if (target != -1) {
 						target += chunk_nverts; /* translate mapping */
-						/* The rule here is to not follow mapping to chunk N-2, which could be too far
-						 * so if target vertex was itself mapped, then this vertex is not mapped */
-						if (full_doubles_map[target] != -1) {
-							target = -1;
-						}
 					}
 					full_doubles_map[this_chunk_index] = target;
 				}
@@ -624,7 +619,7 @@ static DerivedMesh *arrayModifier_doArray(
 				        c * chunk_nverts,
 				        chunk_nverts,
 				        amd->merge_dist,
-				        false);
+				        true);
 			}
 		}
 	}
@@ -644,7 +639,7 @@ static DerivedMesh *arrayModifier_doArray(
 		        first_chunk_start,
 		        first_chunk_nverts,
 		        amd->merge_dist,
-		        false);
+		        true);
 	}
 
 	/* start capping */
@@ -669,7 +664,7 @@ static DerivedMesh *arrayModifier_doArray(
 			        start_cap_start,
 			        start_cap_nverts,
 			        amd->merge_dist,
-			        false);
+			        true);
 		}
 	}
 
@@ -694,7 +689,7 @@ static DerivedMesh *arrayModifier_doArray(
 			        end_cap_start,
 			        end_cap_nverts,
 			        amd->merge_dist,
-			        false);
+			        true);
 		}
 	}
 	/* done capping */
@@ -711,7 +706,12 @@ static DerivedMesh *arrayModifier_doArray(
 	if (use_merge) {
 		for (i = 0; i < result_nverts; i++) {
 			if (full_doubles_map- [x] != -1) {
-				tot_doubles++;
+				if (i == full_doubles_map[i]) {
+					full_doubles_map- [x] = -1;
+				}
+				else {
+					tot_doubles++;
+				}
 			}
 		}
 		if (tot_doubles > 0) {

Gah, this behavior was intended, from comments in code. Yet, I really see no good reason for it - if it’s the idea that this could end in merging vertices that are farther than threshold distance (neighbor-from-neighbor additive 'error'), it’s way less painful than bug reported here imho. Campbell, really need your advice here, this simple patch fixes the bug, do you see any issue with it? [P149: (An Untitled Masterwork)](https://archive.blender.org/developer/P149.txt) ``` diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 6679648..d338ac0 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -606,11 +606,6 @@ static DerivedMesh *arrayModifier_doArray( int target = full_doubles_map[prev_chunk_index]; if (target != -1) { target += chunk_nverts; /* translate mapping */ - /* The rule here is to not follow mapping to chunk N-2, which could be too far - * so if target vertex was itself mapped, then this vertex is not mapped */ - if (full_doubles_map[target] != -1) { - target = -1; - } } full_doubles_map[this_chunk_index] = target; } @@ -624,7 +619,7 @@ static DerivedMesh *arrayModifier_doArray( c * chunk_nverts, chunk_nverts, amd->merge_dist, - false); + true); } } } @@ -644,7 +639,7 @@ static DerivedMesh *arrayModifier_doArray( first_chunk_start, first_chunk_nverts, amd->merge_dist, - false); + true); } /* start capping */ @@ -669,7 +664,7 @@ static DerivedMesh *arrayModifier_doArray( start_cap_start, start_cap_nverts, amd->merge_dist, - false); + true); } } @@ -694,7 +689,7 @@ static DerivedMesh *arrayModifier_doArray( end_cap_start, end_cap_nverts, amd->merge_dist, - false); + true); } } /* done capping */ @@ -711,7 +706,12 @@ static DerivedMesh *arrayModifier_doArray( if (use_merge) { for (i = 0; i < result_nverts; i++) { if (full_doubles_map- [x] != -1) { - tot_doubles++; + if (i == full_doubles_map[i]) { + full_doubles_map- [x] = -1; + } + else { + tot_doubles++; + } } } if (tot_doubles > 0) { ```

Added subscriber: @Idlero

Added subscriber: @Idlero

Think this needs the regression tag, in fact :|

Think this needs the regression tag, in fact :|

Added subscriber: @igvalor2

Added subscriber: @igvalor2

So... Will the issue be resolved?

So... Will the issue be resolved?

This comment was removed by @ideasman42

*This comment was removed by @ideasman42*

This issue was referenced by 4c43fcf791

This issue was referenced by 4c43fcf791c3c26fe5f729ffe5e96bae2957e88a

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 4c43fcf791.

Closed by commit 4c43fcf791.

This issue was referenced by 561b52b356

This issue was referenced by 561b52b3562ab4e580d67cb228bd0515427af6ef
Author

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'
Author

Sadly, when I opened the blend file that I attached to this bug report with the newly released 2.72, I still had a similar but slightly different issue when animating. It now looks like the modifier is trying to find the very first vertex in the mesh, and merge all of the radially merged verts with that one, but only every other frame of animation. Would you please take a look at the previously attached blend file once more, and press alt-a to start animating it? That's where the problem persists.

See attached animated GIF for an example.

b0rken_at_272_realease.gif

Sadly, when I opened the blend file that I attached to this bug report with the newly released 2.72, I still had a similar but slightly different issue when animating. It now looks like the modifier is trying to find the very first vertex in the mesh, and merge all of the radially merged verts with that one, but only every other frame of animation. Would you please take a look at the previously attached blend file once more, and press alt-a to start animating it? That's where the problem persists. See attached animated GIF for an example. ![b0rken_at_272_realease.gif](https://archive.blender.org/developer/F115155/b0rken_at_272_realease.gif)

This issue was referenced by 1dd428ff6d

This issue was referenced by 1dd428ff6d45194fcabe1bdff62ede08f531a4ea

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 1dd428ff6d.

Closed by commit 1dd428ff6d.

This issue was referenced by 4c4c772496

This issue was referenced by 4c4c7724966e779e5879a721c1f663088c775c3f
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#41983
No description provided.