Curve points edit in Substance Designer

New Here ,
Dec 14, 2021 Dec 14, 2021

Copy link to clipboard

Copied

I'm tryiing to edid curve points in SD but the whole thing just keep crashing after i run this piece. Any suggestions ? Thank you in advance.

 

import sd
from sd.api.sdvaluefloat import *
from sd.api.sdvaluefloat2 import *
from sd.api.sdvaluebool import *
from sd.api.sdvaluecolorrgba import *
from sd.api.sdvaluearray import *
from sd.api.sdvaluestruct import *
from sd.api.sdtypestruct import *
from sd.api.sdapplication import *
from sd.api.sdproperty import *

ctx = sd.getContext()
app = ctx.getSDApplication()
uiMgr = app.getQtForPythonUIMgr()
graph = uiMgr.getCurrentGraph()
nodes = graph.getNodes()
node = nodes.getItem(0)


curve_struct = SDTypeStruct.sNew('sbs::compositing::curve_key')

point = SDValueStruct.sNew(curve_struct)
point.setPropertyValueFromId('position', SDValueFloat2.sNew(float2(0,0)))
point.setPropertyValueFromId('isLocked', SDValueBool.sNew(True))
point.setPropertyValueFromId('left', SDValueFloat2.sNew(float2(0,0)))
point.setPropertyValueFromId('isLeftBroken', SDValueBool.sNew(True))
point.setPropertyValueFromId('right', SDValueFloat2.sNew(float2(0.1,0)))
point.setPropertyValueFromId('isRightBroken', SDValueBool.sNew(True))

point2 = SDValueStruct.sNew(curve_struct)
point2.setPropertyValueFromId('position', SDValueFloat2.sNew(float2(1.0,1.0)))
point2.setPropertyValueFromId('isLocked', SDValueBool.sNew(True))
point2.setPropertyValueFromId('left', SDValueFloat2.sNew(float2(0.566,0.748)))
point2.setPropertyValueFromId('isLeftBroken', SDValueBool.sNew(False))
point2.setPropertyValueFromId('right', SDValueFloat2.sNew(float2(1,1)))
point2.setPropertyValueFromId('isRightBroken', SDValueBool.sNew(False))


curveArray = SDValueArray.sNew(curve_struct, 0)
curveArray.pushBack(point)
curveArray.pushBack(point2)

print(curveArray.getSize())

for i in range(0, curveArray.getSize()):
print(curveArray.getItem(i).getPropertyValueFromId('position').get())
print(curveArray.getItem(i).getPropertyValueFromId('isLocked').get())
print(curveArray.getItem(i).getPropertyValueFromId('left').get())
print(curveArray.getItem(i).getPropertyValueFromId('isLeftBroken').get())
print(curveArray.getItem(i).getPropertyValueFromId('right').get())
print(curveArray.getItem(i).getPropertyValueFromId('isRightBroken').get())
print('-------------------------------------')

 

node.setInputPropertyValueFromId('curveluminance', curveArray)

TOPICS
Scripting

Views

46

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 14, 2021 Dec 14, 2021

Have you tried the latest version (11.3.1) released today? There is a fix listed for a crash with the curves node:

 

https://substance3d.adobe.com/documentation/sddoc/all-changes-188973131.html

 

Dave

Likes

Translate

Translate
Community Expert ,
Dec 14, 2021 Dec 14, 2021

Copy link to clipboard

Copied

Have you tried the latest version (11.3.1) released today? There is a fix listed for a crash with the curves node:

 

https://substance3d.adobe.com/documentation/sddoc/all-changes-188973131.html

 

Dave

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Dec 17, 2021 Dec 17, 2021

Copy link to clipboard

Copied

LATEST

Hello @edward_woopie and @davescm,

 

Indeed, the fix in our latest bugfix release (11.3.1) mentioned by Dave fixes exactly this crash!

 

Best regards.

 

Luca Giarrizzo | QA Analyst, 3D & Immersive | Adobe

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
express Get Adobe Express free

Easily make social graphics, flyers, logos, and more from thousands of free templates.

Get free app
Free to use, no credit card required