Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OSL-node support #12

Open
JenusL opened this issue Apr 19, 2018 · 6 comments
Open

Add OSL-node support #12

JenusL opened this issue Apr 19, 2018 · 6 comments

Comments

@JenusL
Copy link
Contributor

JenusL commented Apr 19, 2018

How could / should this be done?

@caron
Copy link
Contributor

caron commented Apr 19, 2018

First, .osl files that are on disk that are present during startup work right? SItoA asks Arnold what shaders are available and generates shader nodes/UIs, correct?

Second, is this about a generic osl code shader? If so, then I would use the Text Editor widget (can it be used in shader nodes, I don't know).

http://download.autodesk.com/global/docs/softimage2014/en_us/sdkguide/index.html?url=files/cus_ppg_TextEditorWidget.htm,topicNumber=d30e19362

@JenusL
Copy link
Contributor Author

JenusL commented Apr 19, 2018

First, .osl files that are on disk that are present during startup work right? SItoA asks Arnold what shaders are available and generates shader nodes/UIs, correct?

I wasn't aware of this but reading the docs now and yes that should already work.

So what we need is a text editor and the PPG to update after a change.
I actually think I would prefer just an Edit button that opens the .osl in the script editor instead of a widget.
And after a save, we need a Reload button, or that it senses that the .osl has changed and updates the PPG automatically.
So this might be much simpler than first thought.

So... Text Widget or Edit in script editor?

@JenusL
Copy link
Contributor Author

JenusL commented Apr 19, 2018

So since this is the first time I read about how osl works in Arnold I didn't really know what we needed until now.
Since Arnold already finds .osl files in it's search paths, maybe this issue should focus on the implementation of the osl-node instead. Here's the kick output:

kick -info osl
node:         osl
type:         shader
output:       (null)
parameters:   3
filename:     <built-in>
version:      5.1.0.0

Type          Name                              Default
------------  --------------------------------  --------------------------------
STRING        shadername
STRING        code
STRING        name

This node can take osl code directly as a string and in that case it need to use the Text Widget in the PPG.
But it could also just point to a osl-file with the shadername field.
This node has not been automatically created by SItoA. My guess is it's because of the (null) output.

@JenusL JenusL changed the title Add OSL support Add OSL-node support Apr 19, 2018
@caron
Copy link
Contributor

caron commented Apr 19, 2018

'shadername' is a path to an osl file? that is a very odd parameter name...

@sjannuz , is there any details about what shadername is/does?

@JenusL
Copy link
Contributor Author

JenusL commented Apr 19, 2018

See Manually Loading Shaders here: https://support.solidangle.com/display/A5ARP/OSL+Shaders

@caron
Copy link
Contributor

caron commented Apr 20, 2018

I see... not sure how best to use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants