Home Marmoset

setTextureSetHeight variable error when baking multiple materials

Offline / Send Message
Pinned

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

import mset
import os

desktop = os.path.join(os.path.join(os.path.expanduser('~')), 'Desktop') 
mset.importModel(os.path.join(desktop, "temp.fbx"))

baker = mset.BakerObject()
baker.outputPath = os.path.join(desktop, "bake.png")
baker.outputSamples = 4
baker.outputBits = 8
baker.edgePadding = "Custom"
baker.edgePaddingSize = 5.0
baker.outputSoften = 0.0
baker.outputSinglePsd = False

obj_list = [obj for obj in mset.getAllObjects() if isinstance(obj, mset.MeshObject)]
group = baker.addGroup("Bake group")
low_group = group.findInChildren("Low")

for i, obj in enumerate(obj_list):
  obj.parent = low_group

  material = mset.Material()
  material.name = "mat_" + obj.name
  material.assign(obj)

baker.multipleTextureSets = True
print(baker.getTextureSetCount())

for i in range(0, baker.getTextureSetCount()):
  baker.setTextureSetWidth(i, 1024)
  #baker.setTextureSetHeight(i, 1024)	# OverflowError: unsigned byte integer is greater than maximum

Replies

Sign In or Register to comment.