Author Topic: Unity 2018 API Extensions  (Read 894 times)

Hello all! I've been messing with the API for the Unity 2018 plugin and thought it would be cool to have a thread where we can share any extensions or tools we come up with.

I'll start with a class that makes parameter name selection easier (no more typing in strings by memory)! Use case for this would be for streamlining editor tools and for easy selection of input parameters when adjusting values at runtime. I've included an example scene with a basic script to show how the SubstanceParameter class can be used.

I'm still poking around the API (my main project is still in 2017 until the plugin stabilizes a little more), so I'm not sure what else I'll come up with. I'll post here if I come up with anything else that's useful.

Release Edit:
SubstanceExtensions now has a release page on GitHub where the most recent version will always be accessible. The SubstanceExtensions unity package on this thread will be kept as up to date as possible, but the GitHub repo will always have the most recent codebase!
Last Edit: October 09, 2018, 06:48:47 am

Hello all! I've been messing with the API for the Unity 2018 plugin and thought it would be cool to have a thread where we can share any extensions or tools we come up with.

I'll start with a class that makes parameter name selection easier (no more typing in strings by memory)! Use case for this would be for streamlining editor tools and for easy selection of input parameters when adjusting values at runtime. I've included an example scene with a basic script to show how the SubstanceParameter class can be used.

I'm still poking around the API (my main project is still in 2017 until the plugin stabilizes a little more), so I'm not sure what else I'll come up with. I'll post here if I come up with anything else that's useful.

This is awesome! Thanks so much for sharing. I will show this to the team.

Cheers,
WEs
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

This is awesome! Thanks so much for sharing. I will show this to the team.

Cheers,
WEs

No problem! Part of the goal for this thread is community engagement to help improve the plugin. (Maybe by getting some of the stuff posted here rolled into the official release... *nudge* *nudge*)

Along those lines, are there any plans to expose the plugin code to public collaboration via GitHub or something like it? Not the engine code itself, just the Unity integrations (Substance.Game.dll and Substance.Editor.dll). This is similar to how Unity has their UI code on Bitbucket. Doing so would allow the community to work with your dev team by submitting pull requests, or at the very least allow people to experiment with new functionality more easily.

For example, I've been trying to mess with some inspector functionality for SubstanceGraphs but am unable to do so because those custom inspector scripts are locked away inside the Substance.Editor dll. Specifically I set out to get the old behaviour of having tooltips display a parameter's exposed name when hovering over a label, but I cannot do so with the current set up.

This is awesome! Thanks so much for sharing. I will show this to the team.

Cheers,
WEs

No problem! Part of the goal for this thread is community engagement to help improve the plugin. (Maybe by getting some of the stuff posted here rolled into the official release... *nudge* *nudge*)

Along those lines, are there any plans to expose the plugin code to public collaboration via GitHub or something like it? Not the engine code itself, just the Unity integrations (Substance.Game.dll and Substance.Editor.dll). This is similar to how Unity has their UI code on Bitbucket. Doing so would allow the community to work with your dev team by submitting pull requests, or at the very least allow people to experiment with new functionality more easily.

For example, I've been trying to mess with some inspector functionality for SubstanceGraphs but am unable to do so because those custom inspector scripts are locked away inside the Substance.Editor dll. Specifically I set out to get the old behaviour of having tooltips display a parameter's exposed name when hovering over a label, but I cannot do so with the current set up.

This is a very interesting idea. I am talking to the dev team about it. I'm not sure what we will do, but it's important for us to have this conversation. Thanks very much for your feedback and support.

Cheers,
Wes
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Been messing around with a tool to export Substance textures as standalone assets directly inside of Unity. My original goal was to produce a workaround for a current issue with iOS support, but there is another bug involving RAW textures that limits the current usefulness of this particular tool. The tool functions, but until the RAW bug is fixed it is little more than a novelty.

To export textures from a substance, select "Substance => Export Substance Textures" and drag a substance into the displayed field. Once a valid substance is referenced, just click the export button to export the textures to a target folder.

I've included a package with the export scripts here, as well as a combined package containing the substance parameter scripts in the thread's original post. These packages all contain assembly definition files for their scripts.
Last Edit: June 30, 2018, 01:49:06 am

Added support for compressed textures to the Export Substance Textures window. It should now support both compressed and uncompressed formats. I'll update the appropriate packages.

Side question, does anyone know if there is a public facing timeline of plugin features? It would be nice to know what features are in the pipeline or when updates are targeted for release.

Made a public repo on GitHub for the extensions I've made so far. I've posted documentation on how to use each extension on GitHub as well. I'll continue posting asset packages here, but I figured it would be nice to have a front facing repo for people to see what extensions are available.

If anyone has an idea for extension, feel free to create an issue on GitHub! (Recommend always posting here too so the Allegorithmic devs can see what the community is trying to do)

@Synthoid Please do not redistribute the Substance Engine binaries through other means than our official channels (our website, the Unity asset store, etc.) when you are not shipping a full game / standalone program. Instead, in cases such like this, you should direct your users to download the plugin from these channels and install it first, then get / install your source code. Thanks.
Last Edit: June 21, 2018, 12:34:57 pm

@Synthoid Please do not redistribute the Substance Engine binaries through other means than our official channels (our website, the Unity asset store, etc.) when you are not shipping a full game / standalone program. Instead, in cases such like this, you should direct your users to download the plugin from these channels and install it first, then get / install your source code. Thanks.

I've removed the plugin files from the repo. Sorry for the mixup!

@Synthoid Please do not redistribute the Substance Engine binaries through other means than our official channels (our website, the Unity asset store, etc.) when you are not shipping a full game / standalone program. Instead, in cases such like this, you should direct your users to download the plugin from these channels and install it first, then get / install your source code. Thanks.

I've removed the plugin files from the repo. Sorry for the mixup!

Thanks! We appreciate your contributions to the community : )
Cheers,
Wes
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Added some new features to the SubstanceExtensions package, including the SubstanceOutput class to conveniently access (what else) Substance output names! There's also a new extension class for SubstanceGraph. Currently the existing SubstanceGraph extension methods are just for randomizing the random seed value of a graph, but those methods will expand over time as I see what people on the forums are attempting to do (those will probably happen faster if you post in this thread).

I've also created an official release over on GitHub. I'll be removing most of the asset packages in this thread with the exception of the main SubstanceExtensions.unitypackage. This is so I don't have to keep track of each individual extension's unity package, which would get pretty hectic after a while.
Last Edit: June 30, 2018, 02:03:17 am

Added some new features to the SubstanceExtensions package, including the SubstanceOutput class to conveniently access (what else) Substance output names! There's also a new extension class for SubstanceGraph. Currently the existing SubstanceGraph extension methods are just for randomizing the random seed value of a graph, but those methods will expand over time as I see what people on the forums are attempting to do (those will probably happen faster if you post in this thread).

I've also created an official release over on GitHub. I'll be removing most of the asset packages in this thread with the exception of the main SubstanceExtensions.unitypackage. This is so I don't have to keep track of each individual extension's unity package, which would get pretty hectic after a while.

Hi,

I sent you a PM on this forum. I forgot to add the subject so the No Subject message is from me : ) I would love to have you speak with our dev working on the API if you are available. I'd like to get your feature requests and feedback. Can you send me an email at wes.mcdermott@allegorithmic.com?

Cheers,
Wes
Integrations Product Manager / Training
wes.mcdermott@allegorithmic.com
Twitter: The3DNinja

Finally got around to updating these extensions to work with version 2.0.2 of the Substance in Unity plugin. Sorry for the delay everyone!

Just pushed an update to make the extensions compatible with version 2.1.0 of the Substance in Unity plugin.

Notably, this version also moved extension code to the SubstanceExtension namespace, from the previous Substance.Game namespace. This should help to clearly separate extension code from native Substance code more clearly.