sketchucation logo sketchucation
    • Login
    1. Home
    2. mtalbott
    3. Posts
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 30
    • Groups 1

    Posts

    Recent Best Controversial
    • Clients <--> Server Communication (Sockets?)

      My current project consists of a need to have bi-directional communication between a server and a handful of clients running sketchup. The idea is to be able to share model information in real-time between multiple sketchup sessions on multiple computers. The data will be simple but often. I'm looking for multi-player computer-game-like performance. The communication would be happening while the user is working in the sketchup file so it is critical to keep the performance hit to the model environment to a minimum.

      I've been researching several different methods to accomplish this but don't which one is best:

      Web Dialogs:

      1. The first thought was to use webdialogs with some sort of AJAX/comet to long poll the server that stores info with php + mysql. However, this seems inefficient. I could be wrong.

      2. bi-directional web got me thinking Websockets with HTML5. Alas, IE does not support it so that's a no-go. (wish sketchup could use chrome)

      Extension library:

      1. So then I bought a book on programming multiplayer games (copyright 2004 so it's old). The go through writing a network library in C++ that use sockets to communicate through UDP or TCP with a server. I was thinking that I could modify it to be a ruby extension library to use native within sketchup. Unfortunately, this is probably a lot harder then I think, if not impossible, as I do not know C++.

      2. Then I looked for other pre-made network libraries. There are a few, however, I'm still unclear how I could get any of them to talk to sketchup.

      All Ruby:

      1. I see that there is an undocumented SKsocket class built into sketchup but I hear that's pretty unreliable.

      2. Finally, full ruby has a socket.so that looked promising but I can't seem to load/require it in sketchup without getting a error "127: The specified procedure could not be found."

      I'm frustrated that no one solution has jumped out. Any guidance to how you would approach the problem would be much appreciated.

      Thanks,
      Mike Talbott

      posted in Developers' Forum
      M
      mtalbott
    • RE: Full Screen Sketchup

      @jhauswirth said:

      LayOut is a presentation program that comes with SketchUp Pro. It can go fullscreen and you can double-click to go into a viewing mode on a SU model and you can play your Scene animation also.

      You know, I wouldn't of thought of that. That is an interesting solution. I especially like that I could work some 2D (paper space) stuff on top of the model. However, that doesn't give me the functionally I would like. I need the full sketchup environment with tools page control, rubies, etc. I like to build things and animate things on the fly with clients but I don't use buttons or menus so I would like to have a better presenting environment.

      Is removing the menus, and toolbars, and header from sketchup possible with a ruby?

      PS I didn't know about the "Play animation" function in Layout. it's sort of hidden. It would be perfect, however, I wish there was more functionally. i.e. setting scene to scene animations on click, keyboard shortcuts, allowing the model to be displayed from where you left it after exiting an animation, and some modeling tools.

      Thanks,
      -Mike

      posted in Developers' Forum
      M
      mtalbott
    • Full Screen Sketchup

      I am increasingly using Sketchup for presentations with clients and I would like a cleaner environment without toolbars, menus, and taskbars. - Fullscreen; controlled with keyboard shortcuts.

      Is there a way/has anyone created a way to make a true fullscreen? Can this be done with the win32api.so or something like that?

      posted in Developers' Forum
      M
      mtalbott
    • RE: Ruby to trigger DC onClick Function

      thanks for the info, Dan

      I have read that article and I think my problem was that I was looking for the easy way out. I was wishing for a simple way to run the "OnClick" attribute, in particular, without having to create the animation object myself. It's easy to change a simple attribute like material, or lenZ but the interactive nature of OnClick and the tweening of the ANIMATE function make it a little over my head. But I guess this is how I learn.

      Thanks,
      Mike

      posted in Developers' Forum
      M
      mtalbott
    • Ruby to trigger DC onClick Function

      Hi,

      Is there a way to get a ruby script to trigger the onClick attribute of a Dynamic Component? In particular, I would like to run an ANIMATE function without clicking with the interact tool.

      If not, has anyone written a Animation Class that can parse the onClick Attribute and recreate a similar effect?

      I am trying to animate objects based on Scene Changes and not with the interact tool.

      Thanks,
      Mike

      PS why is the source code for Dynamic Components not open? Seems like Google would want us to play under the hood.

      posted in Developers' Forum
      M
      mtalbott
    • RE: OnKeyDown repeat parameter problem

      @unknownuser said:

      big trick is that you need the call to yourTool.onKeyDown to return (while still running the loop in a sub-thread,)

      That's great advice. I was missing that big trick part. I think I inadvertenly figured that out but in a slightly different way. I was having trouble getting the view to refreash so I ending up having the onKeyDown create an animation object which contained the main loop in the Nextframe def. To my suprise, it worked! I used the onKeyUp to cancel out the animation object.

      I've attached the plugin if anyone is interested. It's just a different way to walk around a model. more like a video game. I find the walk tool hard to use and pan/orbit is great for modeling but it's not as emersive as a video game style navigation.

      controls are:
      keypad to walk forward/back, step left/right.
      move mouse to look around/ turn.
      Ctrl to jump (just for fun).
      esc to reset it if it gets all messed up (which sometimes it does)
      select another tool to exit

      This is only my thrid script that I've mostly completed so I apologize for what is probably terrible coding. there are definately a few bugs in it but this is about as far as my skills can get me.

      The major remaining issue with no solution I can think of is that in a videogame you can just move the mouse endlessly to the left and right to turn. Unfortunately, In sketchup you have limited screen space to move the mouse in. If there was a way to get around that, I'll be really excited about this plugin.

      Thanks again for the help. This is a great community,
      Mike


      First Person "Sketchuper"

      posted in Developers' Forum
      M
      mtalbott
    • RE: OnKeyDown repeat parameter problem

      Thanks ThomThom,

      That's good to know. So I'm still lost to how to create a key holding function on windows. I was hoping to be able to start a loop on the onKeyDown and then have onKeyUp break the loop. Unfortunately, once the loops starts sketchup seems to be too busy working on that to notice that I've released the key. Any ideas on how to break the onKeyDown loop when a key is released?

      -Mike

      posted in Developers' Forum
      M
      mtalbott
    • RE: OnKeyDown repeat parameter problem

      TBD,

      Were you, or anyone else, able to create a good work-around for the repeat bugg on windows? I was wondering myself how best to set a timer to determine a key being held down.

      I am using this on a fun script that makes navigating a model more like a FPS.

      -Mike

      posted in Developers' Forum
      M
      mtalbott
    • RE: Observers WhishList

      @thomthom said:

      Check the entity's .hidden? or .visible? property along with Sketchup.active_model.rendering_options['DrawHidden'] to determine if an entity is visible and if the user has Hidden Geometry on.

      thomthom,
      thanks for responding to my issue. However, with my limited knowledge, checking hidden or visible is only good after the selection has been made. I don't know how to effect what can be selected in the first place.

      The issues can be simplified to this: all entities have a dictionary with an attribute value set to either "A" or "B". The script's job is to watch the selection that the user makes and based on what is selected, change the visibility. If an entity with the "A" tag is selected, only other "A" entity are visible and visa-versa. Furthermore, if nothing is selected both "A" and "B" entities should become visible again. The problem is that after I start the observer and select an "A" entity all of the "B" entities are hidden but if I go to select a different entity (which should be another "A" because that is all that is visible), the selection tool will pick the entity as if both "B" and "A" are visible. So if there is a "B" entity is in front of the "A" that I want to select it will select the invisible "B". This also goes for selecting in white space.

      I figure that I need to tell sketchup that something has changed and it should get it's act together but that is where I've fallen short and thought maybe the selection observer was just not quite observant enough.

      posted in Developers' Forum
      M
      mtalbott
    • RE: Observers WhishList

      I'm a newbie to Sketchup Ruby API so this might be me and not the observer...

      When using a selection observer to control the visibility of all entities based on the attributes of the selected entity, it allows me(and I don't want to be allowed) to select hidden entities even when "show hidden geometry" is unchecked.

      This is my first use of an observer so maybe I just have to play with it more but I was thinking this might be a limitation of the observer.

      posted in Developers' Forum
      M
      mtalbott
    • 1
    • 2
    • 2 / 2