THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/08/2005 at 17:32, xxxxxxxx wrote:
Cinema 4D Version: 8.503
Platform: Windows ; Mac ; Mac OSX ;
Language(s) : C++ ;
How would you go about deleting polygons from a PolygonObject using SelectionTags? I know to get the object's Polygon array and to use BaseSelect to get the selected indices of the polygons.
Now, how do you remove them from the Polygon array similarly to using the Delete key on a selected set of polygons in the editor?
On 02/08/2005 at 18:58, xxxxxxxx wrote:
I should add that the deletion of polygons is on the cloned object from within GetVirtualObjects in a Generator PluginObject. Can SendModelingCommand() be used in this instance?
On 03/08/2005 at 02:55, xxxxxxxx wrote:
Yes, thats how you call modeling commands just call with MCOMMAND_DELETE.
On 03/08/2005 at 12:17, xxxxxxxx wrote:
One more question on my generator plugin:
The PolygonObject is loaded, the Generator object created and inserted into the document, and the PolygonObject made a child of the Generator. The PolygonObject doesn't show until the Generator is selected in the OM. I've tried Message(MSG_UPDATE), EventAdd(EVENT_FORCEREDRAW) is already called for the entire process, EventAdd() on the Generator, other forms of Message(). What is needed to get the Generator to 'boot up' here?
On 03/08/2005 at 13:28, xxxxxxxx wrote:
Best thing you can do is to take a look over the SDK examples and pull apart the generators, they're all really simple so it shouldn't take many minutes to work out which bit of the code is missing. At the very basic form just returning a polygon object from the GetVirtualObjects should show it up, work back from that.
On 03/08/2005 at 13:52, xxxxxxxx wrote:
The Generator itself works. What appears to be happening is since the Generator is InsertObject()d into the Document and the PolygonObject afterwards as child, but the Generator is doing the GetDDescription() beforehand (Which is used to build a list of 'body part visibility' checkboxes from the PolygonSelection tags on the PolygonObject. The checkbox settings are used in GetVirtualObjects() to determine what is visible or not) and there is nothing there yet.
It could return the clone, but that isn't good for later (slows things down when nothing needs to be done) and isn't correct (nothing invisible). It returns the cache as it should but there is no cache yet (thus, no object in the editor). This is because it needs to do another GetDDescription() to do GetVirtualObjects() properly. But I cannot find any way to prod another call to GetDDescription() in my source. SetDirty() and Touch() don't work. SetDeformMode() to FALSE then TRUE doesn't work. Removing and reinserting the Generator (with PolygonObject already as child) into the Document doesn't work. There are no messages sent to the Generator (even when I click on the Generator which does cause GetDDescription() to get called).
All that I need is a way to kick the Generator from the source, "Hey, do the GetDDescription() just one more time, please."
On 03/08/2005 at 17:21, xxxxxxxx wrote:
Well, it seems that the best approach is to call BaseDocument->SetActiveObject(GeneratorObject, SELECTION_ADD). This guarantees that all of the GeneratorObjects get booted properly (SELECTION_NEW only boots the last one set active). These are the differences between making plugin objects that users add and remove interactively and those that are created, added, removed, and set programmatically. Different worlds.