Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I set a layer's category via Python API?

New Here ,
Jul 22, 2025 Jul 22, 2025

I am trying to use the API to automate processing of a directory containing some images. I need to set the category under the "basic parameters" section. How can this be accomplished?

 

colorful_wanderer3414_0-1753221820741.png

 

TOPICS
Scripting
205
Translate
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

Adobe Employee , Jul 23, 2025 Jul 23, 2025

Hi, 
Here is how you can achieve that :

import substance_sampler as ssa

def main():
    asset = ssa.get_selected_asset()
    image_to_material_layer = asset.get_layers()[2]
    category_parameter = [l for l in image_to_material_layer.parameters if l.identifier == "category"][0]
    category_parameter.value = 0 # 0 for Ceramic => it is the index in the list of categories

if __name__ == '__main__':
    main()

If you are searching for other methods, you can consult the Python API documentation. He

...
Translate
Adobe Employee ,
Jul 23, 2025 Jul 23, 2025
LATEST

Hi, 
Here is how you can achieve that :

import substance_sampler as ssa

def main():
    asset = ssa.get_selected_asset()
    image_to_material_layer = asset.get_layers()[2]
    category_parameter = [l for l in image_to_material_layer.parameters if l.identifier == "category"][0]
    category_parameter.value = 0 # 0 for Ceramic => it is the index in the list of categories

if __name__ == '__main__':
    main()

If you are searching for other methods, you can consult the Python API documentation. Here is how to access it:

LoryAline_0-1753257164071.png

 

Translate
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