haroldlinke / VEGASPython

Provides Python Support for VEGAS Video Editor
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Dockable Views Exception on Button Press #2

Open Peda1996 opened 4 years ago

Peda1996 commented 4 years ago

Hey, I tried to create some windows in a dockable fashioned way, without using tkinter but using windows forms. Without the usage of Forms, the plugin worked worked without errors, but as soon as I added windows forms some weird errors are occur. I added the forms as mentioned in https://github.com/haroldlinke/VEGASPython/issues/1#issuecomment-599104805.

Due to the fact, that I cannot access the conole, I pasted the error into the button ^^.

grafik

Any Idea what could cause this error?

(Whole source code could be provided if needed)

haroldlinke commented 4 years ago

Dear Peter,

is also used windows forms in some scripts and did not have this error.

So there must be something else happening. Can you please provide me with the source code, then I can check what happened?

Kind regards

Harold

Von: Peter Wassermair notifications@github.com Gesendet: Dienstag, 18. August 2020 14:44 An: haroldlinke/VEGASPython VEGASPython@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Betreff: [haroldlinke/VEGASPython] Dockable Views Exception on Button Press (#2)

Hey, I tried to create some windows in a dockable fashioned way, without using tkinter but using windows forms. Without the usage of Forms, the plugin worked worked without errors, but as soon as I added windows forms some weird errors are occur.

Due to the fact, that I cannot access the conole, I pasted the error into the button ^^.

https://user-images.githubusercontent.com/1789749/90514115-062e5b00-e161-11ea-85d3-2f2f5059ef44.png

Any Idea what could cause this error?

(Whole source code could be provided if needed)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haroldlinke/VEGASPython/issues/2 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNR4QXUDRBQ5T2BWQQXXZLSBJZR3ANCNFSM4QDM6TMA . https://github.com/notifications/beacon/AKNR4QSYGQM7A24BBHVPUXDSBJZR3A5CNFSM4QDM6TMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4KEXNOMA.gif

Peda1996 commented 4 years ago

I have uploaded my code into a seperate repository:

https://github.com/Peda1996/jump_cutter/blob/master/jump_cutter_dockable.py Basically the whole code except the windows gui (clicking the button) should work..

Edit.: Added non dockable Version using tkinter, that is working without problems: https://github.com/Peda1996/jump_cutter/blob/master/jump_cutter.py

haroldlinke commented 4 years ago

Hallo Peter,

I have downloaded the script.

To be able to run it I also need the modules:

utils.process_audio

vegasWrapper.wrapper

Can you please provide them to me?

Thanks.

Please note: I am very busy at the moment so it may take some time until I can have a detailed look into the issue.

Kind regards

Harold

Von: Peter Wassermair notifications@github.com Gesendet: Dienstag, 18. August 2020 15:01 An: haroldlinke/VEGASPython VEGASPython@noreply.github.com Cc: haroldlinke harold.linke@t-online.de; Comment comment@noreply.github.com Betreff: Re: [haroldlinke/VEGASPython] Dockable Views Exception on Button Press (#2)

I have uploaded my code into a seperate repository:

https://github.com/Peda1996/jump_cutter/blob/master/jump_cutter_dockable.py Basically the whole code except the windows gui should work..

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haroldlinke/VEGASPython/issues/2#issuecomment-675464173 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNR4QV2C5OVGDN3AAAD4CTSBJ3SNANCNFSM4QDM6TMA . https://github.com/notifications/beacon/AKNR4QRJVSFVEGALUJ2YWL3SBJ3SNA5CNFSM4QDM6TMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFBBMH3I.gif

Peda1996 commented 4 years ago

Hey, thanks for having a look at my project :)

The modules, and the whole code can be found in the github project: https://github.com/Peda1996/jump_cutter

haroldlinke commented 4 years ago

Hello Peter,

I am sorry it took a bit longer.

Unfortunately the problem is a bit more complex than I thought initially.

I will try to explain what is happening:

VEGASPython uses PythonNet to create the interface between Python and C# modules like VEGAS.

In the current implementation the Pythonengine is started, when a VegasPython script is executed. The start includes the initalisation of the variable scope.

When the script ends, the variable scope is disposed. But the pythonengine is not stopped.

In the case of your program the script creates the dockable window and then ends.

When you press the button execute in the dockable window the python code associated with the button is executed. This works until the code tries to access the variable pyVEGAS.

As the variable scope was disposed at the end of the script, the variable is not accessible anymore and the system crashes.

Unfortunately it is not easy possible to remove the disposal of the variable scope as this is a bigger redesign of the architecture of the program and needs a lot of testing to ensure that nothing else is broken.

At the moment I do not have the time to do this.

I will think about a solution and as soon as I have a new version , it would be nice if you could test it.

Kind regards

Harold

Von: Peter Wassermair notifications@github.com Gesendet: Dienstag, 18. August 2020 21:05 An: haroldlinke/VEGASPython VEGASPython@noreply.github.com Cc: haroldlinke harold.linke@t-online.de; Comment comment@noreply.github.com Betreff: Re: [haroldlinke/VEGASPython] Dockable Views Exception on Button Press (#2)

Hey, thanks for having a look at my project :)

The modules, and the whole code can be found in the github project: https://github.com/Peda1996/jump_cutter https://github.com/Peda1996/jump_cutter

— You are receiving this because you commented. Reply to this email directly, https://github.com/haroldlinke/VEGASPython/issues/2#issuecomment-675659186 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AKNR4QS4UDSCYTVE3GUMUS3SBLGHNANCNFSM4QDM6TMA unsubscribe. https://github.com/notifications/beacon/AKNR4QQ5CW6GKPTVM4KK3HDSBLGHNA5CNFSM4QDM6TMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFBC33MQ.gif

Peda1996 commented 4 years ago

Hmm, I was afraid it was something like that.

Is it possible to pass the dispose function to Python (or disable the dispose functionality with a boolean variable set in the Python script)? Then the only problem is that different scopes need different names (because some of them are still running in the background). These scope names could be set by the filename or?

Could you append the dependencies to the project (C# part), so I could compile the whole project and do some experiments?

haroldlinke commented 4 years ago

Hello Peter,

yes. I was thinking in this direction too.

One year ago I was experimenting with integrating a TK-window in a dockable window to create a dockable TK-windows. Unfortunately the concepts for this did not work with VEGASPython. So it would finitely be nice to have dockable windows for VEGASPython and I would like to find a solution. But unfortunately (or fortunately) I am very busy with my professional work. So I think I will not have sufficient time before October/November.

I would really appreciate if you would like to have a look at this topic.

I have made all source code available on Github as I think this should be open source and the further development should not only depend on me.

Please feel free to have a look at it and if possible to contribute to the further development:

https://github.com/haroldlinke/VEGASPython (I think you know the link already 😊 )

If you have any question I will try to support you.

Kind regards

Harold

Von: Peter Wassermair notifications@github.com Gesendet: Donnerstag, 3. September 2020 15:49 An: haroldlinke/VEGASPython VEGASPython@noreply.github.com Cc: haroldlinke harold.linke@t-online.de; Comment comment@noreply.github.com Betreff: Re: [haroldlinke/VEGASPython] Dockable Views Exception on Button Press (#2)

Hmm, I was afraid it was something like that.

Is it possible to pass the dispose function to Python (or disable the dispose functionality with a boolean variable set in the Python script)? Then the only problem is that different scopes need different names (because some of them are still running in the background). These scope names could be set by the filename or?

Could you append the dependencies to the project (C# part), so I could compile the whole project and do some experiments?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haroldlinke/VEGASPython/issues/2#issuecomment-686504709 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKNR4QUBYCXZ7CLPNL73NP3SD6ND7ANCNFSM4QDM6TMA . https://github.com/notifications/beacon/AKNR4QW6MT2FLSAL5ECHHZLSD6ND7A5CNFSM4QDM6TMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFDVTWBI.gif