Shrinkwrap modifier with proyect not working in curves #68489

Closed
opened 2019-08-10 01:15:31 +02:00 by Jose Moreno · 12 comments

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: f6cb5f5449
Worked: (optional)

Short description of error
Hello, I´m trying to retopo cylinders using curves but when I use the option "project" the modifier just don't work, the other options works correctly

Exact steps for others to reproduce the error
Create a cylinder and scale it in Z axis until it looks like a pencil or similar, then create a curve (bezier or path) with the same direction of the cylinder and add some depth in the geometry panel of the curve until it fits the shape of the cylinder (a little bit inside), then add a shrinkwrap modifier to the curve and select the cylinder as target, then change the mode to proyect and the shrinkwrap will stop working.

{F7656692}Screenshot_3.png

#68489.blend

**System Information** Operating system: Windows-10-10.0.17134 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.64 **Blender Version** Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: `f6cb5f5449` Worked: (optional) **Short description of error** Hello, I´m trying to retopo cylinders using curves but when I use the option "project" the modifier just don't work, the other options works correctly **Exact steps for others to reproduce the error** Create a cylinder and scale it in Z axis until it looks like a pencil or similar, then create a curve (bezier or path) with the same direction of the cylinder and add some depth in the geometry panel of the curve until it fits the shape of the cylinder (a little bit inside), then add a shrinkwrap modifier to the curve and select the cylinder as target, then change the mode to proyect and the shrinkwrap will stop working. {[F7656692](https://archive.blender.org/developer/F7656692/Screenshot_2.png)}![Screenshot_3.png](https://archive.blender.org/developer/F7656695/Screenshot_3.png) [#68489.blend](https://archive.blender.org/developer/F8264289/T68489.blend)
Author

Added subscriber: @Parabox

Added subscriber: @Parabox

Added subscriber: @mano-wii

Added subscriber: @mano-wii

Thanks for the report.
Sorry for the delay in replying.
Can you provide a simple .blend file showing the problem?
This makes the investigation simpler.

Thanks for the report. Sorry for the delay in replying. Can you provide a simple .blend file showing the problem? This makes the investigation simpler.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm.

#68489.blend

Can confirm. [#68489.blend](https://archive.blender.org/developer/F8264289/T68489.blend)
Member

This appears to be working in 2.79.

This appears to be working in 2.79.
Member

Added subscriber: @mont29

Added subscriber: @mont29
Member

This seems to doing the trick:

P1206: T68489_snippet



diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index a2699e767e9..7fe3842e3e4 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -659,6 +659,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
   /* Prepare data to retrieve the direction in which we should project each vertex */
   if (calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
     if (calc->vert == NULL) {
+      /* this will happen for curves. */
       return;
     }
   }
diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c
index b8d0b19b7bf..48bdb5361aa 100644
--- a/source/blender/modifiers/intern/MOD_shrinkwrap.c
+++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c
@@ -108,8 +108,11 @@ static void deformVerts(ModifierData *md,
   struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
   Mesh *mesh_src = NULL;
 
-  if (ctx->object->type == OB_MESH) {
+  /* 4cde92303f made this MESH only */
+  /* Seems to work fine for curves though. */
+  if (ELEM(ctx->object->type, OB_MESH, OB_CURVE)) {
     /* mesh_src is only needed for vgroups. */
+    /* Nope, also needed for MOD_SHRINKWRAP_PROJECT 'calc.vert' in shrinkwrapModifier_deform() */
     mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false);
   }
 

CC @mont29
CC @mano-wii

This seems to doing the trick: [P1206: T68489_snippet](https://archive.blender.org/developer/P1206.txt) ``` diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index a2699e767e9..7fe3842e3e4 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -659,6 +659,7 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) /* Prepare data to retrieve the direction in which we should project each vertex */ if (calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { if (calc->vert == NULL) { + /* this will happen for curves. */ return; } } diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index b8d0b19b7bf..48bdb5361aa 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -108,8 +108,11 @@ static void deformVerts(ModifierData *md, struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); Mesh *mesh_src = NULL; - if (ctx->object->type == OB_MESH) { + /* 4cde92303f made this MESH only */ + /* Seems to work fine for curves though. */ + if (ELEM(ctx->object->type, OB_MESH, OB_CURVE)) { /* mesh_src is only needed for vgroups. */ + /* Nope, also needed for MOD_SHRINKWRAP_PROJECT 'calc.vert' in shrinkwrapModifier_deform() */ mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, numVerts, false, false); } ``` CC @mont29 CC @mano-wii

The patch looks ok, (if the regression was caused only by 4cde92303f).
Getting mesh_src through MOD_deform_mesh_eval_get instead of ctx->object->data should already solve that other problem.

It would only improve the comments, (both new and existing).

The patch looks ok, (if the regression was caused only by 4cde92303f). Getting `mesh_src` through `MOD_deform_mesh_eval_get` instead of `ctx->object->data` should already solve that other problem. It would only improve the comments, (both new and existing).

This issue was referenced by 5977ed3470

This issue was referenced by 5977ed34709ce56823ef755d9c702b8cebba1edd
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Philipp Oeser self-assigned this 2020-01-15 10:01:13 +01:00
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
4 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#68489
No description provided.