I believe It’s intentional behaviour from the Hydra 2 / Scene Index refactor, not a bug.
When an input has a connection, USD’s GetValueProducingAttributes() traces through to the upstream output and that’s what gets stored in inputConnections, not the default parameters. The authored fallback value (0.2 in your case) just isn’t surfaced anywhere in the Scene Index representation. So your Scene Index approach fails for exactly the same reason as the old HdMaterialNode::parameters path.
edit: Removed the rest of my comment. The advice was based on a custom addition that doesn’t apply here.
I just realized the reason I have a stage ptr is because we modified our usd to access it for other reasons, so apologies. I should have checked out our vanilla branch (I’ll edit my last post).
Edit: ignore the following text because I mistakenly forgot we were talking about the authored fallback and not the unauthored fallback value.
are you able to access the SDR/NDR (depending on your USD version since the latter was folded into the former) independently of Hydra? Since you have the shader ID, you can look up its known parameters from there and I believe that should get you the fallback value as well. Essentially treating it as a lookup.
Ah yeah sorry I mis recalled your original question (should have woken up more…the dog woke me up really early) and thought we were talking about the unauthored fallback value not the authored one
Yeah, unfortunately I don’t have a good solution to find the fallback to the connection.
I don’t know how to achieve what you want in Houdini unfortunately in that case. In our custom USD build, I had to do what I mentioned in my original response where I passed in the stage as part of the driver params to Hydra. We couldn’t find a solution without modifying USD directly to surface what we needed. We’re also stuck in a weird Hydra 1/2 hybrid state and maybe it would be easier with a custom scene index filter if we were purely Hydra 2.
Our use case was slightly different in that I needed to lookup a sibling prim but in effect it turns out the same that we both needed to traverse something outside the Hydra view of the world.
Of course you can’t modify Houdini’s usd build to do that (well not easily anyway).
I think the best bet is to either talk to SideFX to see if they can give Hydra users a stage pointer or passing through the fallbacks and they in turn could work with Pixar to standardize that mechanism. Or if Houdini is purely Hydra 2 now you might be able to do it with a scene index filter but I’m not super confident about overriding it.