catch the moment when the user converts an object



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 12/06/2010 at 17:47, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   r11 
    Platform:      
    Language(s) :

    ---------
    Hi there,

    is it possible to catch the moment when a user tries to convert my plugin object and perform one last action?? i guess there is , but i have no clue where to look for..

    cheers,
    ello



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/06/2010 at 08:23, xxxxxxxx wrote:

    Howdy,

    The only thing I can think to do would be a work around hack.

    If you create a message plugin and poll for EVMSG_CHANGE you could detect if your plugin object has been converted, then make a call to BaseDocument::DoUndo(), then perform your action without adding an undo for the action, then finally make a call to BaseDocument::DoRedo().

    If you keep a running list of your plugin objects as they're created, you can check to see if it's still in the document. If the object in the list is not in the document then it's probably on the undo stack. Then after calling the DoUndo() command you can check to see which objects in the list are now in the document that weren't in the document before. To keep track of what's going on, you'll probably have to set some flags in the object's container.

    You'd have to work out all the details, though as it's just an idea which I've never tried, yet.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/06/2010 at 14:24, xxxxxxxx wrote:

    wow, that sounds quite complex. what i want to achive is that if the user converts my plugin object i want to group the dependent objects, rename them, or even delete them.. my betatesters asked if that is possibe. i'll see if i can put your suggestion into code :)

    cheers,
    ello



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/06/2010 at 15:01, xxxxxxxx wrote:

    Howdy,

    An easier thing to do would be to add to your plugin its own Make Editable command that will do exactly what you want.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/06/2010 at 15:08, xxxxxxxx wrote:

    Hi Dan,

    this sounds logical.. like adding a button "convert" and there i can do whatever is needed??

    thanks and cheers,
    Ello



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/06/2010 at 15:17, xxxxxxxx wrote:

    Howdy,

    Well, you could also just make a CommandData plugin and simply add it to your plugin project.

    Adios,
    Cactus Dan



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 13/06/2010 at 15:19, xxxxxxxx wrote:

    thanks for your input. I'll check it out...

    cheers,
    Ello



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 14/06/2010 at 01:51, xxxxxxxx wrote:

    As Dan mentioned there is no direct way to check if an object has been made editable.

    cheers,
    Matthias


Log in to reply