Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Attach different texture tags for different texture randomizers

Discussion in 'Computer Vision' started by dusansvilarkovic, Jun 30, 2021.

  1. dusansvilarkovic

    dusansvilarkovic

    Joined:
    Jun 8, 2021
    Posts:
    9
    So I have wall objects that have prefixed 6 possible types of wall textures, and one floor object with prefixed 6 possible types of floor textures. Given that I only have one TextureRandomizer in the package, how I can make this one work with various walls and floors and generate different textures each time?

    I tried generating wall and floor textures by copying the TextureRandomizer (com.unity.perception/TextureRandomizer.cs at master · Unity-Technologies/com.unity.perception (github.com) and changing class and file names to WallTextureRandomizer and FloorTextureRandomizer and reusing TextureRandomizerTag and renaming to WallTextureRandomizerTag and FloorTextureRandomizerTag (also copying implementation and changing class and file name of it), but unfortunately it did not work when generating (tags seem to not be created for walls and floors I included them for). I made one Scenario for those Texture randomizers (WallTextureRandomizer and FloorTextureRandomizer), added tags needed to floor (FloorTextureRandomizerTag) and wall (WallTextureRandomizerTag). Note that I have previous scenario used for some other stuff which I would like to work along with this.
     
  2. dusansvilarkovic

    dusansvilarkovic

    Joined:
    Jun 8, 2021
    Posts:
    9
  3. JonHUnity

    JonHUnity

    Joined:
    Sep 16, 2016
    Posts:
    21
    Copying the classes is a good approach. I would suggest looking into why your floors and walls do not have the tags that you added. These are standard MonoBehaviours. Could it be that the prefab assets were not updated with the tags?