Home Marmoset

Error set texture height when baking multiple Texture Sets

Offline / Send Message
Pinned

Hello, please tell me why I can not set the height of the texture, but only the width?


  1. import mset
  2. import os
  3.  
  4. desktop = os.path.join(os.path.join(os.path.expanduser('~')), 'Desktop') 
  5. mset.importModel(os.path.join(desktop, "temp.fbx"))
  6.  
  7. baker = mset.BakerObject()
  8. baker.outputPath = os.path.join(desktop, "bake.png")
  9. baker.outputSamples = 4
  10. baker.outputBits = 8
  11. baker.edgePadding = "Custom"
  12. baker.edgePaddingSize = 5.0
  13. baker.outputSoften = 0.0
  14. baker.outputSinglePsd = False
  15.  
  16. obj_list = [obj for obj in mset.getAllObjects() if isinstance(obj, mset.MeshObject)]
  17. group = baker.addGroup("Bake group")
  18. low_group = group.findInChildren("Low")
  19.  
  20. for i, obj in enumerate(obj_list):
  21.   obj.parent = low_group
  22.  
  23.   material = mset.Material()
  24.   material.name = "mat_" + obj.name
  25.   material.assign(obj)
  26.  
  27. baker.multipleTextureSets = True
  28. print(baker.getTextureSetCount())
  29.  
  30. for i in range(0, baker.getTextureSetCount()):
  31.   baker.setTextureSetWidth(i, 1024)
  32.   #baker.setTextureSetHeight(i, 1024) # OverflowError: unsigned byte integer is greater than maximum
Sign In or Register to comment.