Accessing primitive object geometry [SOLVED]
-
On 12/05/2015 at 02:00, xxxxxxxx wrote:
Thanks for your reply Casimir,
I am not completely sure it is impossible, if you take a look at the X-particles plugin, you can make an emitter that collides with a primitive cube with a collider tag on it, and the cube is not even editable. The only way to simulate this correctly is having access to the object geometry inside X-particles... somehow X-particles is doing it.
cheers.
-
On 12/05/2015 at 02:14, xxxxxxxx wrote:
I do this inside my plugin and it works fine. Although my plugin is an ObjectData plugin with the OBJECT_MODIFIER flag..
What i do is just cast the object as a polygonal object and go from there..
So you can use:
ToPoly(op)->GetPolygonR();
or:
static_cast<PolygonObject*>(op)->GetPolygonR();
Something like that..
-
On 12/05/2015 at 02:17, xxxxxxxx wrote:
Hi Enrique,
You can get the geometry information for a primitive object with BaseObject::GetCache().
Check the type of the returned object and cast it to the appropriate type i.e. PolygonObject in most cases. -
On 12/05/2015 at 02:30, xxxxxxxx wrote:
Hi,
Well, I guess I was wrong, sorry for my bad information!
I didn't think of casting itGreetings,
Casimir Smets -
On 12/05/2015 at 02:41, xxxxxxxx wrote:
Hi Casimir,
Originally posted by xxxxxxxx
I didn't think of casting it
Casting the primitive object, does not work. Casting the cache object returned by GetCache() does work.
-
On 12/05/2015 at 02:58, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Hi Casimir,
Originally posted by xxxxxxxx
I didn't think of casting it
Casting the primitive object, does not work. Casting the cache object returned by GetCache() does work.
Am i missing something? As i said in my post above it works fine for me without using the Cache at all.. But again, that is with an ObjectData OBJECT_MODIFIER plugin..
-
On 12/05/2015 at 03:14, xxxxxxxx wrote:
Is it an FFD deformer object? You can cast any object to a PointObject if it has a Tpoint Tag on it. Same goes for a PolygonObject if it has a Tpolygon tag on it (and a Tpoint tag).
-
On 12/05/2015 at 04:32, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Hi Enrique,
You can get the geometry information for a primitive object with BaseObject::GetCache().
Check the type of the returned object and cast it to the appropriate type i.e. PolygonObject in most cases.Thank you very much Yannick, you are absolutely right. It works!
However, now that we talk about deformers, if I have the very same cube deformed, the geometry I get with those methods is the original geometry, not the deformed one. do you know how to get the modified one? -
On 12/05/2015 at 04:42, xxxxxxxx wrote:
From GetCache(), scroll down just a little bit and you will find it
-
On 12/05/2015 at 07:12, xxxxxxxx wrote:
Originally posted by xxxxxxxx
From GetCache(), scroll down just a little bit and you will find it
Thanks Niklas, I forgot to mention that I was already using that . I don't know what the problem was at first that it didn't work, but now it is working.
Everything is correctly imported now