TempUVHandle always None! Why?
-
Hi,
I am not able to get the TempUVHandle from an active UVWTag in R21.
It returns always "None".
In the following script I created a simple plane in a TempDoc and took the cache and inserted it into the TempDoc. It already has a UVW-Tag, then I have set the object active and so the UVWTag....My Code:
import c4d def main(): temp = c4d.documents.BaseDocument() plane = c4d.BaseObject(c4d.Oplane) temp.InsertObject(plane) temp.ExecutePasses(bt=None, animation=False, expressions=False, caches=True, flags=c4d.BUILDFLAGS_NONE) plane_cache = plane.GetCache().GetClone() if plane_cache is None: raise Exception("no cache") temp.InsertObject(plane_cache) uvw_tag = plane_cache.GetTag(c4d.Tuvw) temp.SetActiveTag(uvw_tag) temp.SetActiveObject(plane_cache) handle = c4d.modules.bodypaint.GetActiveUVSet(temp, c4d.GETACTIVEUVSET_UVWS) print(handle) # Execute main() if __name__=='__main__': main()
-
Hi @ThomasB,
Please note that R21 is generally out of scope of full support on this forum. I've tried your code with the oldest C4D version I have (which is R25) and I cannot reproduce your issue.
However, looking in your code it seems like you might need an additional handling for the case when the texture view is not open, please have a look at the comment in our example: call_uv_command_r18.py .
You can also find some useful information on a similar thread, where Ferdinand gave some insights about GetActiveUVSet function: GetActiveUVSet() returns None if multiple UVs are active?.
Cheers,
Ilia -
@i_mazlov
Thank you very much for the hint with the texture view and for the helpful links.
The second thread I have already read, but was not able to find the solution so far. I study these examples. Thank you.