Votes
0
Product:
iClone 7
Version:
7.71
Status:
Assigned
Issue 6638
GetUvData always returns 0.0 for rotation instead of the correct value
Hi,
When I call the method:

material_component = avatar.GetMaterialComponent()
material_component.GetUvData(mesh_name, material_name, texture_channel, uv_offset, uv_tile, uv_rotate)

uv_rotate always returns 0.0. I am able to set the rotation value with the method: AddUvDataKey successfully though.

I would also like to point out that your API documentation for the method:AddUvDataKey on your site is wrong.

On https://manual.reallusion.com/iclone/script/python/class_r_l_py_1_1_r_i_material_component.html it reads:
...
material_component.AddUvDataKey(RLPy.RGlobal.GetTime(), mesh_name, material_name, texture_channel, uv_offset, uv_tile, uv_rotate)
...
def RLPy.RIMaterialComponent.AddUvDataKey ( self,
kTime,
strMeshName,
strMaterialName,
eChannel,
kUvOffset,
kUvTile,
fUvRotate
)
...

But in fact the first parameter to this method is: kKey [IN] The key for time and transition control - RLPy.RKey
This is correct on the Wiki though: http://wiki.reallusion.com/IC_Python_API:RLPy_RIMaterialComponent


Cheers,
Martin
OS: Windows 10
  •  2
  •  682
Submitted byelMartino
1
COMMENTS (2)
elMartino
Hi Allen,

I've tested this successfully but it does not align with the documentation:
...
kUvOffset [OUT] uv offset - RLPy.RVector2f
kUvTile [OUT] uv tile - RLPy.RVector2f
fUvRotate [OUT] uv rotate - float

Return Values
RLPy.RStatus.Success Success.
RLPy.RStatus.Failure Fail.

Is that going to change in future or stay like that? Is the out parameter uv_rotate used for something?

Thanks for your help.

Cheers,
Martin
AllenLee (RL)
Hi Martin,

About GetAVData API how to get uvrotate, you need to get from the value returned.

As below code:

return_values = material_component.GetUvData(mesh_name, material_name, texture_channel, uv_offset, uv_tile, uv_rotate)
uv_rotate = return_values [1] # this is the uv rotate value returned


And thank you for pointing out that the AddUvDataKey function description in our API documentation is wrong.

Allen
1