Issue with Cycles Color_Ramp shader exported from Blender

95 views
Skip to first unread message

Aurora Films

unread,
Jan 26, 2023, 7:08:44 PM1/26/23
to gaffe...@googlegroups.com
Here is an example of a USD scene with two planes exported from Blender USD branch. Color_Ramp and Color_Curve shaders respectively assigned.

Shaders don’t come through properly. I have put a workaround using the AttributeQuery/Expression example from another thread.

The .gfr script also has the expected Network, recreated for reference.

There is also an issue where the two planes are not rendering the Gaffer assigned shaders properly, even recreating me completely in Gaffer… not sure if this is related to the ramp shader issue.

Using Blender 3.5 USD branch for exporting the scene and Gaffer 1.2.0.0a2.

I am flagging these issues keeping in mind Blender USD branch is in alpha state.

Cheers

A

ramp_planes.v01.usda
ramp_planes.gfr

Alex Fuller

unread,
Jan 26, 2023, 7:24:21 PM1/26/23
to gaffer-dev
Oh I didn't see this post which is about ramps specifically, I'll paste from the other conversation:

From memory the ramps were tricky to support at Tangent Animation too going from Blender->Houdini/Hydra as it is just 256 float array values at that stage with the curvature+interpolation "baked" from Blender, so making a way to tweak them with 256 knots wasn't the most fun thing in the world. A pass-through without the need of tweaking after probably would be fine though.


A solution that I was proposing at the time at least internally was a portable (non-GPL) spline library to live in Blender and the Hydra delegate. I'm not sure if USD has one now, but the one out of Cortex would be a great fit for Gaffer compatibility, something to discuss with the Blender people probably...

And to add: they will probably be hesitant to break compatibility eg. change to a different spline library, so it might be that they port Blender's one to the Cycles standalone code-base and make it Apache 2.0 could be the way to go.

aurora

unread,
Jan 26, 2023, 9:51:09 PM1/26/23
to gaffer-dev

Yes, I realized the way splines get "baked" and exported to USD.  I the .gfr file above I include a script that covert them to Gaffer nodes, but yes... not ideal to edit.
I was thinking on a way to resample the curve with something like the shapely module and keep the relevant points, but that is just a though.
To be continue...
Thanks Alex.

John Haddon

unread,
Jan 27, 2023, 5:51:30 AM1/27/23
to gaffe...@googlegroups.com
We should be able to support baked ramps like this without too much difficulty, but it looks like we have a bug in our handling of colour arrays in the Cycles backend. Could you open an issue for this on GitHub please, so we can track it?

I think the "assigns either Ramp or Curves to both planes" problem is a separate bug which we already have an issue for - see https://github.com/GafferHQ/gaffer/issues/4890. You can work around it temporarily by making each mesh artificially unique using the trick in the screenshot below :

image.png

Do you know if there is any prospect of Blender fixing the names they are using when exporting shader parameters? Cycles sockets have a `name` and a `ui_name`, and it looks like Blender is exporting using the `ui_name` rather than the true name.

Cheers...
John


--
You received this message because you are subscribed to the Google Groups "gaffer-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaffer-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gaffer-dev/803a6b65-63b5-4796-9b2c-8eecbb85601an%40googlegroups.com.

John Cox

unread,
Jan 27, 2023, 8:36:58 AM1/27/23
to gaffer-dev
As far as fixing the export goes, I don't think this is on their radar.  Can I refer you to the
relevant working group where this could be raised

aurora

unread,
Jan 27, 2023, 10:55:12 AM1/27/23
to gaffer-dev
Thank you all.
I have asked about these issues on the Blender places, but I haven't got a straight answer.
My hope is that the USD Export features (cycles shaders) of the USD Branch get ported to the Master. That way these requests come more into focus.
Stellar response from you guys... as usual.
Cheers!
A
Reply all
Reply to author
Forward
0 new messages