On 25-Jul-05, at 2:52 AM, Lo Saeteurn wrote:
The GetData call will create a copy inside Quesa of all the vertex
data inside the trimesh (points, triangles, uvs, etc.). It doesn't
copy the attribute set or textures however - it only grabs a
reference to that stuff. So "t2" will be a copy of "t", with it's
own points, triangles, uvs, (etc.), but it will share the same
attribute set and texture shader.
If I simply clone the Object3D and change only the Point reference
to point to another memoryblock (ptr), would that work? When I did
this, it crashes when the memoryblock goes out of scope via RB's
garbage collector. I solved this by storing it locally, but the
Points in the Trimesh seems to still be shared across multiple
objects. I think the problem is that the Trimeshes were the same
for all objects so changing the reference of the Points affected all.
Object3D.Clone creates new (internal) display groups and adds
references to each shape from the original object. So basically
there's still only 1 trimesh, but it's got an extra reference for
each clone (Quesa objects are reference counted just like RB's).
Replacing certain pointers with local memoryblocks may be a good idea
anyway, since you can animate directly on your memoryblocks without
digging through the trimeshes every time. You might want to take that
approach further though, and build the trimeshes from scratch - that
way you'll have total control over which memoryblocks are shared and
which are unique.
I can't seem to even duplicate the Shape data correctly. The
trimeshes comes out as a mess when rendered. I know I'm doing
something wrong, but I don't know what. Even appending the existing
Trimesh3D object (not the duplicate one) does the same thing so I
must be using the display group incorrectly.
That's odd - the display group looks correct in your code, and I
can't imagine how it could be responsible for something like that.
There's likely a problem somewhere else, and it could just as easily
be a bug in the Quesa Wrappers.
Frank.
–––––––––––––––––––––––––––––––––
Open Source RB Goodies and Shareware
<http://developer.chaoticbox.com/>
<http://www.chaoticbox.com/>
–––––––––––––––––––––––––––––––––
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|