Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Lorin Atzberger 0

Pages: [1]
1
Hello

I'm using Automation Toolkit 2018.3.0

Somewhere in my code, I have the following line:
Code: [Select]
output = graph.createOutputNode(aIdentifier = identifier, aUsages = usages)usages is defined as:
Code: [Select]
{
pysbs.sbsenum.UsageEnum.HEIGHT: pysbs.sbsenum.ComponentsEnum.R,
pysbs.sbsenum.UsageEnum.METALLIC: pysbs.sbsenum.ComponentsEnum.G,
pysbs.sbsenum.UsageEnum.ROUGHNESS: pysbs.sbsenum.ComponentsEnum.B,
pysbs.sbsenum.UsageEnum.AMBIENT_OCCLUSION: pysbs.sbsenum.ComponentsEnum.A
}
This throws this error:
Code: [Select]
[ERROR][pysbs.api_decorators] Exception of kind AttributeError in pysbs.sbsgenerator, line 564: _resolveUsage()
[ERROR][pysbs.api_decorators] Exception of kind AttributeError in pysbs.sbsgenerator, line 623: createOutputNode()
[ERROR][pysbs.api_decorators] Exception of kind AttributeError in pysbs.graph.graph, line 1585: SBSGraph.createOutputNode()
Traceback (most recent call last):
  File "fixSbs.py", line 146, in <module>
    fixSbs(inputPath, outputPath)
  File "fixSbs.py", line 136, in fixSbs
    pysbs.sbsenum.UsageEnum.AMBIENT_OCCLUSION: pysbs.sbsenum.ComponentsEnum.A
  File "fixSbs.py", line 58, in createOutput
    output = graph.createOutputNode(aIdentifier = identifier, aUsages = usages)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\pysbs\api_decorators.py", line 54, in wrapper
    return function(*args, **kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\pysbs\graph\graph.py", line 1585, in createOutputNode
    aVisibleIf = aVisibleIf)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\pysbs\api_decorators.py", line 54, in wrapper
    return function(*args, **kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\pysbs\sbsgenerator.py", line 623, in createOutputNode
    outputUsages = [_resolveUsage(usg, usageDict) for usg, usageDict in aUsages.items()]
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\pysbs\sbsgenerator.py", line 623, in <listcomp>
    outputUsages = [_resolveUsage(usg, usageDict) for usg, usageDict in aUsages.items()]
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\pysbs\api_decorators.py", line 54, in wrapper
    return function(*args, **kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python36\lib\site-packages\pysbs\sbsgenerator.py", line 564, in _resolveUsage
    colorspace = usageData.get(sbsenum.UsageDataEnum.COLOR_SPACE, None)
AttributeError: 'int' object has no attribute 'get'

I'm not sure why this happens because according to the documentation present here: https://docs.substance3d.com/sat/pysbs-python-api/api-content/substance-definition/graph
the usages argument is defined like this:
Code: [Select]
aUsages (dictionary {UsageEnum : ComponentsEnum}, optional) – usage of this output
This was working perfectly fine when I was using the Automation Toolkit 2018.1.0.

I also checked, and removing the argument will stop the error from being thrown.

Is this a bug or am I not using the API correctly?


2
Hello

When trying to perform rendering with automation toolkit 2018.2.0 on a substance saved with Substance Designer 2018.2.2 I get the following:

Code: [Select]
[ERROR][SBSCooker]Variable type mismatch:

      Variable Name: background_color

      Of Type: Float

      Accessed By: Get Float4

      While Evaluating Parameter: background

      In Graph: pkg:///tile_random?dependency=1290776988

      Node ID: 1207746925

   ... (repeated 2 more times)

[ERROR][SBSCooker]Cooking fail [Error 13]

The error seems to be within the the files made by the substance team.

I cannot update since this is the max my license allows. This was working fine with some older versions (2018.1) so it looks like a regression.

Could anyone help me out here? Should I edit pkg:///tile_random?dependency=1290776988 manually somehow?

3
Hello,

I'm working on a little automation tool to get my substances from the pretty things I see in SD all the way to unity using my own shaders and my own texture layouts all with a single click.

I wrote a python script that modifies the sbs to change the last bits and pack maps together. Another one converts the sbs to a sbsar, another one renders the textures.

I create native materials for people who do not use substance and I'd like to have the substance materials generated correctly as well. I used dotpeek to look at how the editor code for substance looks and I sort understood what's happening. So, I get the materials from the graph, change the shader and the textures bindings. Then I call the commit functions from SubstanceImpoter, mark the substance as dirty and refresh the asset database. This works but only until for some reason the whole substance is reimported and my changes are discarded.

I get that the substance integration is supposed to be bare minimum and I should not expect fancy features like editor integration but could I still do this?

Regards,
Lorin

4
Hello,

I'm trying to set up a workflow where I use substance designer to create a terrain generator outputting heightmap and biome information.

I set the outputs in substance designer to 32bit floats but in Unity it seems the textures are always RGBA8.

Is there any way to get the raw texture information from a graph after rendering it?

5
Hello.

I'm trying to write a python script that fixes the unity issues related to smoothness and metallic.

I wrote a script that finds the metallic and roughness outputs, gets the connections to the left and then connects those nodes to a bunch of new nodes (invert, channel shuffle, a new output).

This works really well when the nodes the outputs are connected to are simple things, like a levels, or a blur and so on. Now, I've stumbled upon a case where the node on the left hand of the connection has multiple outputs (in fact, it's a whole material).

The issue is that since I don't specify what output to connect to, they always get connected to the first one (a diffuse in this case). Is there any way to know what output from a node a connection is made to? I might not be understanding this so well since I'm a bit new to python but I'm "fluent" in c++ and other more normal languages.

Here's the code that handles this roughness/metallic->metalSmoothenss issue:

Code: [Select]
          #Get Metallic and RoughnessNodes
          metallicOutput = graph.getGraphOutputNode(aOutputIdentifier = 'metallic')
          metallicNodeUid = graph.getNode(metallicOutput.mUID).mConnections[0].getConnectedNodeUID()
          metallicNode = graph.getNode(metallicNodeUid)


          roughnessOutput = graph.getGraphOutputNode(aOutputIdentifier = 'roughness')
          roughnessNodeUid = graph.getNode(roughnessOutput.mUID).mConnections[0].getConnectedNodeUID()
          roughnessNode = graph.getNode(roughnessNodeUid)
         

          #Create MetallicSmoothness output
          invertedRoughness = graph.createCompFilterNode(aFilter = pysbs.sbsenum.FilterEnum.LEVELS,
                                                         aParameters = {
                                                             pysbs.sbsenum.CompNodeParamEnum.LEVEL_IN_LOW : '0.0 0.0 0.0 0.0',
                                                             pysbs.sbsenum.CompNodeParamEnum.LEVEL_IN_HIGH: '1.0 1.0 1.0 1.0',
                                                             pysbs.sbsenum.CompNodeParamEnum.LEVEL_IN_MID:  '0.5 0.5 0.5 0.5',
                                                             pysbs.sbsenum.CompNodeParamEnum.LEVEL_OUT_LOW: '1.0 1.0 1.0 1.0',
                                                             pysbs.sbsenum.CompNodeParamEnum.LEVEL_OUT_HIGH:'0.0 0.0 0.0 0.0',
                                                             pysbs.sbsenum.CompNodeParamEnum.CLAMP_IN_TERM: '1'             
                                                             }
                                                         )

          graph.connectNodes(aLeftNode = roughnessNodeUid, aRightNode = invertedRoughness)
         
          metallicSmoothMerge = graph.createCompFilterNode(aFilter = pysbs.sbsenum.FilterEnum.SHUFFLE,
                                                           aParameters = {
                                                               pysbs.sbsenum.CompNodeParamEnum.CHANNEL_RED: pysbs.sbsenum.ChannelShuffleEnum.INPUT1_RED,
                                                               pysbs.sbsenum.CompNodeParamEnum.CHANNEL_GREEN: pysbs.sbsenum.ChannelShuffleEnum.INPUT1_RED,
                                                               pysbs.sbsenum.CompNodeParamEnum.CHANNEL_BLUE: pysbs.sbsenum.ChannelShuffleEnum.INPUT1_RED,
                                                               pysbs.sbsenum.CompNodeParamEnum.CHANNEL_ALPHA: pysbs.sbsenum.ChannelShuffleEnum.INPUT2_RED
                                                               })
          graph.connectNodes(aLeftNode = metallicNodeUid, aRightNode = metallicSmoothMerge, aRightNodeInput = pysbs.sbsenum.InputEnum.INPUT1)
          graph.connectNodes(aLeftNode = invertedRoughness, aRightNode = metallicSmoothMerge, aRightNodeInput = pysbs.sbsenum.InputEnum.INPUT2)
         
          outMetallicSmoothness = graph.createOutputNode(aIdentifier = 'metallicSmoothness',
                                                         aUsages = {pysbs.sbsenum.UsageEnum.ANY: pysbs.sbsenum.ComponentsEnum.RGBA})

          graph.deleteNode(graph.getNode(metallicOutput.mUID))
          graph.deleteNode(graph.getNode(roughnessOutput.mUID))

If anyone of you could help me out with this, I'd greatly appreciate it.

Also, on a more unrelated note, when using sbsrender it would be great if there would be an option to invert the normals(only the ones in the output since others might be used for curvature sobel or something). So far I've had to do this from within Unity and it's rather tedious to figure out how the TextureImporter works.

Regards,
Lorin

6
Hello all,

I'm fairly new to Substance Painter. I've been using a lot of Substance Designer before though.

I've done the PBR Material Layering tutorial and I'm impressed by the results but some things are unclear.
Is there any way to bake the textures used from material layering to a normal pbr shader? I know this workflow is meant for something else but it would still be a nice feature.
I also tried getting the same results without using the pbr layering shader and I was successful for the most part but I'm not sure how to go about creating the normal from masks using this method.

Thanks,
Lorin.

7
Hello, my name is Lorin and here are some of my works. By day I work as a programmer but these tools are just fun to work with. I used to play with Genetica a while ago and when I found out how much better this tool is instantly switched. I'm mostly doing this work to sell on the Unity asset store.


Pages: [1]