custom property values not setting correctly via code #73879
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#73879
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: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Quadro K4000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 353.62
Blender Version
Broken: version: 2.82 (sub 7), branch: master, commit date: 2020-02-12 16:20, hash:
blender/blender@77d23b0bd7
Worked: (optional)
Short description of error
When I create a custom property via Python, the min and max setting values seem to get applied, but have no effect. For instance, in the image below you can see how a custom property has been created with min-max values of 0-100...
yet I can click and drag the property in the 3D Viewport to a value outside of the set limits.
Also, I'm setting use_soft_limits to True in my code, but they appear disabled in the properties panel:
Exact steps for others to reproduce the error
To reproduce the issue, run the code below which will create an Empty object with a custom property (custom_prop). Then test click-dragging the custom propery value outside of the limits set by the code. Also, note how soft limits are disabled, despite being supposedly enabled by the code.
Added subscriber: @JorgeV-2
I've just realised that the soft limit values are what determine the custom property limits in when click-dragging in the 3D Viewport. However, the issue still stands in that enabling soft limits via Python doesn't seem to work. So you will still be able to overshoot (or undershoot) limit values, evne if you've specified you want soft limits in the code.
Added subscriber: @ideasman42
Changed status from 'Needs Triage' to: 'Resolved'
This is dealing with internals which don't have an publicly exposed Python API.
The problem is caused by an int/float type mismatch.
Changed status from 'Resolved' to: 'Archived'
You are right. The issue was being caused by the line:
Setting it that way made the variable type an integer, and I hadn't realised that. The issue has been fixed now by changing the code to:
Amazing what a difference a decimal point and a zero to the right can make.
Thank you!
Added subscriber: @Astronet-4
This problem still persists actually in 2.93. even if the property is a float or an int it still overshoots the min and max value
In my case when I manually edit the property, even without changing anything once I click "ok" then everything works fine again. but creating the property via script always has this issue