[REQ] manipulate camera by something like mover2 ?

[REQ] manipulate camera by something like mover2 ?

Postby bagatelo » Sun Dec 20, 2009 3:00 pm

One more of the series "Alex and their crazy ideas.... " :roflmao:

Would it be possible to control the camera of Sketchup using something similar to the tool "Mover2?"

http://sketchuptips.blogspot.com/2007/0 ... ver-2.html


Set camera offset for rotation and translation numericly:
http://www.pixero.com/downloads_sketchup.html


http://www.smustard.com/script/CameraControls

I think something like move camera "up/down", "front/behind", "right/left" by typed numeric values.

Please, visit my blog: http://cg-alex.blogspot.com/
0
While the cat's away, the mice will play
User avatar
bagatelo 
 

Re: [REQ] manipulate camera by something like mover2 ?

Postby Jim » Mon Dec 21, 2009 4:34 pm

I will look into adding the Camera as a movable target using the mover2 controls. Give me a couple days..
0
Hi

Jim 
Global Moderator
 

Re: [REQ] manipulate camera by something like mover2 ?

Postby driven » Fri Dec 24, 2010 3:41 pm

Jim wrote:I will look into adding the Camera as a movable target using the mover2 controls. Give me a couple days..

hi Jim,

if your revisiting Mover2, could you add .show_modal for us mac users, I can't figure out how to (I'm sure I added it before)

cheers
john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: [REQ] manipulate camera by something like mover2 ?

Postby Dan Rathbun » Fri Dec 24, 2010 11:12 pm

Code: Select all
if RUBY_PLATFORM.include?('darwin')
  dialog.show_modal()
else
  dialog.show()
end


You can get fancier with a global like $MAC_SHOW_MODAL_DIALOGS=true
So the user can change their preference on the fly.

Code: Select all
if RUBY_PLATFORM.include?('darwin')
  if $MAC_SHOW_MODAL_DIALOGS
    dialog.show_modal()
  else
    dialog.show()
  end
else
  dialog.show()
end
0
Last edited by Dan Rathbun on Fri Dec 24, 2010 11:25 pm, edited 1 time in total.
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: [REQ] manipulate camera by something like mover2 ?

    Postby Dan Rathbun » Fri Dec 24, 2010 11:23 pm

    Hey John it occurs to me that YOU can override your UI::WebDialog class and force any call to show() to actually call show_modal(). You would use method aliaising, based on the global var.

    That way way you would not need to badger every plugin coder to modify their plugins.

    Something like this: EDITED
    Code: Select all
    class UI::WebDialog

      @@ALWAYS_SHOW_MODAL=false
      def self.always_show_modal?
        @@ALWAYS_SHOW_MODAL
      end
      def self.always_show_modal=(arg)
        @@ALWAYS_SHOW_MODAL=arg
      end

      alias_method( :old_show, :show )
      def show(&block)
        if RUBY_PLATFORM.include?('darwin')
          if @@ALWAYS_SHOW_MODAL
            show_modal(block)
          else
            old_show(block)
          end
        else
          old_show(block)
        end
      end # show() override

    end # class override

    if RUBY_PLATFORM.include?('darwin')
      UI.menu("View").add_separator()
      UI.menu("View").add_item('Show WebDialogs as Modal') {
        if UI::WebDialog.always_show_modal?
          UI::WebDialog.always_show_modal=(true)
        else
          UI::WebDialog.always_show_modal=(false)
        end
      }
    end

    Made control var a class var, instead of a global.
    Added menu option under View menu.
    0
    Last edited by Dan Rathbun on Sat Dec 25, 2010 12:04 am, edited 1 time in total.
      I'm not here much anymore. But a PM will fire email notifications.
      User avatar
      Dan Rathbun 
      PluginStore Author
      PluginStore Author
       

      Re: [REQ] manipulate camera by something like mover2 ?

      Postby driven » Fri Dec 24, 2010 11:38 pm

      Dan Rathbun wrote: ....That way way you would not need to badger every plugin coder to modify their plugins.


      cheers Dan, I'll give it a try, I usually just change them myself, but sometimes can't figure out 'where' to when people use super instead of UI::WedDialog

      I don't understand what super is... or where it comes from...

      john

      btw. merry xmas to all
      0
      learn from the mistakes of others, you may not live long enough to make them all yourself...

      driven 
      PluginStore Author
      PluginStore Author
       

      Re: [REQ] manipulate camera by something like mover2 ?

      Postby Dan Rathbun » Fri Dec 24, 2010 11:53 pm

      Actually it would be "more proper" to have the control var as a class varible rather than yet another in the multitude of globals.

      I'll edit the code posting above.
      0
        I'm not here much anymore. But a PM will fire email notifications.
        User avatar
        Dan Rathbun 
        PluginStore Author
        PluginStore Author
         

        Re: [REQ] manipulate camera by something like mover2 ?

        Postby Dan Rathbun » Sat Dec 25, 2010 3:56 am

        driven wrote:I don't understand what super is... or where it comes from...

        super is a Ruby keyword that acts similar to a method, but has a quirk.

        super
        calls the same method in the ancestor PASSING UP the parameters that the child method received.

        super()
        calls the same method in the ancestor BUT PASSES AN EMPTY parameter list.

        super(arg1, arg2, ...)
        calls the same method in the ancestor BUT PASSES ONLY the parameters listed.

        ~
        0
          I'm not here much anymore. But a PM will fire email notifications.
          User avatar
          Dan Rathbun 
          PluginStore Author
          PluginStore Author
           

          SketchUcation One-Liner Adverts

          by Ad Machine » 5 minutes ago



          Ad Machine 
          Robot
           



           

          Return to Plugins

          Who is online

          Users browsing this forum: che, fk0002, Google Bot and 21 guests

          Visit our sponsors: