ToolSelectPanelHelper._tool_get_active() in scripts/startup/bl_ui/space_toolsystem_common.py is broken #72363

Closed
opened 2019-12-11 20:34:33 +01:00 by MACHIN3 · 9 comments

System Information
Operating system: Linux-4.13.10-041310-generic-x86_64-with-debian-stretch-sid 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.67

Blender Version
Broken: version: 2.82 (sub 4), branch: master, commit date: 2019-12-10 23:56, hash: blender/blender@63d521432e
Worked: 2.81

Short description of error
Calling _tool_get_active() will throw the following error:

File "/opt/blender 2.82/2.82/scripts/startup/bl_ui/space_toolsystem_common.py", line 272, in _tool_get_active
    for item in ToolSelectPanelHelper._tools_flatten(cls.tools_from_context(context, mode)):
AttributeError: type object 'ToolSelectPanelHelper' has no attribute 'tools_from_context'
**System Information** Operating system: Linux-4.13.10-041310-generic-x86_64-with-debian-stretch-sid 64 Bits Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.67 **Blender Version** Broken: version: 2.82 (sub 4), branch: master, commit date: 2019-12-10 23:56, hash: `blender/blender@63d521432e` Worked: 2.81 **Short description of error** Calling `_tool_get_active()` will throw the following error: ``` File "/opt/blender 2.82/2.82/scripts/startup/bl_ui/space_toolsystem_common.py", line 272, in _tool_get_active for item in ToolSelectPanelHelper._tools_flatten(cls.tools_from_context(context, mode)): AttributeError: type object 'ToolSelectPanelHelper' has no attribute 'tools_from_context' ```
Author

Added subscriber: @MACHIN3

Added subscriber: @MACHIN3
Author

ToolSelectPanelHelper.blend

  • open the blend file
  • go to the scripting workspace, if it isn't open already
  • run the script
[ToolSelectPanelHelper.blend](https://archive.blender.org/developer/F8216232/ToolSelectPanelHelper.blend) * open the blend file * go to the scripting workspace, if it isn't open already * run the script

Added subscriber: @Pinnhead

Added subscriber: @Pinnhead

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.66

the same in blender-2.82-b03066f7ee07-windows64

  File "F:\---[_download_]---\ToolSelectPanelHelper.blend\Text", line 4, in <module>
  File "H:\Blender\Blender2.82\2.82\scripts\startup\bl_ui\space_toolsystem_common.py", line 272, in _tool_get_active
    for item in ToolSelectPanelHelper._tools_flatten(cls.tools_from_context(context, mode)):
AttributeError: type object 'ToolSelectPanelHelper' has no attribute 'tools_from_context'
**System Information** Operating system: Windows-10-10.0.18362-SP0 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.66 the same in blender-2.82-b03066f7ee07-windows64 ``` File "F:\---[_download_]---\ToolSelectPanelHelper.blend\Text", line 4, in <module> File "H:\Blender\Blender2.82\2.82\scripts\startup\bl_ui\space_toolsystem_common.py", line 272, in _tool_get_active for item in ToolSelectPanelHelper._tools_flatten(cls.tools_from_context(context, mode)): AttributeError: type object 'ToolSelectPanelHelper' has no attribute 'tools_from_context' ```

Added subscribers: @ideasman42, @mano-wii

Added subscribers: @ideasman42, @mano-wii

@ideasman42, if I'm not mistaken, you worked on this code recently.

@ideasman42, if I'm not mistaken, you worked on this code recently.
Author

I was told ToolSelectPanelHelper is outdated and were are supposed to use the following now:

from bl_ui.space_toolsystem_toolbar import VIEW3D_PT_tools_active as view3d_tools
active_tool = view3d_tools.tool_active_from_context(context)

It's working fine for me, so I'm happy to close this now.

I was told `ToolSelectPanelHelper` is outdated and were are supposed to use the following now: ``` from bl_ui.space_toolsystem_toolbar import VIEW3D_PT_tools_active as view3d_tools active_tool = view3d_tools.tool_active_from_context(context) ``` It's working fine for me, so I'm happy to close this now.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Campbell Barton self-assigned this 2019-12-17 08:04:52 +01:00

ToolSelectPanelHelper is not outdated, the method your calling is private and not intended to be called as part of the public API. See: https://stackoverflow.com/a/2064212/432509

closing.

`ToolSelectPanelHelper` is not outdated, the method your calling is private and not intended to be called as part of the public API. See: https://stackoverflow.com/a/2064212/432509 closing.
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#72363
No description provided.