Error in modifying existing material attributes

I’m getting an error when trying to modify existing material attributes:

def random_object_materials():
    Steel_Stainless = rep.get.prims(path_pattern='/Root/World/Looks/Steel_Stainless')
    with Steel_Stainless:
        rep.modify.attribute('albedo', rep.distribution.uniform(0,1))

rep.randomizer.register(random_object_materials)

2022-07-07 16:27:41 [Error] [omni.graph.core.plugin] OmniGraph Error: WritePrimAttribute Error: Attribute ‘albedo_add’ could not be found for prim at /Root/World/Looks/Steel_Stainless/Shader

but when I try something that doesn’t exist (e.g. ‘albedo’) i get the output where it says that it is available:

2022-07-07 16:28:58 [Error] [omni.graph.core.plugin] OmniGraph Error: WritePrimAttribute Error: Attribute name albedo was not found in shader UsdShade.Shader(Usd.Prim(</Root/World/Looks/Steel_Stainless/Shader>)). Available attributes: [‘diffuse_color_constant’, ‘diffuse_texture’, ‘albedo_desaturation’, ‘albedo_add’, ‘albedo_brightness’, ‘diffuse_tint’, ‘reflection_roughness_constant’, ‘reflection_roughness_texture_influence’, ‘reflectionroughness_texture’, ‘metallic_constant’, ‘metallic_texture_influence’, ‘metallic_texture’, ‘specular_level’, ‘enable_ORM_texture’, ‘ORM_texture’, ‘ao_to_diffuse’, ‘ao_texture’, ‘enable_emission’, ‘emissive_color’, ‘emissive_color_texture’, ‘emissive_mask_texture’, ‘emissive_intensity’, ‘enable_opacity’, ‘enable_opacity_texture’, ‘opacity_constant’, ‘opacity_texture’, ‘opacity_mode’, ‘opacity_threshold’, ‘bump_factor’, ‘normalmap_texture’, ‘detail_bump_factor’, ‘detail_normalmap_texture’, ‘flip_tangent_u’, ‘flip_tangent_v’, ‘project_uvw’, ‘world_or_object’, ‘uv_space_index’, ‘texture_translate’, ‘texture_rotate’, ‘texture_scale’, ‘detail_texture_translate’, ‘detail_texture_rotate’, ‘detail_texture_scale’, ‘excludeFromWhiteMode’]

Solved:
Steel_Stainless = rep.get.prims(path_pattern=‘/Root/World/Looks/Steel_Stainless’, path_pattern_exclusion=‘/Root/World/Looks/Steel_Stainless/Shader’)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.