RNA: unify and improve RNA property flag descriptions #118036

Manually merged
Sybren A. Stüvel merged 4 commits from dr.sybren/blender:pr/rna-enum-property-flag-descriptions into main 2024-02-13 11:15:14 +01:00

This PR consists of two commits, and I intend to land them as separate commits:

  1. Ensure the flag descriptions are used for both non-enum and enum properties. Before only the former were updated, but the latter still had empty descriptions.
  2. Write new descriptions for HIDDEN, SKIP_SAVE, and LIB_EXCEPTION flags.

Most of these I already wrote before 0d7282e69b landed. I adjusted the text to account for that commit as well.

Personally I don't think "Do not use ghost values" was particularly helpful, as the concept of "ghost values" isn't actually that well known (compared to generally how many people use bpy). Granted, it's described at bpy_struct, but IMO if the term "ghost values" is to be kept here, it should include a link to that page.

I've also changed Inherits 'SKIP_PRESET' to a description of what actually happens, so that each flag can be read by itself.

This PR consists of two commits, and I intend to land them as separate commits: 1. Ensure the flag descriptions are used for both non-enum and enum properties. Before only the former were updated, but the latter still had empty descriptions. 2. Write new descriptions for `HIDDEN`, `SKIP_SAVE`, and `LIB_EXCEPTION` flags. Most of these I already wrote before 0d7282e69b35d1cc7c67629ecddbd397b85ea727 landed. I adjusted the text to account for that commit as well. Personally I don't think "Do not use ghost values" was particularly helpful, as the concept of "ghost values" isn't actually that well known (compared to generally how many people use `bpy`). Granted, it's described at [bpy_struct](https://docs.blender.org/api/current/bpy.types.bpy_struct.html), but IMO if the term "ghost values" is to be kept here, it should include a link to that page. I've also changed `Inherits 'SKIP_PRESET'` to a description of what actually happens, so that each flag can be read by itself.
Sybren A. Stüvel added 2 commits 2024-02-09 13:02:26 +01:00
8a51c3ef7a RNA: unify property flag descriptions between enum and non-enum flags
These flags (like `'HIDDEN', 'SKIP_SAVE', etc.) mean the same thing when
used on enums and non-enum properties. Now they actually use the same
description definition in the source code, ensuring that any
improvements will apply to both.

No changes to the actual messages. Just using them for both enums and
non-enum property flags.
d079474f1e RNA: update property flag descriptions
Add new descriptions to the `PROP_HIDDEN`, `PROP_SKIP_SAVE`, and
`PROP_LIB_EXCEPTION` flags. For the former two, these are more
explanatory than the previous descriptions. For the latter it's the
first ever description.

Most of these I already wrote before
0d7282e69b landed. I adjusted the text to
account for that commit as well.

Personally I don't think "Do not use ghost values" was particularly
helpful, as the concept of "ghost values" isn't actually that well known
(compared to generally how many people use `bpy`). Granted, it's
described at [1], but IMO if the term "ghost values" is to be kept here,
it should include a link to that page.

[1]: https://docs.blender.org/api/current/bpy.types.bpy_struct.html
Sybren A. Stüvel requested review from Brecht Van Lommel 2024-02-09 13:07:36 +01:00
Steff Kempink reviewed 2024-02-09 13:31:24 +01:00
@ -156,0 +156,4 @@
/* Descriptions for rna_enum_property_flag_items and rna_enum_property_flag_enum_items. */
constexpr auto PROP_HIDDEN_DESCR =
"For operators: exclude from the 'Redo' panel. The property will still be visible when "
"explicitly drawn in UI code. Also this property is not written to presents";
First-time contributor

presents->presets? (also happened below in SKIP_SAVE_DESCR)

presents->presets? (also happened below in SKIP_SAVE_DESCR)
Author
Member

It's my dad's b'day, can you tell? :)

It's my dad's b'day, can you tell? :)
dr.sybren marked this conversation as resolved
Brecht Van Lommel requested changes 2024-02-09 13:52:42 +01:00
@ -154,2 +154,4 @@
};
/* Descriptions for rna_enum_property_flag_items and rna_enum_property_flag_enum_items. */
constexpr auto PROP_HIDDEN_DESCR =

constexpr -> static constepxr, this should not be in the global namespace.

Also not sure about the use of auto here, seems like deviating from existing conventions.

`constexpr` -> `static constepxr`, this should not be in the global namespace. Also not sure about the use of `auto` here, seems like deviating from existing conventions.
Author
Member

I'll add the static. I tried to remove auto, but then the full declaration would be static constexpr const char *.

Without the const in there, I get this compiler warning:

warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings]

I think the auto is preferrable here, as it's also not such complex code that it becomes hard to understand what the type is.

I'll add the `static`. I tried to remove `auto`, but then the full declaration would be `static constexpr const char *`. Without the `const` in there, I get this compiler warning: ``` warning: ISO C++11 does not allow conversion from string literal to 'char *const' [-Wwritable-strings] ``` I think the `auto` is preferrable here, as it's also not such complex code that it becomes hard to understand what the type is.
dr.sybren marked this conversation as resolved
@ -155,1 +155,4 @@
/* Descriptions for rna_enum_property_flag_items and rna_enum_property_flag_enum_items. */
constexpr auto PROP_HIDDEN_DESCR =
"For operators: exclude from the 'Redo' panel. The property will still be visible when "

Do not use quotes around 'Redo' (guideline for referring to Blender terms in general). Also I think we don't call it the Redo panel in the UI, and this affects also panels should in properties dialogs.

Do not use quotes around 'Redo' (guideline for referring to Blender terms in general). Also I think we don't call it the Redo panel in the UI, and this affects also panels should in properties dialogs.

Maybe better would be to say something like, "hide from the user interface (unless manually used in the operator draw callback)`

Maybe better would be to say something like, "hide from the user interface (unless manually used in the operator draw callback)`
Author
Member

You're right, in the user manual it's called the Adjust Last Operation region. Not sure how many people would refer this as a "region" though, but that's a discussion for another time.

hide from the user interface (unless manually used in the operator draw callback)

The fact that it's hidden is quite clear from the flag's name. I wanted to have some information in there about where it would be shown if this flag isn't used. You're right in that the redo panel isn't the only place, and that it can pop up in other areas as well. I'll go for a combo, like "hide from places in the user interface where Blender would add the property automatically, like Adjust Last Operation". This hints that the flag is ineffective when you explicitly draw the property, and I think it's clear enough without going into too many details.

You're right, in the user manual it's called the [Adjust Last Operation region](https://docs.blender.org/manual/en/latest/interface/operators.html#operator-properties). Not sure how many people would refer this as a "region" though, but that's a discussion for another time. > hide from the user interface (unless manually used in the operator draw callback) The fact that it's hidden is quite clear from the flag's name. I wanted to have some information in there about where it *would* be shown if this flag isn't used. You're right in that the redo panel isn't the only place, and that it can pop up in other areas as well. I'll go for a combo, like "hide from places in the user interface where Blender would add the property automatically, like Adjust Last Operation". This hints that the flag is ineffective when you explicitly draw the property, and I think it's clear enough without going into too many details.
dr.sybren marked this conversation as resolved
@ -156,0 +158,4 @@
"For operators: exclude from the 'Redo' panel. The property will still be visible when "
"explicitly drawn in UI code. Also this property is not written to presents";
constexpr auto PROP_SKIP_SAVE_DESCR =
"For operators: the value of this property will not be remembered between invocations to the "

invocations to the -> invocations of the

invocations to the -> invocations of the
dr.sybren marked this conversation as resolved
Sybren A. Stüvel requested review from Brecht Van Lommel 2024-02-09 14:47:01 +01:00
Sybren A. Stüvel added 2 commits 2024-02-09 14:47:04 +01:00
Brecht Van Lommel approved these changes 2024-02-09 15:13:18 +01:00
Sybren A. Stüvel manually merged commit ff4a473ad4 into main 2024-02-13 11:15:14 +01:00
Sybren A. Stüvel deleted branch pr/rna-enum-property-flag-descriptions 2024-02-13 11:15:39 +01:00
Sign in to join this conversation.
No reviewers
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
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#118036
No description provided.