sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Scenes not behaving correctly?!?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 257 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      agamemnus
      last edited by

      I created some code to render a helicopter. Unfortunately, for some blasted reason, most of the scenes are not being rendered correctly. Help!

      Edit: ok, never mind. I added "view.camera = pages.selected_page.camera" .. that seemed to fix things. That's pretty odd that the new camera target isn't being copied. Is it a Sketchup 8 bug?

      Fixed file:

      
      require 'sketchup.rb'
      
      module Render_isometric
       def Render_isometric.do_render
        model = Sketchup.active_model
        pages = model.pages
        layers = model.layers
        view = model.active_view
        # Set up and get pointers to the appropriate layers.
        image_base_name = "osprey"
        
        scenes_extension   = ["bottom", "bottom-left", "left", "top-left", "top", "top-right", "right", "bottom-right"]
        rotation_extension = ["rotation 1", "rotation 2", "rotation 3", "rotation 4", "rotation 5", "rotation 6", "rotation 7", "rotation 8"]
        rotors_extension   = ["rotors forward", "rotors up"]
        for i in (0 .. scenes_extension.length - 1)
         pages.selected_page = pages[scenes_extension[i]]
         view.camera = pages.selected_page.camera
         pages.selected_page.transition_time = 0
         pages.selected_page.delay_time = 0
         for j in (0 .. rotation_extension.length - 1)
          current_rotation_layer = layers[rotation_extension[j]]
          current_rotation_layer.visible = true
          for k in (0 .. rotors_extension.length - 1)
           current_rotors_layer = layers[rotors_extension[k]]
           current_rotors_layer.visible = true
           keys = {
            ;filename    => "c;/vehicles/" + image_base_name + "-" + scenes_extension[i] + "-" + rotation_extension[j] + "-" + rotors_extension[k] + ".png",
            ;width       => 256,
            ;height      => 256,
            ;antialias   => true,
            ;transparent => true
           }
           model = Sketchup.active_model
           view = model.active_view
           view.write_image keys
           current_rotors_layer.visible = false
          end
          current_rotation_layer.visible = false
         end
        end
       end
      end #end module
      
      
      Render_isometric_menu = UI.menu("Plugins").add_submenu("Render Isometric")
      Render_isometric_menu.add_item("Do Render") {Render_isometric.do_render}
      
      
      1 Reply Last reply Reply Quote 0
      • renderizaR Offline
        renderiza
        last edited by

        @agamemnus said:

        I created some code to render a helicopter. Unfortunately, for some blasted reason, most of the scenes are not being rendered correctly. Help!

        Can you be more specific when you say "rendered correctly" because I am not 100% sure what you mean by this. Do you mean the scene style rendering options where not updated?

        [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

        1 Reply Last reply Reply Quote 0
        • A Offline
          agamemnus
          last edited by

          @renderiza said:

          @agamemnus said:

          I created some code to render a helicopter. Unfortunately, for some blasted reason, most of the scenes are not being rendered correctly. Help!

          Can you be more specific when you say "rendered correctly" because I am not 100% sure what you mean by this. Do you mean the scene style rendering options where not updated?

          Yes... all of the camera didn't update, so the image doesn't render as intended. Had to do "view.camera = pages.selected_page.camera" to get it to work correctly.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement