Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Auto Texture Tiling Tool Version 1.82, 2018.3 ready

Discussion in 'Assets and Asset Store' started by Chris_Entropy, Dec 9, 2015.

  1. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    171
    Code (CSharp):
    1.         public void CreateMeshAndUVs() {
    2.  
    3.             if (meshFilter == null) {
    4.                 Debug.LogError(GetType() + ".CreateMeshAndUVs: meshFilter was not set, there is no MeshFilter component attached.");
    5.                 return;
    6.             }
    7.             Debug.Log(meshFilter.name);
    8.  
    9.             if(meshFilter.sharedMesh != null)
    10.             {              
    11.                 if (!meshFilter.sharedMesh.isReadable) {
    12.                     Debug.LogError(GetType() + ".CreateMeshAndUVs: could not edit mesh. Please make sure that 'Read/Write Enabled' is checked in the import settings.");
    13.                     return;
    14.                 }
    15.             }
    16.  
    17.             MeshData meshData = new MeshData();
    18.  
    I had to make the above small change to the CreateMeshAndUVs() routine of AutoTextureTiling.cs for this to work on Unity 2018.3. Just thought I'd share it, without the null check for the sharedmesh you get a null reference exception in a build.
     
    Chris_Entropy, Mark_01 and JBR-games like this.
  2. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Thank you alot! I will include it in a patch this weekend.
     
    Mark_01 and catfink like this.
  3. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I updated the code and had to make quite a few changes for the tool to work with the new way Prefabs work beginning in Unity 2018.1. I tested it to the best of my abilities, and I hope there are no bugs left. Otherwise report it here and I will take care of it. The new Version will be up in the Asset Store soon, after it has gone through their review process.
     
    Mark_01 likes this.
  4. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    The new Version for Unity 2018.3 is up and running. Have fun :)
     
    catfink, Mark_01 and JBR-games like this.
  5. Tubbritt

    Tubbritt

    Joined:
    Nov 30, 2015
    Posts:
    40
    Thanks for the support :)

    James
     
    JBR-games and Chris_Entropy like this.
  6. WsdServers

    WsdServers

    Joined:
    Jan 28, 2017
    Posts:
    15
    Dear Chris, your tool is awesome! One of the most useful assets that I ever purchased. One suggestion only: if possible you could make the textures optionally keep their position in world place too.. like when you move an object to the left the tiles on them remain at the same world position, while the object is moving "under" them... so if you put 2 objects together the edges would always fit...
     
    Chris_Entropy likes this.
  7. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Hi there, thanks for purchasing the ATTT. This feature is on my list for a long time now. Unfortunately I have a lot on my plate and only manage to keep the Tool up to date for the new Unity versions.I will try to make time for that, because this would make the tool infinitely more useful.
     
    WsdServers and Mark_01 like this.
  8. AymericDavid

    AymericDavid

    Joined:
    Oct 4, 2018
    Posts:
    2
    Hey !
    This asset can be very useful for the project I'm on.
    I have two questions :
    -Some parts of code of some assets I bought are going obsolete with Unity 2018. Are you going to keep the code up to date in case something wrong is coming ?
    -I have rotating objects (Can't use worldspacecoordinates for UVs) that get deformed with bones (some parts are deformed, some stay at the same size). Will the UV generated by your code update to stick to the object and never stretch ?
     
  9. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Hi there, thanks for your interest in the Auto Texture Tiling Tool. To answer your questions:
    - I just recently updated the Tool to work with Unity 2018. So far I have not received any bug reports, so it should be fully functional.
    - unfortunately, the tool does not work with skinned meshes. I have tried to make it work, but this is something not really compatible with the way Unity handles skinned meshes. Therefore the feature does not exist and will also not be added in the future.
     
  10. juliocdep

    juliocdep

    Joined:
    Sep 30, 2010
    Posts:
    30
    Hello, I'm getting the following error when I try to build the project:

    error CS1061: 'DynamicTextureTiling' does not contain a definition for 'BreakMeshAssetConnection' and no accessible extension method 'BreakMeshAssetConnection' accepting a first argument of type 'DynamicTextureTiling' could be found (are you missing a using directive or an assembly reference?)

    How can I solve this?
     
  11. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Hi there, thanks for using the ATTT. Which version of the Tool are you using and which version of Unity? There were some updates in the ways Meshes are handled.
     
  12. juliocdep

    juliocdep

    Joined:
    Sep 30, 2010
    Posts:
    30
    I'm using Unity 2018.3.11f1 (64-bit) and the ATTT 1.82. This error happens only when I try to build the project, in the editor it works well.
     
  13. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I just tried to build it for Windows Standalone with Unity Version 2018.3.1. It worked fine. I will try again with 2018.3.11 again and try to reproduce the error. In the meantime: which Platform do you try to build for? And can you provide me with a project, that fails to build? It would help me to pinpoint the problem.
     
  14. juliocdep

    juliocdep

    Joined:
    Sep 30, 2010
    Posts:
    30
    I'm using and target is Win 10 (64-bit). Unfortunately, I can not provide the project.
     
  15. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    One wild guess: did you include the file AutoTextureTiling.cs in your project? It is required for most functionality and also defines the method 'BreakMeshAssetConnection'.
     
  16. juliocdep

    juliocdep

    Joined:
    Sep 30, 2010
    Posts:
    30
    I found the problem, taking a look at the code, the BreakMeshAssetConnection method is in the region under the definition UNITY_EDITOR.
     
  17. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Ok, cool, so it is working now? I checked my own code, and here the only call of BreakMeshAssetConnection is also inside a "UNITY_EDITOR" definition, this is why it compiled on my end.
     
    JBR-games likes this.
  18. juliocdep

    juliocdep

    Joined:
    Sep 30, 2010
    Posts:
    30
    Yes, it's working. Thank you.
     
    JBR-games likes this.
  19. bpswem

    bpswem

    Joined:
    Apr 21, 2020
    Posts:
    3
    Just bought this tool as it looked exactly like what I needed for my parts. However it is not working at all. Instead of changing the UV of the mesh, it's altering the mesh itself turning the object into a cube and ruining the object.
     
  20. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Hey there, thanks for purchasing the tool. Do you have any errors in the console? What Version of Unity are you using? The Auto Texture Tiling Tool works by altering the UVs of the mesh, which requires to alter the mesh data. It should not change the topology of the mesh and keep the triangles and vertices. If this does not suit your needs, you could consider using other solutions, as my tool can't help in this case.
     
  21. bpswem

    bpswem

    Joined:
    Apr 21, 2020
    Posts:
    3
    I am using Unity v2018.4.21f1
    Did not see any errors on the console
     
  22. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Can you send me the project or the model you are trying to tile textures on, so I can try to reproduce the error on my end?
     
    JBR-games likes this.
  23. bpswem

    bpswem

    Joined:
    Apr 21, 2020
    Posts:
    3
    Sure
    Sent you a PM with the location of the files.
     
    Last edited: Apr 24, 2020
  24. siowchenying

    siowchenying

    Joined:
    Oct 27, 2020
    Posts:
    5
    Hi, I am interested in your auto-tilling asset.
    I would like to ask if the UV unwrapping functions can be called during runtime, I am planning to do some 3d painting, but I need a way to UV unwrap the 3D object during runtime. (UV unwrap doesn't have to be perfect, just good enough)
     
  25. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Hi there, thanks for your interest in the tool. There is a DynamicTextureTiling script in the package, which will update the tiling when the object scaling changes. It has been almost a year that I looked into the code, but I am almost certain, that it can't handle it automatically, when the mesh changes. But you can look at the code and call the method, that is called in the Update() function to achieve what you want (all source code is provided). It should work.
     
    siowchenying likes this.
  26. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,529
    Hi I am having problems with this. "Facedependent" says no face data. "Cube projection" and tweaking all the options doesnt seem to do anything at all to my materials visually.

    I also see this error even tho read/write is checked:
    AutoTiling.AutoTextureTiling.CreateMeshAndUVs: could not edit mesh. Please make sure that 'Read/Write Enabled' is checked in the import settings.
    UnityEngine.Debug:LogError(Object)
    AutoTiling.AutoTextureTiling:CreateMeshAndUVs() (at Assets/AutoTextureTilingTool/Scripts/AutoTiling/AutoTextureTiling.cs:976)
    AutoTiling.AutoTextureTiling:Awake() (at Assets/AutoTextureTilingTool/Scripts/AutoTiling/AutoTextureTiling.cs:623)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  27. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Which version of Unity are you using? Is the mesh maybe static or a skinned mesh? Anything out of the ordinary?
     
  28. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,529
    2019.4.18f yes its static in the editor, not skinned, to be honest this mesh has been causing trouble for years, thats why I thought maybe your tool could fix it. Materials need to be tiled to 0.00001 and they are lost in a build. It was made in sketchup.
     
  29. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Can you send me the mesh? Maybe I can find out, what's causing the problem, but I can't promise anything. My Tool is only for tiling, it unfortunately can't do magic ;-)
     
  30. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    69
    Hello, I'm creating a game where people build vehicles by putting together blocks, and I am thinking of buying your asset for it.

    My problem at the moment is that when the blocks are put together there are obvious seams between them, and there is tiling across the whole vehicle. I would like the surface material to be spread across the whole vehicle (spread across multiple blocks), so it looks like a real truck or car.

    The blocks come in different shapes and sizes, which complicates things. Would your Auto Texture Tiling Tool asset be able to achieve the effect I am looking for?

    I am creating the blocks in Blender, and texturing them in Substance Painter.

    Thank you for your advice.
     
  31. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    Hi there, I really like the game idea. Unfortunately I am not sure if I understand you correctly. Do you want a texture to tile over the entire vehicle? In this case, you could combine the mesh of all blocks into a single one and then apply my Tool to tile the texture. I always wanted to add a "global" tiling option, but never had the time to implement it. But if you would place your blocks by moving the vertices and leaving the object's point of origin of all blocks at the same point, you should have a tiling relative to the common point of origin. So it could work, but not out of the box.
     
  32. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    69
    Hi - thank you for your reply.

    I'm sorry - I didn't explain myself well there. I would like a uniform texture to cover the entire vehicle once the player has built it from the blocks. For example, the way a tank's armour looks like it was moulded from one large piece of metal. Would your asset be able to help?

    Here is a bit more about the game. The player will be able to select blocks of different shapes and sizes (e.g. corner blocks, flat blocks) from a menu, and combine them together to make the shell of a vehicle, such as a tank. I'm not sure if I've gone about this the right way, but each individual block has a material to make it look like a painted metal.

    The way the tank is built is by adding each block as a child of the main vehicle game object (which is the first tank component to be placed - in this case the tank tracks), so there is a common point of origin. So the tank ends up with about 20-30 blocks as children game objects. At the moment, each of these blocks has its own material, and as a result the blocks produce a tiling effect, as the pattern on each block's material does not match up with its neighbours.

    What I would like is for the whole tank to not have this tiling, so that it would seem to be made out of one piece of painted metal. I am looking for a way of either making each block's materials match up so the tiling disappears, or have one material that just covers all of the tanks blocks, so it looks like the tank is made out of one piece.

    I have not investigated combining all the block's into one mesh yet, as I'm still in the process of getting the main game mechanics working, but it is something I am keen on doing. The reason I have put if off is that I have not decided if this mesh combining should be done every time a new block is added, or if it should wait until the player has added all the blocks and is ready to start using the vehicle.
     
  33. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    I fear that my asset is meant to do the exact opposite. With the Auto Texture Tiling Tool you can repeat the same texture over a large object without stretching it. So if you have a brick wall texture, you can apply it to a block of any size, and it will automatically repeat, even if the block is scaled. What you want is to apply a texture over several separate block objects, so it fits the entire object as a whole, if I understand it correctly.
     
  34. DromoDesigner

    DromoDesigner

    Joined:
    Mar 27, 2016
    Posts:
    69
    Yes - I do indeed wish to apply a texture over several block objects, so unfortunately it looks like the asset will not work in this case.

    Thank you very much for taking the time to explain things. It is a shame I cannot use your asset, as it has got lots of great reviews.

    Have a good day.
     
    Mark_01 and Chris_Entropy like this.
  35. sanalphatau

    sanalphatau

    Joined:
    Jan 17, 2022
    Posts:
    1
    will this work with a script defined texture. As in I have a script attached to the object that on runtime creates a randomised texture (pixel by pixel) and sets it to the object that need to be tiled. Can this tool work with that set up?
     
  36. Chris_Entropy

    Chris_Entropy

    Joined:
    Apr 11, 2011
    Posts:
    202
    As long as this setup uses a regular material, this should be no problem. The ATTT changes the UV mapping of the mesh, so anything using a material should be properly tiled.