sketchucation logo sketchucation
    • Login
    1. Home
    2. Mr.K.1
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 143
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: SketchyReplay - Hopelessly Confused

      Well I spent some time testing this and I can't consistently replicate the problem, but it seems that sometimes when you record an animation multiple times the objects stop moving, no clue what that is about.

      But if you erase the animation (Plugins -> SketchyReplay -> Erase Animation), it will work the next time around, it has done for me every time.

      And if it's still no good upload the model so I can take a look at it.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SketchyReplay - Hopelessly Confused

      The problem probably lies in my added code, I never tested it with exporting and I never looked into how it would match up, maybe I'll have some time to check this later today.

      What if you just directly recorded the replay with screen capturing softwared, like Fraps.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SketchyReplay with scenes (pages)

      Ah I see, well I got to tell you that would take alot of work.
      Essentially you would need to rewrite the entire skechyreplay script, maybe someday I'll get into that but for now it's a bit too much for my schedule.

      For now I suggest using that page transition script, or the numerous object following scripts while you record the animation.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SketchyReplay with scenes (pages)

      I know the joint flexing peril, and I wanted a stiffening feature for a long time but I just don't know how to do that.

      Did figure out what's wrong with page transition + sketchy replay tho, sketchyreplay has an optimization feature where data will stop recording if no object moves, so if yo want it to record nonstop you need to add a simple block on a motor or something that will just move all the time.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SP API Question

      Well yes the names can collide with any preexisting variable, method or ruby command, there are too many to actually list but here are some of the simpler SP variables you should avoid: frame, a, b, x, y, leftx, lefty, rightx, righty, joyLX, joyLY, joyRX, joyRY, ...

      Easiest way to get around this is to use names specific to your model: car_motor, car_steering, boat_motor, track_distance, ...

      Also all names are case sensitive, so car, cAr, caR are completely different variables.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Joint locations-export/save

      Well I wrote a bit more on this here: http://sketchyphysicscommunity.webs.com/apps/forums/topics/show/1568658-su-advanced-scripting
      And the SU API is a great resource of extras:http://code.google.com/intl/sl/apis/sketchup/docs/classes.html

      So to this particular problem:

      • first you need a list of all objects in the model
        entities = Sketchup.active_model.entities

      • then you check if the object is a group/component(the only ones important in SP)
        ent1 = entities[0]
        if ent1.class==Sketchup::Group or ent1.class==Sketchup::ComponentInstance

      • and then you read the attributes SP uses to store joint data and connections
        joint_name = ent1.get_attribute("SPJOINT","name")
        If it isn't a joint this will just return nil, and if it is you can read anything you want.
        ent1.get_attribute("SPJOINT","type")
        ent1.get_attribute("SPJOINT","min")
        ent1.get_attribute("SPJOINT","max")
        ent1.get_attribute("SPJOINT","damp")
        ...

        Best way to actually view all these is with the attribute manager plugin:
        http://code.google.com/p/sketchupattributemanager/downloads/list

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Joint locations-export/save

      Well give us a format example, getting positions and joint data is dead simple you only need to say how you want it presented, then I can make you a rough example.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SketchyReplay with scenes (pages)

      The idea is to record while SP is running the scene transition script and then using that animation for exports and such.
      Edit: seems I was a bit hasty, for some reason the recording will only replay minor parts of the camera move when combined with scene transition, not sure what's going on there

      I'm not familiar with the details of the physics engine settings, I might dig into that someday.
      The added weight usually needs to go overboard(bigger is better), and make sure all joints are as close to the connected object as possible

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SP API Question

      Variable range is where SP gets a bit tricky, essentially every blue text field is in it's own bubble of local variables(unless they are the SP predefined ones).

      So let's say you put "speed1" into the motor controller and then "speed1=10" in the ontick box you would just get errors that "speed1" is undefined because it is only a local variable.
      So then you have:
      @speed1 - this makes it slightly global(it extends beyond the current block but may not be visible everywhere)
      @@speed1 - makes it fully SP global(it will be reachable in every script across SP)
      $speed1 - makes it fully SU global(best used for testing because you can also reach it in the Ruby console, and it stays active until you close SU, however these variables can clash with each and every global variable that SU and it's plugins use)

      But for controllers I always advise using get/setVar because these always return a value, the other variables however may not be defined at the start of SP and that can crash your models.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SketchyReplay with scenes (pages)

      Actually made a small script you can use for that too:
      http://sketchup.google.com/3dwarehouse/details?mid=3b5f693f76f5df15dfda4e320b343f5c

      Copy the yellow box into your models and it should do the trick.

      The flexing joints are how the underlying Newton physics engine works, I don't think it can actually be fixed with scripts, so the only way to really fix this is making the objects bigger to increase the connection strength

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SP API Question

      Well it's really straight forward, you can write any sort of ruby script into that controller(or any other blue field), usually it's best to just use one variable and then change that at will in other scripts.

      Best way to do it is with getVar() and setVar(), these methods are specifically designed for this so you don't haveto worry about initialization and variable range.
      So put getVar('banana') into your motor and then you put setVar('banana',10.0) <-10.0 is can be any number/variable you want, and that setVar() can then be used in any script to control it.

      You can also write full scripts into the controllers themselves, but that just comes back to bite you in the ass when you haveto edit them.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SP API Question

      Well the tutorials aren't 100% but they get you started:
      http://sketchyphysics.wikia.com/wiki/SP_Tutorials

      And if you need some specifics just ask here, there is always someone who knows around.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Slider puzzle

      Well here is a quick and crude solution, it just checks if all the named blocks are positioned beyond the border.


      slidergame level 1 - 10.skp

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Platforming minigame

      Thanks guys, the idea is not actually mine I picked it up from a flash game called Cursor times ten

      I know the game messes up sometimes(freezes on me mostly, then I just reset SP and it's good) but no errors are displayed so I'm not sure what it is that needs fixing.

      But I updated the game so it will skip the tutorial once you pass it, even if you restart it will go to the challenge levels.
      Also you can edit the $intro_stage=0 value to just start at any level.

      posted in SketchyPhysics
      M
      Mr.K.1
    • Platforming minigame

      Since we got into minigames here I want to add another one to the mix: 3D warehouse model: Rob the robot

      I mention mainly so someone would make extra levels, then I can really pull it together into one heck of a model.

      Doesn't even haveto be a working model if you can't figure how it works, I'll put in the proper stuff if you just post the model.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Blox

      Can't find what you broke, I say just copy paste your blocks into the original, should work fine then.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Blox

      Very nicely done, it is pretty much perfected gameplay so now people only need to build some extra levels.

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Slider puzzle

      An even simpler solution


      slidergame.skp

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: SketchyReplay - Hopelessly Confused

      Well I modified my SketchyReplay a while back so it can record camera, but it then always records the camera so keep your backup files close.

      http://forums.sketchucation.com/viewtopic.php?f=61&t=36029#p317654

      posted in SketchyPhysics
      M
      Mr.K.1
    • RE: Blox

      I see what you did there, very neat system indeed.

      You could add a timer so the box turns fully on every button press, that way it's far less likely to break the level.

      posted in SketchyPhysics
      M
      Mr.K.1
    • 1 / 1