0

C++ / Python plugin, run native RV commands (RV 4.2.0)

RV 4.2.0

Custom python plugin based on rv.rvtypes.MinorMode, has custom c++ library with python interface.

 

I wat to run a few native RV commands in my plugin`s method:

def reload_session(self, event=None):
    if event:
        event.reject()
    print 'Yo!'
    rv.commands.clearSession()
    rv.commands.addSource('/my_dir/my.mov')

 

Variant 1:

I`ve made RV main menu item in my python plugin init. Works great if I simply push that drop down main menu item.

 

Variant 2:

But menu item is not enough, my plugin has gui which generates in C++ library (works great), and I`ve created the button in my gui to run the same "reload_session" method.

Subvariant A:

I got PyObject* pointer to my plugin in my C++ library, and easily read attributes from plugin, like this: PyObject_GetAttrString(m_plug, "pid"). Works great so far.  But if I try to call method ( PyObject_CallMethod(m_plug, "reload_session", "()") ), SEGMENTATION FAULT error.  WHY???

Subvariant B:

In c++ I create the button, found "reload session" QAction* in QApplication*, and my button runs QAction`s trigger: qactReloadSession->trigger().  I see in the log how I call the trigger, but it does not start "reload_session" method of my plugin.  WHY???

 

Thank you

2 comments

  • 0
    Avatar
    Evgeny Glazyrin

    Ok, I`ve found rvNetwork.py and that is good alternative.

    But if someone know the answer, will be very appreciate.

  • 0
    Avatar
    Jon Morley

    Hi Evgeny,

    Sorry for the slow response! Are you currently up and running or is there something I can help with still? I am not sure I understand what you are trying to do. Can you please give me a high level walk through of your desired workflow?

    Thanks,
    Jon

Please sign in to leave a comment.