Results 1 to 12 of 12

Thread: Issue command outside a LayoutGeneric

  1. #1
    Newbie Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    49

    Issue command outside a LayoutGeneric

    Hi all,

    I'd like to issue a command from another plugin type than a LayoutGeneric. I tried
    Code:
    #define LWCOMMANDFUNC_GLOBAL "LW Command Interface"
    typedef int ( *LWCommandFunc )( const char *cmd );
    
    LWCommandFunc *evaluate;
    evaluate = global( LWCOMMANDFUNC_GLOBAL, GFUSE_TRANSIENT );
    as described in the SDK but it doesn't work.

    Is there another way to do it ?!

    Cheers

  2. #2
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,543
    Hm, it works here. In what context are you calling the command, and how?

    Cheers,
    Mike

  3. #3
    Newbie Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    49
    I'm calling that function in the Evaluate function of an ItemMotionHandler doing
    Code:
    evaluate(cmd);
    where cmd is the string containing my command.

    I don't master programming and I'm not familiar with typedef. Do I have to define a function ?!, or something else in addition to the #define and the typedef ?!

  4. #4
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,543
    Quote Originally Posted by avogad
    I'm calling that function in the Evaluate function of an ItemMotionHandler...
    I suppose exactly that is the problem.

    evaluate() is not officially suported and can not be called at all times, I suppose this is what happens in your case. When evaluation motions, LW is in no state to actually receive commands.

    Cheers,
    Mike

  5. #5
    Newbie Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    49
    Ho ok,

    What I wanted to do was setting the zoom factor of a camera as I would set its position, rotation, ...

    Would u know a way to do that without using commands ?!

    EDIT: without creating an envelope

    Cheers
    Last edited by avogad; 04-24-2007 at 09:12 AM.

  6. #6
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,543
    Quote Originally Posted by avogad
    Would u know a way to do that without using commands ?!
    Not off hand, I'd need to dig into the SDK...
    Have you looked at the LWEnvelopeFuncs?

    Basically find the channel group and channel associated with the camera and then change the envelope directly using setKey...

    Cheers,
    Mike

  7. #7
    Newbie Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    49
    Quote Originally Posted by Lightwolf
    change the envelope directly using setKey...
    That is the tricky point! I want to do it without setting keys...

    For several days, I've been working on a motion exporter. That plugin exports the motion of all items in a binary file. Then I erase all the keys of all items and I apply an ItemMotionhandler linked to those files. The plugin reads values into the file, create an array and set those values to the item through the Evaluate() function.

    The result is that scenes are much lighter (0 keys into the scene file), the new motion files as well and the navigation into LW is faster.

    Anyway, to improve the plugin, the last thing I would have to do is set the ZoomFactor the same way than the position, rotation, scaling.

  8. #8
    obfuscated SDK hacker Lightwolf's Avatar
    Join Date
    Feb 2003
    Location
    Stuttgart, Germany
    Posts
    13,543
    Quote Originally Posted by avogad
    That is the tricky point! I want to do it without setting keys...

    For several days, I've been working on a motion exporter. That plugin exports the motion of all items in a binary file. Then I erase all the keys of all items and I apply an ItemMotionhandler linked to those files. The plugin reads values into the file, create an array and set those values to the item through the Evaluate() function.

    The result is that scenes are much lighter (0 keys into the scene file), the new motion files as well and the navigation into LW is faster.

    Anyway, to improve the plugin, the last thing I would have to do is set the ZoomFactor the same way than the position, rotation, scaling.
    Ah, I see. I hope you don't intend to render in lwsn then, since it doesn't support commands...

    Hm, can't think of anything else, except maybe applying a channel handler to the envelope, that should work.

    Cheers,
    Mike

  9. #9
    Newbie Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    49
    Hey I didn't see that!

    I'm gonna have a look through the ChannelHandler to do it.

    Cheers.

  10. #10
    LightWave Engineer Jarno's Avatar
    Join Date
    Aug 2003
    Location
    New Zealand
    Posts
    595
    Maybe your command isn't correct?

    Setting a key in the envelope probably won't work if the user hasn't activated the envelope on the zoom.

    ---JvdL---

  11. #11
    Newbie Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    49
    Thanks for your answers.

    The channel handler works perfectly, my problem is now to add this handler to all my cameras. The ApplyServer command tells me I can't apply my plugin. Is there a specific command to add ChannelHandlers ?!

    Cheers

  12. #12
    Newbie Member
    Join Date
    Mar 2007
    Location
    France
    Posts
    49
    Sorry, I found it. I used ApplyServer instead of GE_ApplyServer.

    Cheers

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •