No announcement yet.

Exporting specific cutout parts from textures

  • Filter
  • Time
  • Show
Clear All
new posts

  • Exporting specific cutout parts from textures

    Hey there,

    I've been trying to export specific the cutout parts from a big texture with several branches and getting it atlassed into a specific atlas.

    So far I've encountered a couple of questions/problems that I was hoping to get cleared.

    So for example purposes:
    - I have a texture that has 20 small branches and is being used in a single material that has generated cutout meshes 1,2,3,4, and their place in the texture I'm using are far apart from each others totaling a total of 4 different "branches" for me to use in leaf nodes. Bush_1.spm is using 1 and 3 in leaf nodes and when I export the model one of two things happens: If I have Unwrap set to Share, I will get a huge chunk of the texture with unnecessary branches taking up space in the final atlas OR if I have Unwrap set to Separate I will get ONLY the cutouts that I'm using for this model (so only 1 and 3 branches appear on the texture that was exported). Is there a way for me to export a texture where I get all the 4 cutouts into a single texture, even though I'm only using 2 of them?

    The reason I want this ties into my next scenario.
    So now imagining that I have Bush_1.spm that is using the cutouts 1 and 3 and Bush_2.spm that is using cutouts 2 and 4. They are both using the same material as mentioned above, with Unwrap set to Separate. Now if I want to export them both in the same atlas, using the option for that when they are both open at the same time, I will get the entire texture exported instead of the expected texture with cutouts 1, 2,3 and 4.

    Is there something I'm missing?


  • #2
    > Now if I want to export them both in the same atlas, using the option for that when they are both open at the same time, I will get the entire texture exported instead of the expected texture with cutouts 1, 2,3 and 4.

    Just to be clear, if you export them in the same atlas, you are not just getting the 4 cutouts? They are acting like they're set to shared?


    • #3
      I think they're not even acting as if they're shared, it's simply exporting the entire source. I can send you the outputs to illustrate whats happening if you would like.


      • #4
        Which app and version of the Modeler are you using?


        • #5
          At the moment I'm using Speedtree Modeler v8.2.1 (Games Edition) (Trial)


          • #6
            You sent me down a path that led to finding a bug, so thanks.

            It seems that if you export combined trees with the same mesh ids, they would get merged as if they were sharing uv space. Mesh ids are an internal identifier, there is unfortunately no way to edit those through the interface. Similar ids can often happen when you copy a tree to make a variation of it, as I'm guessing you did. Your meshes might have just been covering enough of the texture to look like it was all of it.

            I fixed it and the resulting atlases seem to be working correctly now (and much better). We'll have this fix out in the next version (which will either be 8.3.1 or 8.4). The current version (8.3.0) actually has some other bugs when exporting trees combined, so I would suggest to stick with the version you are on until the next one.


            • #7
              You're welcome
              Hm... I see. Well I was actually planning on using the 8.3 when for the actual pipeline because the patch notes said the wrong ID bug in the XML and we could use those, but guess I'll have to ponder the pros and cons again then. Any ETA on the 8.3.1?

              Yes, since it's the second bush is a variation of the first, I just duplicated the .spm and made the changes. So if I create a new .spm and configure everything into the new .spm It should work? Or is there a way to "cheat" the system into generating a new ID for the mesh?


              • #8
                It's hard to say. If you duplicate the mesh assets a few times in the tree copy and then delete the original mesh assets, you'll probably get to a place where that tree's meshes all have different ids.

                (but if you have lots of meshes, this could get tedious real quick)


                • #9
                  Hm... I just completely deleted all the nodes I had in both bushes and made new leaf mesh nodes for each and assigned the material I had while making sure they did not share the cutouts, but I'm still getting the entire texture exported


                  • #10
                    Update: So I managed to finally get what I wanted, but I had to change the leaf nodes names, and the source texture needed to be different o.O . If any of those remain the same, the texture will not export correctly.
                    Last edited by Pedro Geada; 01-29-2019, 12:54 PM.


                    • #11
                      Not the nodes/generators. I was referring to the mesh assets, in the mesh asset bar. Duplicate those and then delete the originals.

                      The node names are not used anywhere. It was the material changes you did that caused those materials to not be merged anymore (and thus the mesh id didn't even come into play). So yes, that is a possibility for a workaround as well.


                      • #12
                        Hm... I see!
                        This time I tried to do what you suggested and duplicated all the meshes. It still exported the entire source texture.
                        Then I also duplicated the material and assigned the new copy to one of the bushes and this time, it actually exported the cutouts, but since some of the cutouts where using common texture pieces between them, the resulting texture still had redundant,
                        After that I spammed ctrl+z and until I had the same stuff on both bushes again, exported and got the perfect result this time xD