Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with preview #13

Closed
samytichadou opened this issue Nov 16, 2019 · 12 comments
Closed

problem with preview #13

samytichadou opened this issue Nov 16, 2019 · 12 comments
Labels
bug Something isn't working

Comments

@samytichadou
Copy link
Contributor

Hi, i installed the addon on ubuntu 19.04 and tried with blender 2.82 (-e5b788bad8bc-linux-glibc217-x86_64)
I have hard times to get a preview working, i opened the fountain script you provided in the zip of the last release, but when clicking on any of the 3 operators, i don't get anything and it raises no error at all.
The preview operator do get me a "wrong way" cursor which disappears when clicking or hitting esc key.
I don't have a good knowledge of the addon so far, what should happend when working correctly ? splitting the text editor to get a preview windows when hitting preview is that right ?

@AndreaMonzini
Copy link

AndreaMonzini commented Nov 16, 2019

Hi, i use Linux too ( latest Pop_OS 19.10 distro )
Try to start new project from zero or eventually unlink the preview text data-block.
I usually need to restart Blender to update the modules.
Check also please the addon folder if there are double installations:

/home/USER/.config/blender/2.82/scripts/addons/

Eventually delete the addon and reinstall it.

What version of the addon are you using?
The release 011, 012 ?
https://github.com/tin2tin/Blender_Screenwriter/releases
Or the last committed version?

@samytichadou
Copy link
Contributor Author

Hi @AndreaMonzini thanks for your answer !
I'm using the 012 (from releases), no luck when reinstalling the addon, deleting pycache, starting with clean project so far.
No dupes in the addon folder (clean 2.82 version)
Just to be sure, the way to go is click on the preview button to get the split text editor isn't that right ? and then refresh it or enable live preview ? Or do i have to do a second text editor manually ?

I just overviewed the code so far, not sure about it... thanks !

@AndreaMonzini
Copy link

AndreaMonzini commented Nov 16, 2019

Just to be sure, the way to go is click on the preview button to get the split text editor isn't that right ? and then refresh it or enable live preview ?

Yes, the preview button will open a second text editor for a dual view and starts the preview.
Use refresh button to update the preview or use the live preview.

Anyway i will test the different versions to check if it works here.
Important: If you download the last committed version as ZIP from Github, you should unzip it and re-zip it without a parent folder.

@AndreaMonzini
Copy link

AndreaMonzini commented Nov 16, 2019

Just checked that the Release 012 and the last committed master work with 2.82 on my Linux distro.
I zipped the last master:

Blender_Screenwriter-master.zip

@samytichadou
Copy link
Contributor Author

No luck so far, but it seems the problem is related with this part of the dual screen operator

    if area == thisarea:
        if debug: print('debug --- context area is this area') ### DEBUG
        continue
    elif area.x == tgxvalue and area.y == thisarea.y:
        otherarea = area
        if debug: print('debug --- context area is not this area') ### DEBUG
        break

the break in it kind of stops the operator if your blender screen has some non text editor area, trying to get the grasp of it !

@AndreaMonzini
Copy link

AndreaMonzini commented Nov 16, 2019

If you start Blender from terminal can you please report the terminal messages?
(To run quickly the first time Blender from terminal i just drag and drop Blender executable in the terminal in my distro).
Can you also make maybe a GIF video?
Thank you.

@samytichadou
Copy link
Contributor Author

i am running from terminal, but so far no error raised. if i understand correctly, it gets stuck on any non text editor area in the context screen and return finished because of the join operator. I may have a workaround, i'll post it here if it works !

@samytichadou
Copy link
Contributor Author

samytichadou commented Nov 16, 2019

ok i took a different approach, for now the addon was trying to get all areas and guessing which one could be preview to join it (i'm guessing in order to "cancel" dual screen) but it was a clunky way to do it because of the iteration across the areas, so i get rid of this part for now, and the behavior becomes :

  • If preview doesn't exist, the area is split and dual screen is setup
  • if it exists, nothing happens

would this behavior makes sense to you guys ?

For now there is no "cancelling" the dual screen mode, this could be difficult to do properly, because the user can rearrange its workspace before that. I'm looking into it right now !

i believe the cancelling should be another operator don't you think ?

I'll add that to the push request i made !

@tin2tin tin2tin added the bug Something isn't working label Nov 17, 2019
@samytichadou samytichadou changed the title linux problem with preview problem with preview Nov 18, 2019
@samytichadou
Copy link
Contributor Author

Hey, i'm rewriting the screenwriter dual_screen operator, and trying to reimplement the join, but here's the problem so far :

  • when overriding the context of the join operator, the direction of the join will take the mouse position (which is going to be left of the area most of the time, giving the way we split) so when clicking right away, the merge happens in the wrong way (the text writing area becomes the preview)
  • the way we do the override (from previous code) the join operator must have a border to work, which is the left border, so no way to merge with another area in blender (right or top)
  • atop of that, if user adds a preview area by simply changing the text block of any text editor to preview, only one of these previews will be taken into account.

Here's a video of the problem

So my thinking on this problem the join option seems to be too clunky, i think the user should just be able to split current area through the dual_screen operator, then join if needed manually.
After all the manual way is just one click and drag

@tin2tin
Copy link
Owner

tin2tin commented Nov 18, 2019

Yes, maybe you're right. I discussed it with the coder who changed the behaviour in 2.81. before you could determine which way to join through the API. I pasted it into one of the now closed issues.

Maybe it's better to leave it without the join until it is properly fixed in the API.

@samytichadou
Copy link
Contributor Author

i just made a pull with rewrite operator, tried to clean the code and add a "global" message and variable logic to it.
the pull request
It now iterates through diferrents windows if any to find a previous preview, then create one if doesn't exist

@tin2tin
Copy link
Owner

tin2tin commented Nov 19, 2019

This has been solved by #17

@tin2tin tin2tin closed this as completed Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants