For a dynamically sized object in Python (a cube resized into a rectangle, dimensions determined at run time), is it just too ambitious to create a script to do the unwrapping of the object? From what I can tell, unwrapping appears to be a very hands on process that might not be amenable to automation.

Just curious before I chase this down the python rabbit hole...

  • $\begingroup$ What would be the purpose of unwrapping? Seamless continuous coordinates or just non-stretched sides with uniform scale? You can just call Smart UV project from python after you've done creating and scaling the cuboid. An axis-aligned cuboid would be about the easiest shape to practice programming UV coordinates if you want to get your hands dirty. $\endgroup$
    – kheetor
    Jul 31 '19 at 17:08
  • $\begingroup$ @kheetor The cube is resized into a very long rectangle, causing serious texture stretching. Unwrapping was prescribed as a solution. The problem is described here: blender.stackexchange.com/questions/146849/… $\endgroup$
    – vndep
    Jul 31 '19 at 17:09
  • $\begingroup$ You should have kept this in your previous thread. The idea of using "Generated" texture coordinates is that you don't need to assign UV coordinates. You can negate stretching by not using generated (which are stretched to object bounds) and rather using something like Geometry -> Position instead for uniformly repeated texture. $\endgroup$
    – kheetor
    Jul 31 '19 at 17:17
  • $\begingroup$ How would I do that in python? My code is here: blender.stackexchange.com/questions/146849/… $\endgroup$
    – vndep
    Jul 31 '19 at 17:25
  • $\begingroup$ If you just switch from 'Generated' to 'Object' you'll get the object coordinates which aren't stretched. (unless you are scaling the mesh in object mode) But you aren't explaining what kind of texturing you are trying to achieve and what your meshes are like which makes giving you accurate advice difficult. $\endgroup$
    – kheetor
    Jul 31 '19 at 17:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.