Custom property tooltip adds extra period character at end of the property description #93144

Closed
opened 2021-11-16 20:13:56 +01:00 by Ryan Guy · 4 comments

System Information
Operating system: Windows 10
Graphics card: EVGA GTX 1070 8GB

Blender Version
Broken: 3.0 Alpha, 7b530c6096, 2021-11-09
Worked: 2.79

Short description of error

After defining a custom property with a description string, the displayed property tooltip adds an extra period character (.) to the end of the description text.

For example: if the defined description is Hello!, the tooltip will display Hello!. with the extra character.

Example script:

bl_info = {

"name": "Test Addon",

}

import bpy

class TEST_ADDON_PT_Panel(bpy.types.Panel):

bl_label = "Test Addon Panel"
bl_category = "Test Addon Panel"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'


def draw(self, context):
self.layout.prop(context.scene, "test_property")


def register():

bpy.utils.register_class(TEST_ADDON_PT_Panel)
bpy.types.Scene.test_property = bpy.props.BoolProperty(description="Hello!")


def unregister():

bpy.utils.unregister_class(TEST_ADDON_PT_Panel)
del bpy.types.Scene.test_property



if __name__ == "__main__":

register()

Here is a screenshot of the tooltip text in Blender 3.0 Alpha:

tooltip_screenshot.jpg

Here is a screenshot in Blender 2.79:

tooltip_screenshot_279.jpg

I'm not sure if this is a bug or intended behavior. The extra character started appearing in Blender 2.80 onwards.

Exact steps for others to reproduce the error

I have attached a .blend file containing the script: example_script.blend

  1. Open .blend file
  2. Run script
  3. Display the test_property tooltip and view the description (located in viewport sidebar> Test Addon Panel)
**System Information** Operating system: Windows 10 Graphics card: EVGA GTX 1070 8GB **Blender Version** Broken: 3.0 Alpha, 7b530c609611, 2021-11-09 Worked: 2.79 **Short description of error** After defining a custom property with a description string, the displayed property tooltip adds an extra period character (.) to the end of the description text. For example: if the defined description is **Hello!**, the tooltip will display **Hello!.** with the extra character. Example script: ```python bl_info = { ``` "name": "Test Addon", ``` } import bpy class TEST_ADDON_PT_Panel(bpy.types.Panel): ``` bl_label = "Test Addon Panel" bl_category = "Test Addon Panel" bl_space_type = 'VIEW_3D' bl_region_type = 'UI' ``` ``` def draw(self, context): self.layout.prop(context.scene, "test_property") ``` def register(): ``` bpy.utils.register_class(TEST_ADDON_PT_Panel) bpy.types.Scene.test_property = bpy.props.BoolProperty(description="Hello!") ``` def unregister(): ``` bpy.utils.unregister_class(TEST_ADDON_PT_Panel) del bpy.types.Scene.test_property ``` if __name__ == "__main__": ``` register() ``` ``` Here is a screenshot of the tooltip text in Blender 3.0 Alpha: ![tooltip_screenshot.jpg](https://archive.blender.org/developer/F11816098/tooltip_screenshot.jpg) Here is a screenshot in Blender 2.79: ![tooltip_screenshot_279.jpg](https://archive.blender.org/developer/F11816103/tooltip_screenshot_279.jpg) I'm not sure if this is a bug or intended behavior. The extra character started appearing in Blender 2.80 onwards. **Exact steps for others to reproduce the error** I have attached a .blend file containing the script: [example_script.blend](https://archive.blender.org/developer/F11816111/example_script.blend) 1. Open .blend file 2. Run script 3. Display the _test_property_ tooltip and view the description (located in viewport sidebar> Test Addon Panel)
Author

Added subscriber: @rlguy

Added subscriber: @rlguy
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Member

Thanks for the report. This is expected on code side. See the else part of the code. Period has been added there intentionally

  field->text = BLI_sprintfN("%s:  ", but_tip.strinfo);
  field->text_suffix = BLI_strdup(enum_label.strinfo);
}
else {
  field->text = BLI_sprintfN("%s.", but_tip.strinfo);
}```

Will close the task as this looks expected but feel free to comment if it's misunderstanding from my side
(also for actual source, see: https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_region_tooltip.c$827)
Thanks for the report. This is expected on code side. See the `else` part of the code. Period has been added there intentionally ```if (enum_label.strinfo) { ``` field->text = BLI_sprintfN("%s: ", but_tip.strinfo); field->text_suffix = BLI_strdup(enum_label.strinfo); } else { field->text = BLI_sprintfN("%s.", but_tip.strinfo); }``` ``` Will close the task as this looks expected but feel free to comment if it's misunderstanding from my side (also for actual source, see: https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_region_tooltip.c$827)
Sign in to join this conversation.
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
2 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#93144
No description provided.