Some property subtypes not working (no unit suffix), precision=0 not supported #34875

Closed
opened 2013-04-05 01:26:49 +02:00 by CodeManX · 7 comments
Member

%%%--- Operating System, Graphics card ---
Windows 7

- Blender version with error, and version that worked ---

Blender 2.66.5

- Short description of error ---

Property subtypes like 'ANGLE' don't seem to work, a FloatProp shows as 10.00 instead of 10.00° (missing degrees-symbol)

'FACTOR' and 'PERCENTAGE' do add a suffix, °-symbol works for FloatVectorProp 'TRANSLATION' for instance

precision=0 for a FloatProp acts like if precision=2, this kind of restriction isn't necessary IMO

- Steps for others to reproduce the error (preferably based on attached .blend file) ---

Script attached, paste and run, Viewport > Spacebar menu > Simple Operator --> see Tools panel (Redo)%%%

%%%--- Operating System, Graphics card --- Windows 7 - Blender version with error, and version that worked --- Blender 2.66.5 - Short description of error --- Property subtypes like 'ANGLE' don't seem to work, a FloatProp shows as 10.00 instead of 10.00° (missing degrees-symbol) 'FACTOR' and 'PERCENTAGE' do add a suffix, °-symbol works for FloatVectorProp 'TRANSLATION' for instance precision=0 for a FloatProp acts like if precision=2, this kind of restriction isn't necessary IMO - Steps for others to reproduce the error (preferably based on attached .blend file) --- Script attached, paste and run, Viewport > Spacebar menu > Simple Operator --> see Tools panel (Redo)%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

%%%The float property seems to show the ° symbol ok here with the attached script, using 2.66.5 revision 55793. There is no ° symbol for integer properties but that's expected I think. The angle subtype assumes the values to be stored in radians and displayed in degrees, and so storing radians as integers is useless.

I'm also not seeing any ° symbol with TRANSLATION, which I also wouldn't expect there? Probably I'm misunderstanding something?

Precision 0 means fallback to some default precision value, which is 2 in this case. That doesn't seem to be documented but it was intentionally implemented this way a long time ago, perhaps for the python API this could be changed.%%%

%%%The float property seems to show the ° symbol ok here with the attached script, using 2.66.5 revision 55793. There is no ° symbol for integer properties but that's expected I think. The angle subtype assumes the values to be stored in radians and displayed in degrees, and so storing radians as integers is useless. I'm also not seeing any ° symbol with TRANSLATION, which I also wouldn't expect there? Probably I'm misunderstanding something? Precision 0 means fallback to some default precision value, which is 2 in this case. That doesn't seem to be documented but it was intentionally implemented this way a long time ago, perhaps for the python API this could be changed.%%%
Author
Member

%%%I see, then 'ANGLE' for IntProps isn't that useful - but why does it accept this subtype then? Shouldn't silently fail!

FloatProp shows ° correctly, that's right, i added it to the script to show that precision=0 doesn't work

Since IntProps can't use subtype='ANGLE', it would be useful to allow precision=0, and precision=-1 should let it fall back to default of 2

TRANSLATION doesn't show °, that's right and intended, my fault! It adds prefixes just fine ("X: ..."), the one with ° was e.g. 'EULER'%%%

%%%I see, then 'ANGLE' for IntProps isn't that useful - but why does it accept this subtype then? Shouldn't silently fail! FloatProp shows ° correctly, that's right, i added it to the script to show that precision=0 doesn't work Since IntProps can't use subtype='ANGLE', it would be useful to allow precision=0, and precision=-1 should let it fall back to default of 2 TRANSLATION doesn't show °, that's right and intended, my fault! It adds prefixes just fine ("X: ..."), the one with ° was e.g. 'EULER'%%%
Member

%%%I think this is an edge case - using the api in a way we didn't predict or support. Leave it to brecht give final answer and/or close though.%%%

%%%I think this is an edge case - using the api in a way we didn't predict or support. Leave it to brecht give final answer and/or close though.%%%

%%%I've made precision=0 work now as you might expect. I'm not going to fix the subtype thing, it's just metadata that the interface may or may not use and I'd rather not have script errors or prints for that kind of thing.%%%

%%%I've made precision=0 work now as you might expect. I'm not going to fix the subtype thing, it's just metadata that the interface may or may not use and I'd rather not have script errors or prints for that kind of thing.%%%

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Author
Member

%%%Thanks Brecht for fixing! :)%%%

%%%Thanks Brecht for fixing! :)%%%
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 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-addons#34875
No description provided.