Vector Math Bug. #85734
Labels
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#85734
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system:
Graphics card:
Blender Version
Broken: 2.90+
Worked: 2.83.12
Short description of error
I did a tool called "Draw Clones" for 2.7 then I updated it for 2.81 and it worked fine. But it was broken in 2.90+. Could you check it please? I guess there is something with vector math. I attached my addon, a testing blender scene, a screenshot and video.
mifth_tools.zip
tmp1.blend
tmp_vid1.mp4
You could check my file "mifth_tools_cloning.py" and a class "MFTDrawClones". And the "mft_pick_and_clone" fuction where all this happens.
Also, you could check "create_z_orient" function which I took from here https://devtalk.blender.org/t/bpy-ops-transform-rotate-option-axis/6235/9
And something is broken in Blender. I suppose this is on Blender's side.
Exact steps for others to reproduce the error
Results in 2.83 and 2.90+ are different. 2.83 is correct.
Added subscriber: @PaulGeraskin
Added subscriber: @CharlieJolly
Confirmed in 2.93 Alpha too. @PaulGeraskin Can you isolate or confirm the Python function that is not working?
@CharlieJolly Thanks for a confirmation.
I think either create_z_orient() or mft_pick_and_clone() functions do work incorrectly. But I cannot understand where exactly. Somewhere in vector math.
I guess lines 41-60 and 518-623 affect the math.
Or as another guess that raycast() function creates a incorrect normal direction (line 392 in my code) .
The file is mifth_tools_cloning.py
HI @PaulGeraskin, I'm getting a few warnings from your add-on. It looks like your script needs updating to use collections.
There were Python API changes in 2.90 relating to matrices: https://wiki.blender.org/wiki/Reference/Release_Notes/2.90/Python_API and
fa7ace2215
This may be helpful to you.
I'm not responsible for triaging bugs so this is as much as I can help.
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Needs User Info'
Hi and thx reporting!
It would be good to provide a simple example that isolates this more.
Please understand that it takes considerable time to chase this down in a complex piece of code.
Try to isolate the exact calls that behave differently in 2.83 in 2.90.
Added subscriber: @nBurn
I noticed some unusual results with Exact Edit between the 2.8x and 2.9x version of Blender that were related to this issue.
I wrote some basic code to test rotations when I was updating Exact Edit in the past.
I wrapped that code in a basic add-on for ease of use:
test_rotate_op.py
These are the results from using my test code against recent Blender releases:
Changed status from 'Needs User Info' to: 'Needs Triage'
Thx checking, @nBurn !
Will have another look then.
Hi, apologies. Had no time to optimize the code. Thank you.
@lichtwerk no problem.
I forgot to mention in my earlier post, but before you run my addon to test rotations you should be in object mode with only a "default" cube selected (a cube object at position (0, 0, 0) with no transformations done to it).
Weird, I was sure my rotation test code was throwing an AttributeError earlier when run directly from Blender 2.93's text editor. This is why I wrapped it in an addon. But I just tried it again a few minutes ago and it worked fine when run from 2.93's text editor.
Try running this code directly from the text editor first. If it doesn't work, you can use the "test_rotate_op.py" file addon as a backup option:
rotate_test_basic_280.py
I did some more testing and It seems like the "orient_matrix" argument in "bpy.ops.transform.rotate" is being ignored entirely. I ran my rotate test code twice, once with an orient_matrix argument and once without and there was no difference in the matrix_world of the transformed object.
I'm not sure what the situation is in 2.93, but when I was trying to figure out how that argument worked after it was added in 2.80 I think the relevant files were:
These were in the directory:
Added subscriber: @mano-wii
@lichtwerk I've narrowed down the commits where the my test code stopped working.
It looks like the "orient_matrix" argument for "bpy.ops.transform.rotate" worked from at least this commit (possibly earlier):
626a9aae6d
Until this commit which caused the "orient_matrix" argument to stop functioning
216ebe0b73
I made some small updates to my testing code to allow for external test data. Here is the updated code:
rotate_test_basic_280b.py
And here is the additional tests that can be run from my testing code:
rotate_unit_tests.py
It appears the most recent commits related to this area of Blender's codebase were done by @mano-wii, maybe he might be of assistance?
This issue was referenced by
0515ff70ec
Changed status from 'Needs Triage' to: 'Resolved'
Although this was closed as resolved, the behavior after
0515ff70ec
is not the same as before as there are differences in rotation with and without constraint.Thanks a lot. I'll test it with a nightly build when it gets an update.
Hi,
I have just tested the daily build and the issue still exists.
I tested this build.
I'll make a new test case this evening and write here.
@mano-wii!! Thanks for looking into this and for the tip about constraints! I didn't expect changing the "constraint_axis" argument would get my "ops.transform.rotate" code working again in 2.93. I guess I must have given up on that argument after changing it didn't fix this issue in Blender 2.92.0.
As for
0515ff70ec
, I tried a recent build with that commit applied, but it didn't appear to change the situation related needing a constraint applied for "orient_matrix".I'm fine the code as-is now that I know adding a constraint fixes the issue though.
If it helps, here's the code I used to test out your changes. It generates a sort of pseudo truth table:
rotate_test_multi_280.py
And my results:
mult_test_results.txt
@PaulGeraskin, try adding this in your arguments for "bpy.ops.transform.rotate":
constraint_axis=(False, False, True),
The result changed, without constraint the object rotates in the other direction.
I'm not sure if your problem is the same as reported however.
Hi, I looked again into my addon and I fixed the rotation issue. I had to negate angle for blender 2.91+.
All works fin now. Thanks.