On 06/10/2016 at 16:15, xxxxxxxx wrote:
Hi Andreas,
I used your example, I can now fill all the needed arguments successfully, but even if the CallUVCommand is correctly executed there is no visible result in the UV set.
Do you obtain some result using it ? (I also directly tried the UVCOMMAND_TRANSFORM from the example, and no result neither... )
\> def main() :
\>
\> op = doc.GetActiveObject()
\>
\> handle = bodypaint.GetActiveUVSet(doc, c4d.GETACTIVEUVSET_ALL)
\> if not handle:
\> print "No active UVSet!"
\> return
\>
\> # Prints UVSet information
\> print "UV handle data:"
\> print "handle:", handle
\> print "handle Mode:", handle.GetMode()
\> print "handle Points:", handle.GetPoints()
\> print "handle Polygons:", handle.GetPolys()
\> print "handle Polygon selection:", handle.GetPolySel()
\> print "handle hidden Polygons:", handle.GetPolyHid()
\> print "handle Point selection:", handle.GetUVPointSel()
\> print "handle Point count:", handle.GetPointCount()
\> print "handle Polygon count:", handle.GetPolyCount()
\> print "handle Object:", handle.GetBaseObject()
\> print "handle Editable:", handle.IsEditable()
\> uvw = handle.GetUVW()
\> print "handle UVW:", uvw
\> print "handle set UVW:", handle.SetUVW(uvw)
\> print "handle set UVW (from texture view) :", handle.SetUVWFromTextureView(uvw, True, True, True)
\>
\>
\> # Builds UVCOMMAND_TRANSFORM container for the command settings
\> settings = c4d.BaseContainer()
\> settings[c4d.OPTIMALMAPPING_PRESERVEORIENTATION] = 1
\> settings[c4d.OPTIMALMAPPING_STRETCHTOFIT] = 0
\> settings[c4d.OPTIMALMAPPING_SPACING] = 0.02
\> settings[c4d.OPTIMALMAPPING_AREAFAK] = 0
\> settings[c4d.OPTIMALMAPPING_TWOD] = 0
\> settings[c4d.OPTIMALMAPPING_PROGRESSBAR] = 0
\> settings[c4d.OPTIMALMAPPING_RELAXCOUNT] = 0
\> # Calls UVCOMMAND_TRANSFORM
\>
\> ret =bodypaint.CallUVCommand(handle.GetPoints(), handle.GetPointCount(), handle.GetPolys(), handle.GetPolyCount(),handle.GetUVW(), handle.GetPolySel(), handle.GetUVPointSel(), op,handle.GetMode(), c4d.UVCOMMAND_OPTIMALCUBICMAPPING, settings)
\> if not ret:
\> print "CallUVCommand() failed!"
\> return
\>
\> # Tries to set UVW from Texture View
\> print "CallUVCommand() successfully called"
\> if handle.SetUVWFromTextureView(handle.GetUVW(), True, True, True) :
\> print "UVW from Texture View successfully set"
\> else:
\> print "UVW from Texture View failed to be set!"
\>
\> # Releases active UVSet
\> bodypaint.FreeActiveUVSet(handle)
\>
\>
\>
\> if __name__=='__main__':
\> main()
\>
>
> Any hint ?
>
>