ScriptSpot

Forum topic · General Scripting

Calculating UV-Area

By DaDiceman · 2009-04-27

Description

I try to calculate the scaling of a uv-map. My first step is to calculate the area of the geometry and the uv-map. I used the following code for trying.

refObj = $

refFaceArea3d = polyOp.getFaceArea refObj 2

refx = 0.0                                                                                                     
refy = 0.0                                                                                                     
refwidth = 0.0                                                                                                 
refheight = 0.0                                                                                                
refFaceAreaUVW = 0.0                                                                                           
refFaceAreaGeom = 0.0                                                                                          
                                                                                                            
faces = #{2}                                                                                                   
                                                                                                               
refObj.modifiers["Unwrap_UVW"].getArea faces &refx &refy &refwidth &refheight &refFaceAreaUVW &refFaceAreaGeom

print refFaceArea3d
print refFaceAreaGeom

I think normaly the output for "refFaceArea3d" and "refFaceAreaGeom" should be the same, shouldn't it? But it isn't so. Where I'm thinking wrong? Can somebody help me? Thank you!