object_collection_manager: replace deprecated bgl module #104547

Closed
Oxicid wants to merge 4 commits from (deleted):oxicid-cm-bgl into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

No response

_No response_
Oxicid added 3 commits 2023-04-15 15:42:30 +02:00
Oxicid requested review from Germano Cavalcante 2023-04-15 15:42:55 +02:00
Author
Contributor

In this addon bgl was used in 3 cases, in the other 4 I did not understand how and where it was used

In this addon bgl was used in 3 cases, in the other 4 I did not understand how and where it was used
Ryan Inch requested changes 2023-04-16 11:00:28 +02:00
Ryan Inch left a comment
Member

Hi, I'm the creator and maintainer of the Collection Manager add-on, so I'll be reviewing your PR :)

I'm not exactly sure what you're referring to by "No response". If you're referring to the conversation in #80730 then it turned out that bgl was not getting removed in 3.4.

I'm also not sure what you mean by the other 4. Can you clarify?

Aside from one comment I left in the code, this seems good to me, so thanks for the PR.

Hi, I'm the creator and maintainer of the Collection Manager add-on, so I'll be reviewing your PR :) I'm not exactly sure what you're referring to by "No response". If you're referring to the conversation in https://projects.blender.org/blender/blender-addons/issues/80730 then it turned out that bgl was not getting removed in 3.4. I'm also not sure what you mean by the other 4. Can you clarify? Aside from one comment I left in the code, this seems good to me, so thanks for the PR.
@ -9,2 +9,2 @@
"version": (2, 24, 4),
"blender": (2, 80, 0),
"version": (2, 24, 5),
"blender": (3, 4, 0),
Member

I like to keep this to the minimum version of Blender the add-on will work with, which from my tests just now on Linux seems to be 2.93. So unless this is different on other platforms could you please set it to 2.93?

I like to keep this to the minimum version of Blender the add-on will work with, which from my tests just now on Linux seems to be 2.93. So unless this is different on other platforms could you please set it to 2.93?
Author
Contributor

I looked more closely, everything is involved.
About the minimum version, I just do not know which version introduced new methods for gpu module, and decided to set it to 3.4 for sure. To be sure I checked with 2.93, everything works

I looked more closely, everything is involved. About the minimum version, I just do not know which version introduced new methods for gpu module, and decided to set it to 3.4 for sure. To be sure I checked with 2.93, everything works
Member

Ah, okay. Makes sense. Thanks for changing it and the additional checking.

Ah, okay. Makes sense. Thanks for changing it and the additional checking.
Imaginer marked this conversation as resolved
Oxicid added 1 commit 2023-04-16 11:09:10 +02:00
Oxicid requested review from Ryan Inch 2023-04-16 11:36:14 +02:00
Ryan Inch approved these changes 2023-04-16 11:48:43 +02:00
Ryan Inch left a comment
Member

LGTM. Thanks.

LGTM. Thanks.
Member

I'll hold off on merging this until after the weekend so @mano-wii has a chance to respond if they want.

I'll hold off on merging this until after the weekend so @mano-wii has a chance to respond if they want.
Germano Cavalcante reviewed 2023-04-17 19:38:50 +02:00
Germano Cavalcante requested changes 2023-04-17 19:39:53 +02:00
Germano Cavalcante left a comment
Member

Thanks for the patch but line_width_set doesn't work on MACOS and will surely be deprecated.

Use the 'POLYLINE_SMOOTH_COLOR' shader instead. (The 3D_ or 2D_ prefixes make no difference and were kept only for backward compatibility).

You can check examples in #80730. One that might help is the node_wrangler.py (d37c2abc6f) one.

Thanks for the patch but `line_width_set` doesn't work on MACOS and will surely be deprecated. Use the `'POLYLINE_SMOOTH_COLOR'` shader instead. (The `3D_` or `2D_` prefixes make no difference and were kept only for backward compatibility). You can check examples in #80730. One that might help is the node_wrangler.py (d37c2abc6f) one.
@ -100,3 +99,1 @@
bgl.glLineWidth(thickness)
bgl.glEnable(bgl.GL_LINE_SMOOTH)
bgl.glHint(bgl.GL_LINE_SMOOTH_HINT, bgl.GL_NICEST)
gpu.state.line_width_set(thickness)

line_width_set should no longer be used.

`line_width_set` should no longer be used.
Oxicid closed this pull request 2023-04-18 19:34:05 +02:00

Pull request closed

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#104547
No description provided.