Text Files (OSL Scripts, Python Scripts) as Assets
Make text files assets in Blender to make managing, storing and sharing them easier. It could improve UX a lot, reduce dependancy on workarounds, and introduce a new way of sharing smaller, less often used scripts in a safer way.
- OSL Shaders
Text files that are .osl can be drag & dropped them in Shader Editor. Script node is added with .osl loaded. Similar to how dragging Image from outside works and creates Image Texture node.
(being able to drag & drop .osl files inside Blender would be nice too)
OSL scripts can appear in Add Menu > Script, which is currently empty menu. Also similar to how node group assets appear in search menu now.
I think this will not only be convenient UX for those who use osl, but it will make them more discoverable for users, and will make osl files more shareable in Blender community. Even though Cycles can use osl it is not as known and used as in other renderers.
- Python Scripts
Majority of add-ons that are shared in Blender community doesn't need to be addons. They're mostly operations that you need to perform once, couple of times, or very rarely. Having them installed and initialized on every open is making Blender slower for lot of users, and less stable, since add-ons are often not optimized and spawn multiple errors, sometimes even mess up Blender.
Geometry Node Group assets is partially solving this issue, introducing alternative method of storing operations as assets. And Python scripts would take care of remaining chunk too.
That way people can store and share scripts that are less used, and don't need to be initialized on every open, don't need to have permanent panels in the sidebar.
That way
a) users can only initialize them when needed
b) it will clean up N-panel and keep people from adding panels there they only use once in a while.
c) scripts can be execute in safer manner
7 Comments
Makes me think, it could be nice to support text assets in general, and even have ways to "execute" them from the browser.
I.E. simple run scripts you could just have as assets in the browser that you could either import in the scene or just <right click → run> from the browser without the need to import first.
I could also picture situations in a production where you could have client notes as text in the browser, or the dialogue transcript for animation shots, or some asset documentation, ...
I totally agree. I think scripts is very underused part of Blender as well. There is culture of add-ons built around Blender, which has become overgrown and unstable. People are using addons for things that can simply be assets, like node groups. Resulting in slower Blender and abysmal console filled with bugs.
Node group assets is solving it step-by-step. And texts as assets would solve another chunk of issues. Besides OSL scripts for shader editor, you're right, it can support python scripts too.
I have some scripts that I simply store as python text files instead of registering them as addons, because quite frankly people are registering addons for things they're using once a month at best. And kinda risking with it. If python creators like myself could share scripts as assets, it would make experience much nicer and safer.
I will update proposal to include text files in general
In my opinion this is a must have. One of the annoying part about blender is the lack of shelf. With this the asset browser can act as a shelf for all our script. We can drop the script on an area to run the script if we need the script to run in that area or on a certain object (outliner, 3d view) or just simply drop the script (text editor, shader editor, etc). Are they developing this?
I've got mixed feelings on this, did you thought about making a nodegroup of the OSL node ?
You can do that of course, but it's just a chore to create input for script input and output for every output. It would be great UX to have droppable scripts. And it would also allow appending scripts in internal text editor, making changing them easier I think
You are right, that makes sense !
Really cool