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 - jmkintela

Pages: [1]
1
Substance DesignerSubstance Designer - Scripting - Node Selection order
 on: June 07, 2021, 11:06:11 pm 
I'm doing a loop to connect a bunch of color masks to blend nodes via python loop , but the connection occurs randomly and nost in order as one would expect... what's wrong?

this is the code
Code: [Select]
import sd
from PySide2 import QtGui
from sd.api.sduimgr import SDUIMgr
from sd.api.sdproperty import SDPropertyCategory
from sd.api.sdapplication import SDApplicationPath

class CompNodeCreator(object):
    def __init__(self):
        # Get app and UI manager.
        ctx = sd.getContext()
        app = ctx.getSDApplication()
        self.ui_manager = app.getQtForPythonUIMgr()
       
 
   
    def add_node(self, name, pos):
     
        # Get the comp graph.
        sd_graph = self.ui_manager.getCurrentGraph()
       
        # Create a node.
        node_def_id = 'sbs::compositing::{definition}'.format(definition=name)
        sd_node = sd_graph.newNode(node_def_id)
        sd_node.setPosition( sd.api.sdbasetypes.float2(pos[0],pos[1]))
       
        return sd_node

# Run


def NodeProps(node):
    nodePropsA = node.getProperties(SDPropertyCategory.Output)
    for i in range(len(nodePropsA)):
    print(nodePropsA[i].getId())
    print(nodePropsA[i].getType())
   
    nodePropsB = node.getProperties(SDPropertyCategory.Input)
    for i in range(len(nodePropsB)):
    print(nodePropsB[i].getId())
    print(nodePropsB[i].getType())

selection = uiMgr.getCurrentGraphSelection()
i = 300
i2 = 0
pos = [0,0]
n = {}

for e,node in enumerate(selection):
    print(pos)
    print(str(e))
    name = 'blend'
    blend = node_creator.add_node(name,pos)
    node.newPropertyConnectionFromId('output',  blend  ,'opacity')   
    pos[0] += i2
    pos[1] += i

2
Substance DesignerSubstance Designer - Scripting - Create a connection
 on: June 06, 2021, 05:27:50 am 
Hi, how Do I create a connection between two nodes?? via python of course

I have this code working to create the nodes :

Code: [Select]
from PySide2 import QtGui
from sd.api.sduimgr import SDUIMgr
import sd

class CompNodeCreator(object):
    def __init__(self):
        # Get app and UI manager.
        ctx = sd.getContext()
        app = ctx.getSDApplication()
        self.ui_manager = app.getQtForPythonUIMgr()
       
 
   
    def add_node(self, name, pos):
     
        # Get the comp graph.
        sd_graph = self.ui_manager.getCurrentGraph()
       
        # Create a node.
        node_def_id = 'sbs::compositing::{definition}'.format(definition=name)
        sd_node = sd_graph.newNode(node_def_id)
        sd_node.setPosition( sd.api.sdbasetypes.float2(pos[0],pos[1]))
       
        return sd_node

# Run

pos = [200,0]
pos2 = [400,0]
name = 'blend'
node_creator = CompNodeCreator()
node = node_creator.add_node(name,pos)
node2 = node_creator.add_node(name,pos2)

3
Substance DesignerSubstance Designer - Scripting - Color Mask
 on: June 05, 2021, 02:55:22 pm 
I want to bake a color map by creating a random color for each submesh group,
and use this colors to create one Color mask per Color,
 So I need to create this colors and store them on a list to loop them over later,
I attach some Pseudo Code So you can get what I want to do.
How Can I do this via python?

4
More than a question is an observation.
I've been trying to use the python api and the lack of examples on the api docs is  driving me mad to the point of quit learning it.
Please create some real use examples , or a Git project with some real code.
I open each of the post on this section to look for example code, but found very little.
I'm the only one with this problem?

5
Hi
I have a substance designer .sbsar material working with udims,
I want to import it with labs substance material on houdini and write all udims textures per frame on COPS network,
so I can animate it's values over time..
but I can't get to export all udims on houdini, only the first show up..
it's some kind of export thing I have to do on SD ?

I'm asking this question on houdini forum also: https://www.sidefx.com/forum/topic/79191/


Pages: [1]