How to ungroup a shader node group

Within an operator that is run by clicking a button in the properties panel, how can I ungroup a shader node group within a given material?

I have tried literally everything. bpy.ops.node.group_ungroup is always context incorrect, even if I change the area ui_type first.

Driving me insane. Any help?

nvm, I misunderstood post maybe someone with coding experience can help!

Summary

are you sure there are no conflicts with shortcuts?
I used to have plenty of problems similar to this when upgrading through blender versions and importing older user settings

see if it works with default blender file
if it does, then you should consider starting a fresh config/keymap setup from scratch

1 Like

@Alumx Thanks for trying. I’ve posted this here before, but it’s just tumbleweeds every time.

I guess this is not possible.

-give https://blender.stackexchange.com/ a try, there are some smart fellas helping out if you’re lucky

-otherwise OpenVFX: The Blender Hub (discord), i got some python help there one time, altho the server grew a ton since that happened so you should be persistent and maybe @ directly someone who might help

-and lastly there’s Blender.chat , a lot of blender devs hang out there so you might get some help if they answer back (I never tried it much, its a bit over my expertise lol, but i lurk sometimes to see what’s going on)

ps: I’d recommend looking through some currently active addon developer (for example here) and maybe directing your question to them via any social media dm you happen to find

good luck! sorry I can’t help but if you persist you’ll find answers for sure :+1:

Well, I am slightly further along with this problem.

I’ve figured out how to call bpy.ops.node.group_ungroup() without the context incorrect problem.

The issue I have now is that I want to change the active material slot on an object while the script is running so that the correct material’s nodes are actually shown in the node editor.

I can make this change, but it doesn’t take effect until the script is stopped, so that’s no use to me.

Currently looking for a way to pause the script to allow Blender to update, and then resume it. Might end up being some overly complicated arrangement using timers.