0
$\begingroup$

Following this question:

How can I transfer UVs from a source to a target using Animation Nodes?

I've tried to reproduce the solution with no success. In my case I'm creating a bunch of empty instances, at the same time I deform a mesh from an object with UVs. My intention is to use the deformed mesh into the new empty instances, which I manage, but Uvmap is not transfered even if I have the load uvs cheked.

Here is how it looks now

GRAPH

How can a copy the uv map?

$\endgroup$
1
$\begingroup$

You loaded UVs to a mesh and then you created a new mesh based on the vertices, edges, and polygons of the source mesh and forgot about the UV Maps. Currently, Animation Nodes doesn't provide access to UV data through nodes, so you will have to use some python expressions.

You can get a list of UV Maps in a mesh using the getUVMaps() method, each element in the output list is a tuple of two elements, the name of the map and a 2D vector list representing the locations of the UVs. To set a UV to a mesh you can use the insertUVMap(name, uvs) method, which takes the name of the map and a 2D vector list.

So, in conclusion, to transfer the UV maps from some mesh sourceMesh to another mesh targetMesh, we can use the following expression:

([targetMesh.insertUVMap(*map) for map in sourceMesh.getUVMaps()], targetMesh)[1]
| improve this answer | |
$\endgroup$
  • $\begingroup$ beautiful expression, Is the same problem with materials? $\endgroup$ – Juan Manuel Lynch Feb 7 '19 at 16:03
  • $\begingroup$ @JuanManuelLynch No. A new material system was just added. So the most recent version should include this new system. Let me know if you need an explanation for that. $\endgroup$ – Omar Emara Feb 7 '19 at 16:27
  • $\begingroup$ I'm using AN 2.1 still on 2.79, is this new material system only working in 2.8? $\endgroup$ – Juan Manuel Lynch Feb 7 '19 at 16:30
  • $\begingroup$ @JuanManuelLynch Yes, only 2.8. 2.7x versions will no longer be updated. $\endgroup$ – Omar Emara Feb 7 '19 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.