THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/09/2010 at 04:45, xxxxxxxx wrote:
Cinema 4D Version: 12
Language(s) : C++ ;
I can't figure out how to alloc a FFD object. It could successfully be created by BaseObject::Alloc(Offd), but C4D crashes afterwards. I assume, that the point array also has to be created, but I can't find any appropriate allocation function like e.g. PolygonObject::Alloc(points, surfaces).
On 26/09/2010 at 07:52, xxxxxxxx wrote:
Are you sending ffdOp->Message(MSG_MENUPREPARE); after inserting the ffd into the document? It may be that the ffd allocates it's own default points array after receiving that message.
On 26/09/2010 at 08:21, xxxxxxxx wrote:
good idea, but no effect. I tried to get the point count just after creating the object and it's 27 corresponding to the default subdivions of 3 when you create it in C4D, so the basic allocation seems to be done at creation time.
I also tried to set the new point count using ToPoint(op)->ResizeObject(pcnt). This seems at least to avoid c4d crashing.
But I think that there is s.th. basically going wrong, because the bounding box isn't updated too, although I send an MSG_UPDATE message.
This is also the case, if I leave the default subdivisions.
On 26/09/2010 at 08:40, xxxxxxxx wrote:
Hmmmm, I just tried this in R10.1:
Bool TestCommand::Execute(BaseDocument* doc)
BaseObject *ffdOp = BaseObject::Alloc(Offd);
if(!ffdOp) return FALSE;
... and it seems fine; no crashing and the bounding box is correct.
On 26/09/2010 at 08:50, xxxxxxxx wrote:
ok, but you don't change any parameter of the FFD. Try to insert a change of the size vector and see the bounding box when selecting the FFD. The grid is looking fine, but the bounding brackets are still on the default size of 3 m (resp. 300 units).
BaseContainer *bc = ffdOp->GetDataInstance();
bc->SetVector(FFDOBJECT_SIZE, Vector(100, 200, 400));
On 26/09/2010 at 09:13, xxxxxxxx wrote:
OH, in R10.1, the grid doesn't change even though the parameters are set correctly, the grid and the bounding box are still at the default.
On 29/09/2010 at 16:27, xxxxxxxx wrote:
may be Matthias can say a word?
On 30/09/2010 at 07:01, xxxxxxxx wrote:
I checked it and can confirm the strange behaviour. I have to ask the developers what's going on.