Fix #83322: Scale factor issue #105397
No reviewers
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#105397
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "linux_dr/blender-addons:losborn_issue83322_fix"
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?
Fix for issue #83322:
units are now officially 1m)
GLOBAL_SCALE
constant, but assumedinputs would always be in millimeters.
the input field units needed to be converted to Blender units first.
Fixed scale factor issue #83322to Fix #83322: Scale factor issue@nickberckley suggested that this should be considered for #LTS36
(@brecht, ChatGPT seems to think that you’re Primary Person Responsible for 3.6 LTS maintenance, so I’m tagging you in this issue.)
@lichtwerk is actually responsible for LTS maintenance. I guess he can decide if it's worth backporting, or get advice from another dev.
Think it would be fine to backport this.
Would be good to mention that this also fixes #84782 ?
Will double check to procedure for the cases where we have a fix in the extension:
main
, be committed and then also go intoblender-v3.6-release
ORblender-v3.6-release
directly?Would assume the former would be the way to go @ThomasDinges ?
If so, this PR could be merged as is.
If the later is preferred, then this PR needs to target the
blender-v3.6-release
branch, check https://developer.blender.org/docs/handbook/contributing/pull_requests/#rebasing-a-pull-request on how to do thisIn any case, it should be added to #109399
Fixes should always target
main
and then be backported to the LTS branch unless the fix is exclusively for the LTS branch.The preset values that are stored in the folder /addons/presets/operator/mesh.bolt_add
are inputting values into the dialog box using mm rather than m. This means that the change presented here breaks the shipped presets.
All the distance values in the "m*.py" preset files need dividing by 1000.
Here are a couple of screen shots.
Initially looks OK:
Loading the m6 Operator Preset:
My edit of the preset file putting "/1000" on the end of most lines:
For reference the original output of the M6 preset as shipped with 4.1:
@ -28,3 +28,3 @@
MAX_INPUT_NUMBER = 50
MAX_INPUT_NUMBER = 50 # mm
There was a ticket or comment saying that 50mm was too small for the maximal bolt size. The user wanted to make a bolt that was 2 inches which needed 50.8mm
If the scaling is now correctly working I don't see a need to have a limit in here. Practically 250 would be a better limit as that would cover anything that I have seen in agriculture.
Looking at the drivel on Wikipedia I got a bit bored and resorted to ChatGPT which said that specialty bolts can often exceed 4 inches (101.6mm)… which makes me think 250mm is probably overkill, but definitely sufficient, so I’ll make it 250mm
https://www.globalfastener.com/standards/detail_4902.html
That shows a good range.
I hope that people who are in industry are using qualified models rather than open source representations!
Besides even with the limit is is possible to work round it by creating the single item, in a different project, at a reduced scale then importing.
This is a great reference, and I may actually use it in further enhancements I began working on.
I do think we should definitely support up to M160 or 160 mm, but I am hesitant to make this a hard limit until we see a similar reference for "standard"/imperial sizes.... until then we can leave it as the slightly ridiculous 250mm. Do you have a similar reference for imperial?
This page covers imperial: https://www.globalfastener.com/standards/detail.php?sid=MjI4NTQ=
The "asme-b18.2.2" covers standard sizes, the 4 inch heavy nuts are 6 1/8 across flats. A 4 inch connecting nut is 9 1/8.
9.125 inch = 231mm, so 250mm is still a reasonable top end for the input box.
There are copies of this paid for standard accidentally published online which google has found.
@ -2398,2 +2396,2 @@
props.bf_Cap_Head_Dia * (1.0 / 19.0),
props.bf_Cap_Head_Dia * (1.0 / 19.0),
Bit_Dia, props.bf_Cap_Head_Dia/GLOBAL_SCALE,
props.bf_Shank_Dia, props.bf_Cap_Head_Height/GLOBAL_SCALE,
The Shank_Dia has been missed for the GLOBAL_SCALE division.
I searched for all
props
that already had division byGLOBAL_SCALE
somewhere in the file with the following regex:and found a second
bf_Shank_Dia
not divided byGLOBAL_SCALE
at line 2419.I verified no similar properties with this regex:
I will fix these two instances of
bf_Shank_Dia
not divided byGLOBAL_SCALE
.@lichtwerk, yes, I saw #84782, agreed it would be included in fix-set, but somehow let it fall on the floor. My mistake. Good catch.
Been a busy week here, possibly won’t get to review this for 48 hrs at soonest.
250mm sounds like it may be a bit small for mining and bridges… I will consult Wikipedia.
I will also review the issue around line 2396-2397 and make sure the PR is rebased to the correct branch.
Thank you for the feedback.
(I will also push any fixes to a new PR on the new repo)
I'm happy to take the time to review changes here before they get onto the mainline.
Also I'm happy to play around and test 4.3 for the preset functionality in the new world of extensions.
I have yet to review this part yet, but (aside from the screenshot) it sounds like a good catch. (Can someone put more hours in a day please?)
@ -288,42 +288,42 @@ class add_mesh_bolt(Operator, AddObjectHelper):
)
bf_Hex_Nut_Height: FloatProperty(
attr='bf_Hex_Nut_Height',
name='Hex Nut Height', default=2.4000000953674316,
(Actually commenting on 268-281)
According to the info here on Wikipedia illustrated here, https://en.wikipedia.org/wiki/Unified_Thread_Standard#/media/File:ISO_and_UTS_Thread_Dimensions.svg , The default
bf_Crest_Percent
should be 12.5% andbf_Root_Percent
should be 25% necessitating these be changed toFloatProperty
s...I had originally planned to make this part of a later PR, but I could include it here.
I would hope that 0.5% is within the tolerance of the threading.
A bigger issue is the thread angle, the modelling today uses two diameters and two percentages for building the thread.
For both standard UN and metric the thread angle is 60 degrees, but there are other thread types of BA (47.5 deg), Whitworth (55 deg) and ACME (29 deg). The BA even has a rounded root profile.
When making it a float then the context menu box slider buttons will increment in 0.01 steps unless the GUI properties are also updated.
The global scale has changed the behaviour of the buttons already e.g. the diameter entry steps in 1cm jumps making it un-useable. I tried editing the FloatProperty with "precision" and/or "step" but it did not seem to do the right thing.
Modifying the inputs to include an angle as one of the inputs was part of a larger change I was working on, but turned out to be more involved, so I hadn't planned on backporting that part. I understand that the minor diameter inc/dec buttons are unfortunately useless currently. I don't know what can be easily done about this.
Suggestions welcome.
Checkout
From your project repository, check out a new branch and test the changes.