About getArea method on some strange models.
obj = $ setCommandPanelTaskMode mode:#modify addmodifier obj (unwrap_UVW()) obj.modifiers[#unwrap_uvw].unwrap.setmapchannel 2 dialogMonitorOps.interactive = false obj.modifiers[#unwrap_uvw].unwrap.reset() a = polyop.getnumfaces obj obj.modifiers[#unwrap_uvw].unwrap4.getArea #{1..a} &myValX &myValY &myValWidth &myValHeight &myValAreaUVW &myFaceArea print yValAreaUVW areaUVWPercent = myValAreaUVW * 100 print areaUVWPercent deletemodifier obj obj.modifiers[#unwrap_uvw] dialogMonitorOps.enabled = false
I use this code chunk to calculate UVW occupy ratio of a model's second UVW channel in comparison with [0,0][1,1] UVW coordinate area.On most models the result is correct,which is,if the UVW is well unwrapped,this percentage number will below 100,and above 0 of course.But for some models,whose second UVW channel's UVW map looks just fine even though,the result is weirdly far above 100,as does this model attached in the zip file.Once I use 3ds Max's embedded mapping tool or 3 third party unfold tool like unfold3D to reunwrap its UVW in the second channel,the result will become correct.Please someone who is familiar with the getArea method as well as UVW stuffs profile this model for me and tell me why does this happen.Thanks a lot!
tips:To make this code chunk work,you need to select the object first.
Attachment | Size |
---|---|
getarea.zip | 23.36 KB |
Comments
Issue solved.Reason
Issue solved.Reason found.Thanks.
Would be nice to know why and
Would be nice to know why and how you solved it :)