tin2tin / Blender_Screenwriter

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

Created scenes don't respect source scene dimensions or framerate #18

Closed gabrielmontagne closed 5 years ago

gabrielmontagne commented 5 years ago

First things first: this project is super cool. Thanks for making it.

Now, I have a main scene, on which I load the fountain file, which has special dimensions and framerate. When I run the "Create sequence" operator, the scenes are created with the default blender configuration, which is a, to me, random framerate and size. All the scenes are then squished, and when I switch to the scenes, the framerate is also off.

I hacked my version to my taste, but I'm not sure if there'd be a better, more elegant solution to this issue?

diff --git a/operators/scene_to_strip.py b/operators/scene_to_strip.py
index bcf0c23..8e0f30c 100644
--- a/operators/scene_to_strip.py
+++ b/operators/scene_to_strip.py
@@ -47,6 +47,7 @@ class TEXT_OT_scenes_to_strips(bpy.types.Operator):
         first_duration = 0
         render = bpy.context.scene.render
         fps = round((render.fps / render.fps_base), 3)
+
         count = 0
         f_collected = []
         duration = 0
@@ -58,13 +59,20 @@ class TEXT_OT_scenes_to_strips(bpy.types.Operator):
         for fc, f in enumerate(f_collected):
             if str(f.scene_number) != "": f.scene_number = f.scene_number+ " "
             name = str(f.scene_number + f.element_text.title())
+
             new_scene = bpy.data.scenes.new(name=name)

+            new_scene.render.fps_base = render.fps_base
+            new_scene.render.fps = render.fps
+            new_scene.render.resolution_x = render.resolution_x
+            new_scene.render.resolution_y = render.resolution_y
+
             cam = bpy.data.cameras.new("Camera")
-            cam.lens = 35
+            cam.lens = 50
             cam_obj1 = bpy.data.objects.new("Camera", cam)
-            cam_obj1.location = (9.69, -10.85, 12.388)
-            cam_obj1.rotation_euler = (0.6799, 0, 0.8254)
+            cam_obj1.location = (0.0, -5, 0.5)
+            cam_obj1.rotation_euler = (1.5707963705062866, 0.0, 0.0)
+
             new_scene.collection.objects.link(cam_obj1)

             if fc == 0:
tin2tin commented 5 years ago

Thanks, looks fine to me. At this stage this project is mostly "a proof of concept", so those setting are just quickly thrown in and I'm not even sure the camera should be added, instead it may be better to let the users deside if they want to add ex. a camera for each character pointing at them, which could be done if we could get this object to keyword assigning working: https://blender.stackexchange.com/questions/158440/how-to-get-one-uilist-to-control-the-contents-of-another-uilist

tin2tin commented 5 years ago

I've uploaded your changes. Good idea to use the GP camera settings.

Now what's this funky stuff - screenwriting with nodes!? https://github.com/gabrielmontagne/blender-addon-bnhela

gabrielmontagne commented 5 years ago

Awesome sauce : ) thanks for pulling this in! That repo bnhela is me playing around with the nodes API, see how to propagate data from one node to the next. Funny how low level that API is, which is kinda cool, after going throu a kindafrustrating acknowledgment phase.

It'd be great, yeah, at some point merge things in through a node API... but once I started playing with it for diagram and mind mapping, things got really spaghetti-y very quickly!

I'll close this issue as this is working now for me and I'll switch back from my humble fork to the real thing ; )

tin2tin commented 5 years ago

Could be fun to outline or rearrange the scene order in the node editor like index cards: image

gabrielmontagne commented 5 years ago

That's a cool idea, absolutely :+1: Hmm. : )