Thank you Nicolas. The thought of feeding mouse events to SI directly did cross my mind, but the approach is very "hacky" (mildly put :)

And finding the window is extra tricky, because that window class - AfxWnd90u - changes with the version of MFC / C RTL occasionally on a new Softimage release...

I was really hoping a cleaner approach exists.


On 5/18/2012 7:38 PM, Nicolas Burtnyk wrote:
Hey Kamen,

I tried this really quick in python and it worked to toggle the button:

win32api.PostMessage(0x0001085E, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON, 0x000A000A) win32api.PostMessage(0x0001085E, win32con.WM_LBUTTONUP, win32con.MK_LBUTTON, 0x000A000A)

I used Spy++ to grab the window handle of the button (0x0001085E) and gave it some arbitrary coordinates of (10, 10) (0x000A000A) which are inside the button's client rect.

To get the state of the button, this works:

buttonState = win32api.SendMessage(0x0001085E, win32con.BM_GETSTATE, 0, 0)
if buttonState & win32con.BST_CHECKED:
print "Button is pressed."
else:
print "Button is not pressed."

You should be able to do the same from C++. Obviously you'll need to actually find the window handle for the button but that should be pretty easy - it's a great-grandchild of the a window called "DS_ChildRender Preview" with window class "AfxWnd90u".

Hope this helps!

-Nicolas


On Fri, May 18, 2012 at 8:33 AM, Kamen Lilov <[email protected] <mailto:[email protected]>> wrote:

    Hello,

    I'm looking for an undocumented feature :) - in the SI preview
    window, there is a Lock button that will cause SI to stop sending
    any further Render requests (for that preview) until the button is
    toggled again.

    Is there a way to programatically access, and change, the value of
    this toggle? Or at least to simulate a user clicking that button?
    I suspect that it all comes down to a flag private to the preview
    window implementation (it's not even a scene or pass property) but
    I need to confirm this.

    K.



Reply via email to