tin2tin / Blender_Screenwriter

Blender add-on for writing screenplays and convert them directly into timed storyboards.
193 stars 21 forks source link

multi-files addon #11

Closed samytichadou closed 5 years ago

samytichadou commented 5 years ago

Hi here's a multi files version of the addon, i didn't touch the content of it, only re organize it to make it multi files. It allow Blender to properly delete files on uninstall of the addon and keep the addon folder organized !

I'm on linux and get an error with it (same with your original addon files) so it seems to work "as intended" (it's a poll error, i'll take a look asap and get back to you) so you should test it on your config !

cheers !

tin2tin commented 5 years ago

Wow, that's a lot of work! Thank you so much. I'm totally unfamiliar with working in multifile add-ons. What IDE are you using? Any suggestions for me getting started with multifile add-ons? :-)

I'm getting a couple of errors: File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\Blender_Screenwriter-master\properties.py", line 10, in activate_handler spc = get_space(context)

Traceback (most recent call last): File "C:\Users\user\Documents\blender-2.82-Screenwriter\2.82\scripts\modules\bpy_types.py", line 796, in draw_ls func(self, context) File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\Blender_Screenwriter-master\gui.py", line 23, in screenwriter_menu_export SCREENWRITER_OT_export.bl_idname, text="Export Screenplay") NameError: name 'SCREENWRITER_OT_export' is not defined

samytichadou commented 5 years ago

i get the error, just corrected it, should be ok now

tin2tin commented 5 years ago

Great. The only thing not working is the Preview button. When you click it it splits the text editor area in two and open Preview.txt in the right one. This is the formatted text.

Then you type in the left, and when you want to see what you have written correctly formatted you click Refresh or add a check mark in Live Preview and it will update the preview live.

samytichadou commented 5 years ago

Great. The only thing not working is the Preview button. When you click it it splits the text editor area in two and open Preview.txt in the right one. This is the formatted text.

Then you type in the left, and when you want to see what you have written correctly formatted you click Refresh or add a check mark in Live Preview and it will update the preview live.

Ok i'll take a look at it, does this raises an error on your side ? or just do nothing ? i had the same behavior with the 011 and 012 releases on linux (see this issue ) For me, the cursor became a "wrong way" icon but nothing changes (or is raised) I'll try to dig in the code :)

samytichadou commented 5 years ago

hey these commits should fix the dual screen preview problem, but in order to do it i may have changed a little the behavior of the operator to make it more predictible/stable Here's some explanations in the last comment Tell me if it makes sense to you !

I also added a debug value which is imported by the operator to print few more statements if it is set to 1 (for now it's hardcoded, but it would be great to add preferences to the addon to allow user to turn it on/off in the future !)

cheers !

tin2tin commented 5 years ago

Hmm... the split still doesn't work here on Windows, and the join is now missing.

I wonder why the original split code didn't work for you. Is there a difference between Linux and Windows with these functions?

samytichadou commented 5 years ago

ok that's weird, i'll give a try on a windows machine tomorrow, maybe the window manager works differently ! and about the join function, it could not work in some use case when the user has changed some parameters of the preview area, that's why i felt like it could be ok to remove it, but i may be wrong here ! i'll tell you tomorrow if i find a solution with this windows problem ! cheers !

tin2tin commented 5 years ago

Double checked it - restarting everything - and now it does split. Imo, it should join too as a toggle, if possible.

I think this function should be a checkbox in the header of a subpanel, and will enable all other functions and a a fountain document if there is none.

tin2tin commented 5 years ago

The functions in misc_functions.py are supposed to do the hard work of split and join - if you prefer to do it without these functions, then this file can be removed.

Btw. does the export functions work for you? (the auto installing of screenplain) (pdf not working here. And non of them worked for Andrea's Linux without manual installation of the screenplain module)

samytichadou commented 5 years ago

Hi, thanks for the merge ! i'll dig into the functions in misc_functions.py but it appeared to me they were not connected to any operator when i reorganized the addon... i'll double check !

About the join operator, it could be tricky because the operator could do any change on the preview windows, which could be either hard to reach, or not a preview anymore. But i could add something like a bool property in the text area which is toggle when the area is a preview one or something like that !

About the function being a checkbox in the header, you meant the join function ?

And for me the export function didn't work neither, screenplain module wasn't installed when installing the addon.