Skip to content

Commit

Permalink
Add start frame capability
Browse files Browse the repository at this point in the history
  • Loading branch information
eb3x committed Apr 25, 2019
1 parent b067753 commit b44fd61
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Podan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Lsystem
ex.description = 'Podium Animations Helper ' <<
'See https://github.com/ezberta/podium-anim-sketchup' <<
' for WARNINGS and usage instructions.'
ex.version = '0.0.1'
ex.version = '0.0.2'
ex.copyright = '2019 Eugene Berta, ' <<
'released under the MIT License'
ex.creator = 'Eugene Berta'
Expand Down
Binary file modified Podan.rbz
Binary file not shown.
15 changes: 10 additions & 5 deletions Podan/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def forceCancel()

attr_reader :done

def initialize(pod_dir)
def initialize(pod_dir, start_frame)
@mod = Sketchup.active_model # Open model

@pages = @mod.pages
Expand All @@ -97,6 +97,11 @@ def initialize(pod_dir)
@zeroCam = nil

@done = false

if start_frame > 0
@cur_fnum = start_frame - 1
@cur_t = @cur_fnum*@spf
end

end

Expand All @@ -122,7 +127,7 @@ def update_view()

_ignore, ratio = @pages.show_frame_at(@cur_t)
print("EZB @cur_t: #{@cur_t} @cur_fnum: #{@cur_fnum} ratio: #{ratio} zero: #{@zeroHandled}\n")
Sketchup.active_model.active_view.refresh
Sketchup.active_model.active_view.invalidate
GC.start

if not @zeroHandled and (ratio == 0.0)
Expand Down Expand Up @@ -266,7 +271,7 @@ def stillWorking(filename)

@@warningGiven = false

@@defaults = ['C:\Users\eugeneb\Desktop\podan_renderings']
@@defaults = ['C:\Users\eugeneb\Desktop\podan_renderings', 0]

def self.run_podan
if not @@warningGiven
Expand All @@ -285,12 +290,12 @@ def self.run_podan
return
end

prompts = ["Podium Write Directory"]
prompts = ["Podium Write Directory", "Start Frame"]
input = UI.inputbox(prompts, @@defaults, "Specify Podan Parameters")
@@defaults = input.dup
print(input)
print(input[0])
@@podan = PodanC.new(input[0])
@@podan = PodanC.new(input[0], input[1])
print(@@podan)
@@podan.update_view()

Expand Down

0 comments on commit b44fd61

Please sign in to comment.