I have added an optional named "index" argument for methode get/setUV, I have also modified the and set to deprecated methodes setUV2 and getUV2 : the doc was wrong and the methode can't be called anyway because it declared as VARARG in the .h and convert directly the args value to a vector in the .cpp.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- ge_multi_uv_channel
Event Timeline
| source/gameengine/Converter/BL_BlenderDataConversion.cpp | ||
|---|---|---|
| 518 ↗ | (On Diff #3982) | Why you removed the UV check? |
| source/gameengine/Converter/BL_BlenderDataConversion.cpp | ||
|---|---|---|
| 518 ↗ | (On Diff #3982) | Without this we can convert other UV layer, and methode getUV(index) with an index of an unused UV don't return always (0.0, 0.0, 0.0). I think that is just an optimization. |
As you mentioned get/setUV() will using the wrong UV map if a material using multiple textures and one of the textures are disabled. But this bug was also before. If you want to fix that you should do this in a separate patch.
SetUV2() was broken since blender 2.66a, In my opinion we can remove it, because we only can break compatibility to older files then blender 2.66. If the others are against removing the old API, you need to return a deprecated message and change the documentation too.
| source/gameengine/Converter/BL_BlenderDataConversion.cpp | ||
|---|---|---|
| 518 ↗ | (On Diff #3982) | No the cheek is necessary. If you disable a texture in between or set the texture to an other type as UV, then the previous UV map will be used. I have tested getUV(index) and setUV(uv, index) and it is working. So this change is not necessary to get it working. |
| source/gameengine/Ketsji/KX_VertexProxy.cpp | ||
|---|---|---|
| 426 | It's a redundant call see line 435, and it will say that if the list is wrong a part of it is apply, i think that is a wrong behaviour. | |
| source/gameengine/Ketsji/KX_VertexProxy.cpp | ||
|---|---|---|
| 426 | Looks good, didn't see other code block. | |
| source/gameengine/Ketsji/KX_VertexProxy.cpp | ||
|---|---|---|
| 426 | it is repeated at line 435 (out of the for loop) | |
Why were neither @Campbell Barton (campbellbarton) nor myself added as reviewers to this patch? KX_VertexProxy.get/setUV(2) were supposed to be deprecated. I had talked with @Porteries Tristan (panzergame) about this previously on IRC, and I would much rather see issues with KX_VertexProxy.uvs fixed (as opposed to bringing back deprecated features).
It was our mistake. I will go over all BGE open differentials to add you/campbell where you may become necessary.
- Try to implement CListPython for member variable "uvs".
- temporary fix for python double free
- Support uv assignement for uvs list.
- Add GetReplicate function to use python generator.
- Create the pŷthon generator owned by python, not BGE.
- Leave function GetUV1/2 but just set callable SetUV2.
- Update doc.
- Set dprecated message and warning.
Because CListValue use CValue type for elemtents and we will spend to much time to convert a MT_Point2 in a CValue type.