9
$\begingroup$

I'm using a script to show the User Preferences dialog:

bpy.ops.screen.userpref_show('INVOKE_DEFAULT')

But it shows the preferences "input" tab, and I want it to show the "Ad-ons" tab. I tried using this:

bpy.types.UserPreferences.active_section

It didn't work. How can I do that?

$\endgroup$
2
  • $\begingroup$ Could you please provide more details how you actually open the preference window? $\endgroup$ Aug 22, 2021 at 10:21
  • $\begingroup$ Ok I found the command bpy.ops.screen.userpref_show() $\endgroup$ Aug 22, 2021 at 10:26

2 Answers 2

8
$\begingroup$

You'd want to use

bpy.context.preferences.active_section = 'ADDONS'
$\endgroup$
0
2
$\begingroup$

I don't know if this is the correct way to do it, but I can tell you that it works.. Just put the name of your addon, as if you were using the search engine

bpy.ops.screen.userpref_show()
bpy.context.preferences.active_section = 'ADDONS'
bpy.data.window_managers["WinMan"].addon_search = "node wrangler"
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.