sketchucation logo sketchucation
    • Login
    1. Home
    2. MarcioAB
    3. Posts
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 12
    • Posts 50
    • Groups 1

    Posts

    Recent Best Controversial
    • [Plugin] Camera OrbitOnTarget v1

      I'm an occasional CAD user and once in SketchUP I missed the way those products behave regard Orbit, so I created this simple OrbitOnTarget tool (plugin) that more or less works similar them. Feel free to improve. This is how it works:

      1. Activate the OrbitOnTarget tool by icon (or menu) and move the mouse over the view. The Point-inference engine will be following you to help the "Target" selection.
      2. Double-click when you find a good "Target" point and the screen will be centered on this "Target".
      3. Set Left-button down and drag the mouse around the screen to Rotate the View fixed on the "Target" (see more info on this below).
      4. Set Left-button down + Shift-key down and drag the mouse in the vertical screen direction to Zoom centered in the "Target". Drag up to Zoom-in and down to Zoom-out.
      5. Set Left-button down + Ctrl-key down and drag the mouse around the screen to Pan the View in XY plane. Even if the "Target" is not any more centered on the screen, the Zoom and Rotation will still be locked on the "Target".
      6. If you leave OrbitOnTarget and use other functions, when you came back the "Target" will still be there (I use the global $mama_target variable for that and I hope it's name is so weird it will not conflict with any other plugin).

      Regard item 3, when you drag the mouse Horizontally on the screen the View will rotate in an axis that is parallel to Global Z axis (the Blue one). When you drag the mouse Vertically on the screen the View will rotate in an horizontal axis that is Normal to your view direction (or sight direction).

      Regard item 5, when you drag the mouse Horizontally on the screen the View will Pan parallel to X axis (the Red one) and when you drag Vertically parallel to Y axis (Green one). I thing this must be improved.

      Obs1: When using OrbitOnTarget tool you can call the default Orbit tool (with the mouse middle-button) but then you lose the "Target". The reason is because the default Orbit tool works with a mobile target and when you leave the Orbit tool (releasing the middle-button) and get back into OrbitOnTarget, it's new "Target" is defined as the last target left by Orbit tool to avoid an abrupt View change.

      Obs2: The OrbitOnTarget icon (a red bow-arrow target) is on Toolbar "MamaTools". You must activate this Toolbar using View\Toolbars\MamaTools

      Obs3: First time using this forum file attach function, so just in case, this is the URL: http://pws.prserv.net/marcioab/OrbitOnTarget.zip

      OrbitOnTarget

      I would like to find a way to replace the default Orbit tool by this one (and it's future improved versions) and have it triggered from inside any tool via the mouse middle-button.

      Regards and let's see how we can improve this.

      posted in Plugins
      M
      MarcioAB
    • RE: [Bug?] Pan "on border": Is this a known bug ?

      Well, I wonder why this SketchUP behavior ( starts to PAN when the mouse gets over the window frame border ) for API tools is normal. It's like as Orbit+Shift became active. What is the logic behind that ?

      Thank you
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • [Bug?] Pan "on border": Is this a known bug ?

      Please, see below if this is a known bug. Is there any way to prevent this (using API) ?

      Thank you
      Marcio

      Scenario

      1. Create a simple plugin (Tool) with the code below
      2. Activate the Tool ("t1" on Ruby Console)
      3. Drag the mouse with LButton down
      4. Keep moving the mouse towards the window frame borders
      5. The view will remain the same (as expected) but ...

      When the mouse is over the frame border (still with LButton down) the view will start to PAN. PAN down if the mouse is over top border, PAN right if mouse on left border and so on.

      class ToolTest

      nothing, empty

      end
      def t1
      Sketchup.active_model.select_tool(ToolTest.new)
      end

      posted in Developers' Forum
      M
      MarcioAB
    • RE: Coming Soon:Profile Builder

      Great! More hands up here, looking for it. πŸŽ‰

      posted in Developers' Forum
      M
      MarcioAB
    • RE: Mouse middle-button: Orbit vs MyTool

      Yes, the onMButtonDown API when used inside any new tool "is broken". I already included a fix for that on the "WishList" stick.

      But now I realized the need of more than that. Something that works above the level of the tools - where onMButtonDown is. Maybe a new API like "Sketchup::onGlobalMButtonDown" that allows to associate my new Orbit tool to this trigger (and so, disassociate the default Orbit tool from that).

      I would like to know if there is any workaround (maybe change something on CameraOrbitTool class - where is this class?) before include this "Sketchup::onGlobalMButtonDown" on the WishList.

      Thank you.

      posted in Developers' Forum
      M
      MarcioAB
    • Mouse middle-button: Orbit vs MyTool

      The behavior associated with the Orbit Tool is very useful (activation over any tool by the mouse middle-button). Now I created "MyOrbit tool" and would like it behave as the standard Orbit tool (kind of replace it).

      Is that possible ? (or should it goto Ruby API WishList ?)

      Thank you
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • RE: SketchUp RUBY API Wishlist [way of coding wishes, please]

      Fix onMButtonDown() api.

      posted in Developers' Forum
      M
      MarcioAB
    • RE: SketchUp RUBY API Wishlist [way of coding wishes, please]

      Great! A "Ruby API Wish List Followed by SketchUp Team". This could be a sticker, right ?

      The most up-to-date "Wish List" in the very first page and good discussions in the sub-sequent pages.

      Regards
      Marcio

      posted in Developers' Forum
      M
      MarcioAB
    • Can I issue OpenGL commands to SU ?

      Is there a way to issue OpenGL commands (glRotate for example) to SketchUP via Ruby plugin ? Thank you.

      posted in Developers' Forum
      M
      MarcioAB
    • RE: Middle mouse button.

      Same problem here: Has anyone got this to work ? Or is this a known bug?
      The code below shows correctly "L" and "R" in the "Ruby Console" but never shows "M". Instead "M" it triggers the "Orbit tool".

      Thank you.

      require 'sketchup.rb'
      class Test1
      def onMButtonDown(flags, x, y, view)
      puts "M"
      end
      def onLButtonDown(flags, x, y, view)
      puts "L"
      end
      def onRButtonDown(flags, x, y, view)
      puts "R"
      end
      end

      def call1
      Sketchup.active_model.select_tool Test1.new
      end

      posted in Developers' Forum
      M
      MarcioAB
    • 1
    • 2
    • 3
    • 3 / 3