@maxon/mikael ObjectPlugin strange behavi



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

    On 04/04/2005 at 02:28, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   9 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Hi,
    this is my second try to get help with this problem, i would really appreciate some advice.
    So here once again the description:
    Following the SDK-example RoundedTube i created my own type of object.
    The object is a little bit more complex but also editable by handles. And here comes the strange behaviour. When editing/ moving handles the representation changes between wireframe/box or sháded, depending on speed. Very nice and helpful. But somtimes the connection between the handles and my object gets lost, meaning the handles still move but dont cause any editing. After waiting some seconds with mousebutton down and not moving it, sometimes it gets connected again automatically, but not always. Very baaad.
    - Is this a known behavior or maybe a bug?
    - Is there anything i can do about it programmatically?
    thank you very much in advance for your help.
    Developer



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

    On 08/04/2005 at 00:16, xxxxxxxx wrote:

    Sorry for not getting back to you sooner. I'm having trouble duplicating the behaviour. The RoundedTube example seems pretty solid, even with the X/Y locks enabled and setting the Redraw Limit low enough to force wireframe/box mode. Is there any modification I could make to RoundedTube.cpp to make it show the same behaviour as your object? Or does the problem occur even with RoundedTube on your setup?
    There are no known bugs in this area afaik, so I need to be able to reproduce it in order to find out what's wrong. If there's no way to show it with RoundedTube.cpp, you could remove as much as possible from your own code and send it to msterner@kth.se. (There seems to be a problem with sdk_support@maxon.net at this moment.) Just make that enough code is still there to show the problem and that it's still compilable.



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

    On 12/04/2005 at 02:16, xxxxxxxx wrote:

    Hello Mikael,

    - The RoundedTube example works without any problems here too, this is why i decided to use it as the base for my own development.
    - I am currently working on trying to reduce and compress my sources to be able to make my underlaying concept easyly and quickly understandable and still showing the problem.
    - I have inspected the problematic behaviour for a long time now and i can give you detailed information about it here:

    When editing (means moving handles with the move tool) in the PerspectiveViewWindow editor, handles close to the middle of the surrounding boundingbox work nearly robust and predictable. The closer they are to the borders or even edges of the boundingbox, the more unstable they are. An when they have lost connection, they will nearly always regain it after a few seconds if i move it very close to the place where it *belonged to* lastly. When editing in a 2D-view things are worse.

    To me this looks heavily like a multithreading-problem, meaning that there is some speed optimizations or some balancing going on that cuts "me" off under certain circumstances. All this is completely black-boxed for the plugin-developer, so its only guessworking.
    Do you have any better idea or even resources?



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

    On 12/04/2005 at 06:22, xxxxxxxx wrote:

    Found this comment in another thread:
    "If C4D refuses the plugin, perhaps you have a global variable somewhere? That isn't allowed, unless you set the __WINCRTINIT define."

    I am using one single Variable to store the adress of my engine, is this no more allowed?
    I found somewhere in Rel 8. docs the advice to store my own data this way. Is there a change in rel 9 i havent found yet? If so, what is the alternative?

    BTW: I have mailed you the plugin so you can see the problem with the handles live on your monitor.



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

    On 13/04/2005 at 03:29, xxxxxxxx wrote:

    The handle problem appears on my computer as well. Unfortunately it's hard for me to tell what causes it without any source. It does seem to be related to the bounding box as you say. It is as if you manage to escape the bounding box by dragging quickly, there won't be any updates until you return. Have you checked if GetDimension() is called during this time?
    Your plugin is obviously called to some extent even during the freeze. For example, I assume that Draw() is called since the orange lines update? What about GetVirtualObjects()? Is it called but the returned object isn't drawn, or doesn't C4D even query you for the current object state during the frozen drag?
    The _WINCRTINIT thing is a hard crash when starting C4D, caused by memory for global class instances being allocated too early, so it's most likely not the cause of this problem.
    What would help me very much would be to see this problem in something that I have the source for. Either if you could find a way to modify the RoundedTube example, so that the problem appears there, or if you could remove enough propritary code from your plugin to be able to send it to me non-compiled.
    PS. For everyone: now sdk_support@maxon.net works again.



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

    On 17/04/2005 at 04:12, xxxxxxxx wrote:

    Quote: Originally posted by Mikael Sterner on 13 April 2005
    >
    > * * *
    >
    > The handle problem appears on my computer as well. Unfortunately it's hard for me to tell what causes it without any source. It does seem to be related to the bounding box as you say. It is as if you manage to escape the bounding box by dragging quickly, there won't be any updates until you return. Have you checked if GetDimension() is called during this time?
    >
    > * * *

    I stick to the RoundedTube example as close as possible, meaning i do not make any calls to functions like GetVirtualObjects(), GetDimension() or Draw(). I have uncommented any Boundingboxcalculations for testing, the problem keeps unchanged.

    > Quote: _
    >
    > Your plugin is obviously called to some extent even during the freeze. For example, I assume that Draw() is called since the orange lines update? What about GetVirtualObjects()? Is it called but the returned object isn't drawn, or doesn't C4D even query you for the current object state during the frozen drag?
    >
    > _
    >
    > * * *
    >
    > * * *

    I do not have any control or information about what happens during the freeze. I have tried to update my objects in many different places of the code, always with the same unwanted results.

    > Quote: __
    >
    > * * *
    >
    > The _WINCRTINIT thing is a hard crash when starting C4D, caused by memory for global class instances being allocated too early, so it's most likely not the cause of this problem.
    >
    > What would help me very much would be to see this problem in something that I have the source for. Either if you could find a way to modify the RoundedTube example, so that the problem appears there, or if you could remove enough propritary code from your plugin to be able to send it to me non-compiled.
    >
    >
    >
    >
    > * * *

    I hope you have forwarded my plugIn to the MAXON-developers to get any hints or more useful information from them. I have tried to change the RoundedTube, but it is obviously something about local data. RoundedTube only uses 5 singlevalue variables stored in its container, the only member is a single string that is never changed.



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

    On 18/04/2005 at 12:14, xxxxxxxx wrote:

    According to the developers there are unmatched MouseDragStart()/MouseDragEnd() calls in the code. Is there any way that a MouseDragEnd() could be skipped in your code?
    Further it seems that if you let go of the mouse during a frozen drag, the spline will never update to the new handle position. So it would seem to have something to do with the position of the handle not being stored or not being used to update the spline. Is there any way the updating part could be skipped, for example if a function fails?
    Unfortunately neither I nor the developers can't get much further in the analysis without seeing some source. I'm afraid there's just no way to guess exactly where the error is from just machine code. Rest assured that mail sent to sdk_support@maxon.net is treated confidentially.
    Since the rounded tube works and your code doesn't, there is another very cumbersome but efficient way to find the error: change one thing at a time to change rounded tube into your code, and note when the error appears. It might be difficult if there are lots of differences, but it sounded like your code was quite similar to rounded tube?



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

    On 18/04/2005 at 16:56, xxxxxxxx wrote:

    Hi there,
    let me state two things before getting into the details:

    1. thank you very much for not letting me out in the rain with this.
    2. I wont let you get away with this, before finding a pathway to get to the point that leads to a nice and strong NURBS tool in C4D.

    - I do not use MouseDragStart() or MouseDragEnd()with my ObjectPlugin, so there is no way of making anything wrong from my side.

    "Is there any way the updating part could be skipped, for example if a function fails?"
    Its obvious the updating part IS skipped, sometimes, sometimes not! But i have zero, null, nada Control or Information about when this part is called, how it is called or why it is not called.
    If a function fails, how could i do anything about it? I do not call the functions, all i do is implement them following the example code. they are only called by the Core-C4D-OS, the "blackbox".



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

    On 18/04/2005 at 23:35, xxxxxxxx wrote:

    1/2. No problem. The error is probably very trivial once we can find it.
    - I guess that just shows how easy it is to do blackbox debugging... ;-)
    - That's all fair enough. But as I've said, I'm really out of suggestions until I can get some more input into what the plugin really does.
    Your plugin is important to C4D (and that's not just empty talk; a solid NURBS tool would be a useful addition), but I'm afraid there's only so much I can do without looking into *your* blackbox.



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

    On 19/04/2005 at 10:27, xxxxxxxx wrote:

    While still thinking, testing and trying to match as close as possible to the RoundedTube with both source and binary, here is another important, but completely different question for the planned UserInterface i did not dare to ask yet:
    How do i get any control or information about the right mousebutton, when executing my ToolPlugin?
    All that happens when my tool is active is the default PopUp-Menu coming up when rightclicking. I dont get any rightclick-mouseEvents in my MouseInput(), the OS all *eats them up* before my poor little plugin gets any chance to do anything about it :(



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

    On 20/04/2005 at 00:10, xxxxxxxx wrote:

    Hallo developer,

    riskiere bitte nicht nochmehr um Deiner selbst willen! antworte mir bitte!



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

    On 20/04/2005 at 05:00, xxxxxxxx wrote:

    @rayloc
    This is an official MAXON forum for technical support only, and also english is the only language used here.
    Please do not use it for private messages in the future!
    I do apologize to everybody else for this. Please ignore this private, nonenglish posting.

    And Mikael, i hope you can give me some hints about my right-mouseclick question ?



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

    On 21/04/2005 at 00:18, xxxxxxxx wrote:

    I'm afraid it's not possible to detect right och middle clicks in the editor from a tool plugin. As you've noticed, these events are already bound to other C4D functions.
    PS. Please start a new thread for each new topic.


Log in to reply