sketchucation logo sketchucation
    • Login
    1. Home
    2. ternup
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    T
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 1

    ternup

    @ternup

    0
    Reputation
    1
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    ternup Unfollow Follow
    registered-users

    Latest posts made by ternup

    • RE: [Request] Scene tween

      @ppoublan said:

      Dear all,
      I used this little script. Very limited but it insert scenes with intermediate cameras.
      Yours

      require "sketchup.rb"

      Add a menu item

      plugins_menu = UI.menu "Plugins"
      insert_scenes_menu = plugins_menu.add_item("Insert Scenes") {

      Access the Pages container

      pages = Sketchup.active_model.pages

      check existing pages

      if pages.count < 2
      UI.messagebox("Needs 2 scenes to be created first.")
      exit
      end

      eye1 = pages[0].camera.eye
      target1 = pages[0].camera.target
      up1 = pages[0].camera.up
      fov1 = pages[0].camera.fov

      eye2 = pages[1].camera.eye
      target2 = pages[1].camera.target
      up2 = pages[1].camera.up
      fov2 = pages[1].camera.fov

      prompts for number of scenes

      prompts = ["Number of scenes to add : "]
      defaults = ["10"]
      input = UI.inputbox prompts, defaults, "Insert Scenes"
      if (input)
      insertcount = input[0].to_i + 1
      else
      exit
      end

      for i in 1..insertcount - 1
      eyetmp = Geom::Point3d.new (eye1.x + (((eye2.x - eye1.x) / insertcount) * i),eye1.y + (((eye2.y - eye1.y) / insertcount) * i),eye1.z + (((eye2.z - eye1.z) / insertcount) * i))
      targettmp = Geom::Point3d.new (target1.x + (((target2.x - target1.x) / insertcount) * i),target1.y + (((target2.y - target1.y) / insertcount) * i),target1.z + (((target2.z - target1.z) / insertcount) * i))
      uptmp = Geom::Vector3d.new(up1.x + (((up2.x - up1.x) / insertcount) * i),up1.y + (((up2.y - up1.y) / insertcount) * i),up1.z + (((up2.z - up1.z) / insertcount) * i))
      fovtmp = fov1 + (((fov2 - fov1) / insertcount) * i)
      pagetmp = pages.add(i.to_s)
      pagetmp.camera.set eyetmp, targettmp, uptmp
      pagetmp.camera.fov = fovtmp
      end

      }

      Thanks for the codes, but i dont understand how does it works.
      It will be helpful if you can explain it.
      What if i have about 26 scenes, & i want it to be 24fps?

      posted in Plugins
      T
      ternup