How to work with HyperNurbs
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/07/2008 at 16:10, xxxxxxxx wrote:
Still can't get it running. Can somebody please give me an example?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/07/2008 at 16:38, xxxxxxxx wrote:
Make sure that you haven't *already* inserted the object before calling InsertObject()! If you need to RE-insert an object it MUST be first removed:
poly->Remove();
copydoc->InsertObject(poly, hypernurbs, NULL, FALSE);And EventAdd() is required after such an operation as inserting objects into the document.
Sometimes this is more appropo as the third argument can be tichy:
copydoc->InsertObject(poly, hypernurbs, hypernurbs->GetDownLast(), FALSE);
As a final check, verify that copydoc, poly, and hypernurbs are VALID pointers!!! Specifying invalid pointers as arguments is an inevitable crash.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/07/2008 at 06:17, xxxxxxxx wrote:
I got now the code:
> <code>
> BaseObject *hypernurbs = BaseObject::Alloc(Ohypernurbs);
>
> BaseContainer* hypernurbsData = hypernurbs->GetDataInstance();
> hypernurbsData->SetLong(HYPERNURBSOBJECT_SUBEDITOR, hypernurbs_unterteilung);
> hypernurbsData->SetLong(HYPERNURBSOBJECT_SUBRAY, hypernurbs_unterteilung);
> copydoc->Message(MSG_UPDATE);
> poly->Remove();
> copydoc->InsertObject(hypernurbs,NULL,NULL,FALSE);
> copydoc->Message(MSG_UPDATE);
> copydoc->InsertObject(poly, hypernurbs, NULL, FALSE);
> copydoc->Message(MSG_UPDATE);
> AddEvent(EVENT_FORCEREDRAW);
> </code>Why does that not work? Is it possible, that this is not allowed in GetVirtualObjects()?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/07/2008 at 06:37, xxxxxxxx wrote:
What's happening (that doesn't work)?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/07/2008 at 06:44, xxxxxxxx wrote:
Cinema is crashing
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/07/2008 at 07:33, xxxxxxxx wrote:
if (!poly) // ERROR!
if (!copydoc) // ERROR!
BaseObject *hypernurbs = BaseObject::Alloc(Ohypernurbs);
if (!hypernurbs) // ERROR!
BaseContainer* hypernurbsData = hypernurbs->GetDataInstance();
if (!hypernurbsData) // ERROR! (this shouldn't really occur but caution)
hypernurbsData->SetLong(HYPERNURBSOBJECT_SUBEDITOR, hypernurbs_unterteilung);
hypernurbsData->SetLong(HYPERNURBSOBJECT_SUBRAY, hypernurbs_unterteilung);
//copydoc->Message(MSG_UPDATE);
poly->Remove();
copydoc->InsertObject(hypernurbs,NULL,NULL,FALSE);
//copydoc->Message(MSG_UPDATE);
copydoc->InsertObject(poly, hypernurbs, NULL, FALSE);
//copydoc->Message(MSG_UPDATE);
AddEvent(EVENT_FORCEREDRAW); -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/07/2008 at 08:06, xxxxxxxx wrote:
At least got the error: The Hypernurbs-Object is not generated (!hypernurbs is true)
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/07/2008 at 08:23, xxxxxxxx wrote:
If I'm correct here, you need to allocate as Osds instead:
BaseObject* hypernurbs = BaseObject::Alloc(Osds);
This is the new form of HyperNURBS.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/07/2008 at 07:15, xxxxxxxx wrote:
Hm, maybe youre right. This is my code now:
> <code>
> BaseObject *hypernurbs = BaseObject::Alloc(Osds);
> if(!hypernurbs)
> {
> GePrint("HN");
> return false;
> }
>
> BaseContainer* hypernurbsData = hypernurbs->GetDataInstance();
>
> hypernurbsData->SetLong(SDSOBJECT_TYPE, SDSOBJECT_TYPE_R7);
> hypernurbsData->SetLong(SDSOBJECT_SUBEDITOR_R7, 2);
> hypernurbsData->SetLong(SDSOBJECT_SUBRAY_R7, 2);
>
>
> poly->Remove();
> copydoc->InsertObject(hypernurbs,NULL,NULL,FALSE);
>
> copydoc->InsertObject(poly, hypernurbs, NULL, FALSE);
>
> EventAdd(EVENT_FORCEREDRAW);
>
> return poly;
> </code>Nothing crashes, but also nothing happens. I tried to return hypernurbs, but then it crashes again. At the moment I think, this isn't possible in the GetVirtualObjects()-Funktion.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/07/2008 at 07:28, xxxxxxxx wrote:
The methodology might be a bit shaky for GetVirtualObjects(). You're returning 'poly' but also inserting it into copydoc. It can't be owned by two things simultaneously without repercussion. If the intention is to return the hypernurbs result, then you'll need to do CurrentStateToObject() (which is usually not possible here but in another document it may be).