Realize Instances lost Z rotation of Curve Line in certain situations #105578

Open
opened 2023-03-09 02:50:44 +01:00 by Zhen Dai · 12 comments

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.56

Blender Version
Broken: version: 3.5.0 Beta, branch: blender-v3.5-release, commit date: 2023-03-01 10:15, hash: ff89dfd6d283
Worked: N/A, 3.4.1 is also affected

Short description of error

Discovered in Blender.chat, Realize Instances doesn't appear to passthrough some type of curve rotation, for example Z rotation on a (0,0,0) to (0,0,1) curve line is lost during the process.

Exact steps for others to reproduce the error

  • Download the attached blend file
  • Observe the curve line have random rotation per instances, but didn't result in rotated meshes
  • Disable Realize Instances and observe the instanced meshes are rotated as expected.
  • Enable Realize Instances, instead put an additional (0.001) rotation to X axis with the Combine XYZ node, observe this rotation are kept after Realize Instances.
  • I believe this behaviour should be consistent across all possible rotations.
**System Information** Operating system: Windows-10-10.0.19044-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 2070 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 527.56 **Blender Version** Broken: version: 3.5.0 Beta, branch: blender-v3.5-release, commit date: 2023-03-01 10:15, hash: `ff89dfd6d283` Worked: N/A, 3.4.1 is also affected **Short description of error** Discovered in Blender.chat, Realize Instances doesn't appear to passthrough some type of curve rotation, for example Z rotation on a (0,0,0) to (0,0,1) curve line is lost during the process. **Exact steps for others to reproduce the error** - Download the attached blend file - Observe the curve line have random rotation per instances, but didn't result in rotated meshes - Disable Realize Instances and observe the instanced meshes are rotated as expected. - Enable Realize Instances, instead put an additional (0.001) rotation to X axis with the Combine XYZ node, observe this rotation are kept after Realize Instances. - I believe this behaviour should be consistent across all possible rotations.
Zhen Dai added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-03-09 02:50:45 +01:00

Hello. It's not a bug.
The instances provide their own space in which the curves can rotate as they please. But if you realize curves, their normals will be calculated with these rotations.
Apparently not the way you want.

Hello. It's not a bug. The instances provide their own space in which the curves can rotate as they please. But if you realize curves, their normals will be calculated with these rotations. Apparently not the way you want.
Iliya Katushenock added the
Interest
Geometry Nodes
label 2023-03-09 05:12:53 +01:00
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-03-09 05:15:11 +01:00

But if you realize curves, their normals will be calculated with these rotations.

But if you substitute the straight-line curve with a bended one, the rotation will be kept after realization.

So, for straight-line curves even the normal has been rotated and can't be told by eye, but the realization just throws the rotation.

Is it a bug/feature for just straight-line curve instances?

> But if you realize curves, their normals will be calculated with these rotations. But if you substitute the straight-line curve with a bended one, the rotation will be kept after realization. So, for straight-line curves even the normal has been rotated and can't be told by eye, but the realization just throws the rotation. Is it a bug/feature for just straight-line curve instances?

Hello. It's not a bug.
The instances provide their own space in which the curves can rotate as they please. But if you realize curves, their normals will be calculated with these rotations.

The problem is, that for a straight line the normals are not calculated using the instance rotation. That's exactly what this bugreport is about. It's not the curves that are rotated, it's the instances.

If you very very slightly tweak one endpoint of the instantiated curve so that it's not perfectly vertical, then suddenly the instance rotation is kept on realize.

> Hello. It's not a bug. > The instances provide their own space in which the curves can rotate as they please. But if you realize curves, their normals will be calculated with these rotations. The problem is, that for a straight line the normals are *not* calculated using the instance rotation. That's exactly what this bugreport is about. It's not the curves that are rotated, it's the instances. If you very very slightly tweak one endpoint of the instantiated curve so that it's not perfectly vertical, then suddenly the instance rotation *is* kept on realize.
Blender Bot added
Status
Needs Triage
and removed
Status
Archived
labels 2023-03-09 13:25:10 +01:00

Not sure how to fix this if it's a bug. The curve does not have a full transform attribute to store the rotation. Because of which, it's more of a feature request rather than a bug (mechanism of influencing the rotation attribute (I didn't go into the math of this, so it's just a superficial estimate that it would be difficult)).

Not sure how to fix this if it's a bug. The curve does not have a full transform attribute to store the rotation. Because of which, it's more of a feature request rather than a bug (mechanism of influencing the rotation attribute (I didn't go into the math of this, so it's just a superficial estimate that it would be difficult)).
Iliya Katushenock added
Status
Confirmed
Module
Nodes & Physics
and removed
Status
Needs Triage
labels 2023-03-09 15:39:04 +01:00

The curve does not have a full transform attribute to store the rotation.

Then how is it possible that everything works as expected with any curve which is not a perfectly vertical line?

It's definitely not a feature request. Because this just behaves weird. Try it. Change one of the endpoints of the instantiated curve and suddenly the instance rotation is preserved.

I'd think the 'instance rotation' is stored at the instance level, not at the cure level. The curve itself doesn't have any rotation/twist.

> The curve does not have a full transform attribute to store the rotation. Then how is it possible that everything works as expected with any curve which is not a perfectly vertical line? It's definitely not a feature request. Because this just behaves weird. Try it. Change one of the endpoints of the instantiated curve and suddenly the instance rotation is preserved. I'd think the 'instance rotation' is stored at the instance level, not at the cure level. The curve itself doesn't have any rotation/twist.

@Baardaap Yes, I saw. It is necessary to check the first point of the curve, if it belongs to a vertical segment, to refine the rotation matrix on it in order to get the curve Z angle. After that, depending on the type of curve normal, set a curve angle attribute.
There is a dependence on the type of normal of the curve. Also, the value of the attribute changes. Still seems very unreliable...

@Baardaap Yes, I saw. It is necessary to check the first point of the curve, if it belongs to a vertical segment, to refine the rotation matrix on it in order to get the curve Z angle. After that, depending on the type of curve normal, set a curve angle attribute. There is a dependence on the type of normal of the curve. Also, the value of the attribute changes. Still seems very unreliable...
Author

blender_DgWQ6jGiJD.gif

I have used GN for over 1 year now and I don't think I have ever realized this limitation: transform a curve line on Y axis over 90 degree gives you this. No instances involved, looks like curve line doesn't know its normal to begin with, it's reconstructed by guess work.

![blender_DgWQ6jGiJD.gif](/attachments/b917c959-33df-44b3-84b6-0c35086d507c) I have used GN for over 1 year now and I don't think I have ever realized this limitation: transform a curve line on Y axis over 90 degree gives you this. No instances involved, looks like curve line doesn't know its normal to begin with, it's reconstructed by guess work.
Author

I think there are 2 path forward:

  • change the actual behaviour of curve line normal when transforming (we can introduce a new node for curve rotation that sets tilt automatically)

  • document this more thoroughly and tell users to compensate for the limit by set curve tilt if they want consistent normal direction over y-axis rotation.

I think there are 2 path forward: - change the actual behaviour of curve line normal when transforming (we can introduce a new node for curve rotation that sets tilt automatically) - document this more thoroughly and tell users to compensate for the limit by set curve tilt if they want consistent normal direction over y-axis rotation.

@Zhen-Dai This is part of the topic of the report, but still do not go too far from us)

@Zhen-Dai This is part of the topic of the report, but still do not go too far from us)

-tell users to compensate for the limit by set curve tilt if they want consistent normal direction over y-axis rotation.

I don't think this helps. Because the tilt is added to the (parametrically calculated) normal. So you'll still get jumping on exactly vertical segments.

> -tell users to compensate for the limit by set curve tilt if they want consistent normal direction over y-axis rotation. I don't think this helps. Because the tilt is added to the (parametrically calculated) normal. So you'll still get jumping on exactly vertical segments.

Based on experimentation: This is an extreme case with a fairly low chance of recurrence. It can be bypassed by capturing the correct normals beforehand and then rotating the curve to match them. But the implementation of this for all cases incurs more costs.

Based on experimentation: This is an extreme case with a fairly low chance of recurrence. It can be bypassed by capturing the correct normals beforehand and then rotating the curve to match them. But the implementation of this for all cases incurs more costs.

Yeah, I think it's best to call this a 'known limitation'. I think the best we could do is maybe document a bit better that the curve normals are procedural and not a real attribute .

Yeah, I think it's best to call this a 'known limitation'. I think the best we could do is maybe document a bit better that the curve normals are procedural and not a real attribute .
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#105578
No description provided.