Code optimization :mel.eval('texGetTexelDensity(%i)' % map_size) is too slow!

Code optimization :mel.eval('texGetTexelDensity(%i)' % map_size) is too slow!

243202504
Enthusiast Enthusiast
365 Views
0 Replies
Message 1 of 1

Code optimization :mel.eval('texGetTexelDensity(%i)' % map_size) is too slow!

243202504
Enthusiast
Enthusiast

 

density = eval('texGetTexelDensity(%i)' % map_size)

This line of code takes too long. Is there any other way? If I get the vertices of the face, the UV ratio and the texture size to calculate the accuracy, or if I don’t need to call mel, but directly use python to speed it up. This Lines of code take up more than 90% of the time consumed by my entire tool. I want to optimize it.

366 Views
0 Replies
Replies (0)