<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
Yep, this way you’ll only get org data, before any modifier is
applied… Since cloth's pointcache data do not seem to be available
from Python, the only thing you can do to get cloth cos of vertices
is to applies all modifiers, like this e.g.:<br>
<br>
# Generate temp mesh from object, with modifiers applied.<br>
tmp_me = <tt class="descname">obj.to_mesh</tt><big>(</big><em>scene</em>,
True, '<em>RENDER</em><em></em>')<br>
<br>
# Use data from tmp_me...<br>
<br>
# And then free it!<br>
<span class="n">bpy</span><span class="o">.</span><span
class="n">data</span><span class="o">.</span><span class="n">meshes</span><span
class="o">.</span><span class="n">remove</span><span class="p">(tmp_me</span><span
class="p">)</span><br>
<br>
<br>
<div class="moz-cite-prefix">On 14/03/2014 13:49, fmart wrote:<br>
</div>
<blockquote cite="mid:4b2afde615da0af6e9a6517ec8f5ec7d@iri.upc.edu"
type="cite">
<pre wrap="">Hello,
I'm trying to obtain all vertices global position of a piece of cloth
after colliding with a table. My simulation starts with a plane as a
piece of cloth and another plane below as a table with the Collision
modifier.
To obtain all the data I need I'm using the following code (I've the
cloth selected):
import bpy
current_obj = bpy.context.active_object
print("="*40) # printing marker
for face in current_obj.data.polygons:
verts_in_face = face.vertices[:]
print("face index", face.index)
print("normal", face.normal)
for vert in verts_in_face:
local_point = current_obj.data.vertices[vert].co
world_point = current_obj.matrix_world * local_point
print("vert", vert, " vert co", world_point)
The simulation works well, I think the code also works well. However,
all that I obtain are vertices global position of the cloth in the
initial position, it doesn't matter whenever I pause the simulation.
Is there any possibility to obtain cloth vertices position after a
collision?
Thanks!
Felip
_______________________________________________
Bf-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bf-python@blender.org">Bf-python@blender.org</a>
<a class="moz-txt-link-freetext" href="http://lists.blender.org/mailman/listinfo/bf-python">http://lists.blender.org/mailman/listinfo/bf-python</a>
</pre>
</blockquote>
<br>
</body>
</html>