[Plugin request] Default texture mapping tile size
-
Greetings. I deeply apologize if I'm posting in the wrong section of the forum. )
I have a question on Ruby/plugin possibilites: with them, is it possible to somehow override the default tile size of SketchUp materials?
While it may seem irrelevant for non-textured materials (there are no features to scale anyway, just a solid fill, right?), it acutally is. Too small default SketchUp tile size is a major problem, because it makes all non-textured material mapping practically worthless for any engine application. Here is the example how the default "empty" SketchUp material looks like ("Replace Me" is just a placeholder indicating that there is no material assigned, nevermind):
And here is how it should look like:
In many 3d file formats, materials with just a diffuse color do not exist: any solid fill is in fact still some simple grayscale texture which color is shifted later with material preferences. So the problem applies even to seemingly good-loooking models.
Too small default scale leads to some artifacts, slight performance drop (because we have hundreds of texture tiles on screen instead of one), and more complicated workflow for geometry prototyping goals, for example, you can't just assign a material to have a quick glimpse of the scene in a different look, - because it's mapped incorrectly small:
Okay, sorry for these long explanations and examples, my question is in fact very simple. Is it possible to override the default size and change it, for example, to 1,00m?
At the moment the only workaround to fix the issue is to never use non-textured materials, instead utilizing materials with placeholder textures and manually corrected size. That is time-consuming and not so simple. ))
Thanks in advance for any answers. )
-
The API code does allow you to change the two values of the texture size - in just the same as you can do manually - the default size is 10" (254mm).
I don't see how you can do it 'on the fly' as you make materials [you could simply adjust the size anyway - as you ought], but it'd be quite possible to write some code to change all textured materials to a different fixed size, and also use a default texture image on any untextured materials, also to that fixed size too. It'd then run the exporter, so that the external file matches these settings; on completion it could then do an 'abort_operation' to revert all of the materials as they were, leaving the external export-file unaffected. Alternatively it could change all of the texture sizes permanently and just use the temp-texture for non-textured materials for the export part, reverting those materials to be 'plain' afterwards...
If you manually ad a texture, resize it then remove the texture does the 'plain' material export with different mapping info ? e.g. it's previous texture size is remembered ? I've not tested this, if it does then you could temporarily add a texture to each untextured material, resize it and then remove the texture ? -
Correct me if I'm wrong. For me, I use Fredo6 ThruPaint plug in in applying texture then while the tool is still active I click again the applied texture to edit, texture transformation box will appear and I will just click the 1x1 at the right side of tiling. That's the only way I know to fit the texture. Hope it helps.
-
@tig said:
The API code does allow you to change the two values of the texture size - in just the same as you can do manually - the default size is 10" (254mm).
I don't see how you can do it 'on the fly' as you make materials [you could simply adjust the size anyway - as you ought], but it'd be quite possible to write some code to change all textured materials to a different fixed size, and also use a default texture image on any untextured materials, also to that fixed size too. It'd then run the exporter, so that the external file matches these settings; on completion it could then do an 'abort_operation' to revert all of the materials as they were, leaving the external export-file unaffected. Alternatively it could change all of the texture sizes permanently and just use the temp-texture for non-textured materials for the export part, reverting those materials to be 'plain' afterwards...
If you manually ad a texture, resize it then remove the texture does the 'plain' material export with different mapping info ? e.g. it's previous texture size is remembered ? I've not tested this, if it does then you could temporarily add a texture to each untextured material, resize it and then remove the texture ?Hi there TIG!
This thread is kind of old, but I would still be neat to know if it's possible to change the default tile size, so thanks for answering there. More precisely: I don't need to change any preexisting materials "on the fly" and I don't need to change the sizes for materials with textures. What would be handy is changing the default UV tile size in material properties, globally, for every material SketchUp is creating.
That would be a very useful safeguard feature for newbies not yet fully utilizing materials (no matter if they won't use placeholder materials and size values, their models will have reasonable UV sizes and will look decent with various in-engine materials). Or a neat help, for example, for level designers quickly prototyping geometry under strict deadlines: they will be able to slap several material types to separate a scene as needed, then replace these fills with suitable materials (like various concrete types) in the engine afterwards. All and all, having 10x10cm as default UV tile size is impractical.
The idea of assigning a placeholder texture to every untextured material, changing then available size values and disabling the texture after that sounds practical. Unfortunately, if I remember correctly, removing a texture removes tile size values from a material too, so these changes will be immediately lost.
Advertisement