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.

Messages - branflakes

Pages: [1]
What is the status of the Python API in the future ?

Will it still be supported, or will it be restricted to a commercial license only ?

Dang,I was hoping there would be a more elegant solution ;D

I know that Froyak wrote it, but do you know how the maya plug-in took the mesh as inputs when it was still maintained ?

As far as I can see, the api and the .mel script loads up the baker exe

Is there a better way to get a selected mesh inside of Maya itself to run through sbsbaker ?

I came up with a hacky solution where I export my selected mesh, and the sbsbaker reads the firepath of the .obj, but I am sure there is a cleaner way to do it, since I think the Substance Maya batch plugin works entirely inside of Maya.

I know it requires a string filepath, but I don't know what the string should be while having an object selected in Maya.

Code: [Select][0] doesn't work. The string title of my selected object also doesn't work, so I am lost. :-\


Yes, this is absolutely perfect ! It answered all my questions I had so far.

Thank you so much ! ;D

Hey !!

Saw the talk from David at GDC, very cool. Been using pixel processor and converting code into graph, but looking at how David was playing with filter kernels got me interested.

My python is super rusty by the way !

DESIRED RESULT ONCE COMPILED: Image of what I am trying to do with just python:

I tried stripping down the file, but that does not seem to work. This sample is way over my head and I just want to get started on a very bare bones basic python file just to get me started, and I could figure out the rest.

Attempts: So far, my code compiles fine, but all it does is create an empty graph inside my .sbs. package and a function graph. Of course this was not what I was looking for.

I am having trouble understanding how to encapsulate this function graph inside my pixel processor node (that never got spawned inside my compiled .sbs file)


Heres the code

Code: [Select]
import argparse
import functools
import os

from pysbs import context
from pysbs import sbsenum
from pysbs import sbsgenerator

import demo_cmd
import demos
import sbsMath.sbsmath as sm
import sbsMath.sbsmath_tools as st

xOffset = [-200, 0, 0]
yOffset = [0, 200, 0]

def create_base_network(graph, doc):

    pp_node = graph.createCompFilterNode(sbsenum.FilterEnum.PIXEL_PROCESSOR,
    return pp_node

def basic(fn):
    Substance function for generating a uv coordinate from a sphere normal and a tiling factor

    :param fn: The function context to create the function in
    :type fn: FunctionContext
    :return: function, a function to call to instantiate the function
    x = fn.input_parameter('x', widget_type=sbsenum.WidgetEnum.COLOR_FLOAT1)
    y = fn.input_parameter('y', widget_type=sbsenum.WidgetEnum.COLOR_FLOAT1)

    return fn.generate(x+y)

def main():
    parser = argparse.ArgumentParser('myPixel')
    args = parser.parse_args()
    atk_dir = demo_cmd.get_automation_toolkit_directory(args)
    samples_dir = demo_cmd.get_automation_toolkit_samples_directory(args)
    packages_dir = demo_cmd.get_automation_toolkit_packages_directories(args)

    # Use the python api to find the command line tools
    sbs_context = context.Context()

    output_path = os.path.join(samples_dir, 'myPixel')
    output_file = os.path.join(output_path, '')
    # Make sure the output directory exist

    # Create our target document
    doc = sbsgenerator.createSBSDocument(sbs_context,

    st.generate_function(basic, doc, name='basic')

    # Create a simple network with a pixel processor
    # and some inputs
    # pp_node = create_base_network(graph, doc)
    #pp = pp_node.getPixProcFunction()


if __name__ == '__main__':

Pages: [1]