Skip to main content
Participant
March 3, 2022
Question

BUG : Python API "get_channel()" not working for user channel above 7

  • March 3, 2022
  • 0 replies
  • 232 views

Hi,

It seems that get_channel() is not working for any user channel above user7 (user8-15). As well as none of the "recently added" channels (like CoatColor, CoatRoughness, CoatOpacity, SheenColor, etc).
It works fine for all the other "old" channels (like BaseColor, Height, user0-7).

using Adobe 3D Painter 7.4.1

EXAMPLE :

I manually created user12 and user4 channel.

This not working (User12)

import substance_painter.textureset
substance_painter.textureset.Stack.from_name("DefaultMaterial").get_channel(eval("substance_painter.textureset.ChannelType.User12"))

##RESULT
ValueError: There is no channel 'user12' in the texture set 'DefaultMaterial'.

At:
  C:/Program Files/Adobe/Adobe Substance 3D Painter/resources/python/modules\substance_painter\textureset.py(688): get_channel
  <string>(2): <module>

This is working (User4)

import substance_painter.textureset
substance_painter.textureset.Stack.from_name("DefaultMaterial").get_channel(eval("substance_painter.textureset.ChannelType.User4"))

##RESULT
Channel(channel_id=51)


But EVAL is working

eval("substance_painter.textureset.ChannelType.User12")

As well as add_channel()

Only get_channel() is not working and only for the "new" channels.

Also reported here:
https://community.adobe.com/t5/substance-3d-painter-discussions/a-user-channel-can-not-be-accessed-by-python-api/m-p/12768199#M2306 

Thank you,
Timothee Maron

This topic has been closed for replies.