SketchyPhysics 3.3 (Unofficial Release)
-
SP3.4 is out, see this post: http://sketchucation.com/forums/viewtopic.php?f=61%26amp;t=58936
Better late then never.
This release includes compatibility for all SU versions, various bug fixes, and API improvements. It does not modify any SU API methods; its compatible with all plugins. As well, entity axis are set back to original placement after simulation resets; therefore, no model changes are made after resetting simulation (except that the version text is added). Make sure to delete original version prior to downloading the new one.
Edit: This release doesn't work on Mac. Could be fixed in the next update.
Release Notes
[list:280y8qwh]
[:280y8qwh]Compatible in SU2013, and SU2014.[/280y8qwh]
[*:280y8qwh]Replaced all Sketchup API modifying and adding methods, including Sketchup::Group.#copy. Warning, this change prevents many scripted models from working, especially those that rely on object entities. ComponentInstance doesn't have a .entities method, but its definition does. You will have to check before getting entities:if ent.is_a?(Sketchup;;ComponentInstnace) ents = ent.definition.entities elsif ent.is_a?(Sketchup;;Group) ents = ent.entities end
Or use an available function:
ents = MSketchyPhysics3.get_entities(ent)
.[/280y8qwh]
[:280y8qwh]Minimized the use of global variables. Warning, this change prevents many scripted models from working, especially LazyScript which depends on$sketchyphysics_script_version
variable. UseMSketchyPhysics::VERSION
instead. Many more global variables were removed as well; however,$curPhysicsSimulation
and$sketchyPhysicsToolInstance
were not removed, as they are quite handy.[/280y8qwh]
[:280y8qwh]Improved script error handlers. Simulation will reset properly if an error occurs. All detected errors, except those in joint controllers, will force simulation to abort. Due to that change many models that were uploaded with script errors will no longer work until they r' fixed.[/280y8qwh]
[:280y8qwh]Fixed minor inspector dialog errors.- Dialog clears when selection clears.
- Script can handle all sorts of escape characters.
- No longer throws two error messages.
- You're no longer required to click on the element to save the written script.[/280y8qwh]
[:280y8qwh]Rewrote most Ruby files, just to improve the way code looks and fixed some minor bugs and inconsistencies. Note: This change could raise more errors as I didn't pay much attention to what I did there. Need testers![/280y8qwh]
[:280y8qwh]Used Ruby DL to export functions for Ruby 1.8.x, used FFI to export functions for Ruby 2.0.0.[/280y8qwh]
[:280y8qwh]AddedsetSoundPosition2
, which properly distributes 3d sound to the left and right speakers, and controls volume depending by the specified hearing range.[/280y8qwh]
[:280y8qwh]Added drawPoints to simulation context, which allows you to draw points with style.[/280y8qwh]
[:280y8qwh]Added $sketchyPhysicsSimulationTool.cursorPos method - get cursor position relative to view origin.[/280y8qwh]
[:280y8qwh]Added more virtual key codes, 0-9 keys, semicolons, brackets, etc.[/280y8qwh]
[:280y8qwh]Improved SP3xCommonContext.#key method. You may pass key values to determine whether the specified key is down. This was added as a backup technique if the desired key name is missing, you can pass key constant value to get its up/down state.[/280y8qwh]
[:280y8qwh]Emit bodies with original density. Previously copied bodies did not have same density as the original bodies did. This is fixed now.[/280y8qwh]
[:280y8qwh]Temporarily removed check for update as it would recommend downloading SP3.2. Use SketchyUcation PluginStore instead.[/280y8qwh]
[:280y8qwh]Added simulation.drawExt method, which basically behaves the same as simulation.draw, but with more available types. Including, the 'line' type yields GL_LINES rather than GL_LINE_STRIP like in the simulation.draw method. The simulation.draw method was not replaced just to remain compatible.[/280y8qwh]
[:280y8qwh]View OpenGL drawn geometry is now included in the bounding box.[/280y8qwh]
[:280y8qwh]Added ondraw { |view, bb| } - bb is the Geom::BoundingBox. Use it to add 3d points to the bounding box, so they don't get clipped. First, add points and then draw.[/280y8qwh]
[:280y8qwh]Used abort_operation rather than commit_operation to reset simulation. This undoes most model changes made during simulation.[/280y8qwh]
[:280y8qwh]Created joints will no longer add 'jointBlue' material...[/280y8qwh]
[:280y8qwh]Removed MSketchyPhysics3::SketchyPhysicsClient.resetSimulation method.
-
Use
MSketchyPhysics3::SketchyPhysicsClient.physicsStart
to start. -
Use
MSketchyPhysics3::SketchyPhysicsClient.physicsReset
to reset. -
Use
MSketchyPhysics3::SketchyPhysicsClient.physicsTogglePlay
to play or pause. -
Use
MSketchyPhysics3::SketchyPhysicsClient.paused?
to determine whether simulation is paused. -
Use
MSketchyPhysics3::SketchyPhysicsClient.active?
to determine whether simulation has started.[/list280y8qwh] -
Entity axis are no longer modified. They are modified, but they are set back when simulation resets.
-
Clears reference to all big variables at end, so garbage collection cleans stuff up.
-
Improved drag tool. Objects won't go to far, and lift object works even if camera is looking from the top.
-
Fix the glitch in joint connection tool where cursors didn't update.
-
Added cursor access method.
-
$sketchyPhysicsToolInstance.getCursor
- returns cursor id. -
$sketchyPhysicsToolInstance.setCursor(id)
- id: can be String, Symbol, or Fixnum. Available names are select_plus, select_plus_minus, hand, and target. For instance, set target cursor when creating FPS games:
onstart { $sketchyPhysicsToolInstance.setCursor(;target) }
-
Added toggle pick and drag tool. When creating FPS games you might want to disable the drag tool, so player can't pick bodies.
-
Use $sketchyPhysicsToolInstance.pick_drag_enabled = state (true or false)
-
Use $sketchyPhysicsToolInstance.pick_drag_enabled? to determine whether the drag tool is enabled.
Example:
onstart { $sketchyPhysicsToolInstance.pick_drag_enabled = false }
- Added aliased event names:
onstart : onStart
onend : onEnd
ontick : onTick : onupdate : onUpdate
onpreframe : onPreFrame : onpreupdate : onPreUpdate
onpostframe : onPostFrame : onpostupdate : onPostUpdate
ontouch : onTouch
ontouching : onTouching
onuntouch : onUntouch
ondraw : onDraw
onclick : onClick
onunclick : onUnclick
ondoubleclick : onDoubleClick
ondrag : onDrag-
Improve record tool:
-
Objects will move to their original positions when you press the rewind button, regardless of when you started the recording.
-
You may toggle recording any-time during simulation.
-
Missing frames will no longer force the object to hide (move! 0).
-
onDrag is called once a frame now (if the mouse is moved).
-
Added onDoubleClick implementation.
-
Added sp_tool which returns MSketchyPhysics3::SketchyPhysicsClient.
-
Added sp_tool_instance which returns $sketchyPhysicsToolInstance.
To Do
- Avoid modifying object axis. From my understanding it was added to apply proper forces to the picked body.
- Centre of mass should not depend on the bounding box. Use Newton to calculate centre of mass.
- Magnetic/Picked bodies act improperly when their origin is not the same as their predefined centre of mass.
- ~ Change method names from mymethod/myMethod to my_method.
- Add yardoc documentation.
- Upgrade to Newton 2.36 or Newton 3.
- Upgrade to SDL2.
- ~ Proper interpretation of Foreign keys.
- Update dialog style.
- Improve brakeit method. Add face at split location. Destroy original body.
- Add lookAt(nil) to destroy the lookAt joint.
- Add more virtual keys to Mac OS X. You added semicolons and other symbols to windows, but not to Mac. Fix it!
- Get rid of global getKeyState in input.rb.
- Fix $spSoundInst in sound.rb
- Work on sp_midi.rb
- Rewrite all dialogs. Use jquery. Have major web content in html, css, and js files.
- Add explosion function.
- Set body mass via script or inspector.
- Toggle body static.
- Add compatibility files for SP3RC1, SP3X, SP3.1, SP3.2, and SP3.3.
- Test all events: onuntouch works only if ontouch is included.
- Capture/Release mouse (For FPS games)
- ~ Add App observer. Could be useful to detect undo; however, its not needed as major operations are undone manually via script.
- Commented out all make_unique in sp_tool.rb. Test!
- Add particle effects, and more goodies from the LazyScript.
- Add overwrite detectors. Models that overwrite SP content force SU to freeze or crash in many cases.
- Create Wiki. Add examples and implementation to the the existing SP wiki page.
- Test midi on Mac.
Compatibility
- SU6 or later
- Windows or Mac OS X. Mac OS X is not yet fully supported in terms of SP script API.
Download
Licence
Copyright 2009-2014, Chris Phillips
Credits
- Juleo Jerez for the NewtonDynamics physics engine.
- Anton Synytsia for 3.3.0. Thanks to Mtriple for starting out
Author
Chris Phillips
-
And any answer to this thread ?
ps Have you some infos about compatibility with other plugins ?
Or it's better to run it "alone" for avoid crash ?
(in making some Plugins folder temporary) -
Is this related to your MSPhysics or an update for the "old" SketchyPhysics?
-
@unknownuser said:
s Have you some infos about compatibility with other plugins ?
This release does not modify any sketchup API functions. It's compatible with all damn plugs, on all damn SU versions. Make sure you delete original SP before downloading the new one.
@cotty said:
Is this related to your MSPhysics or an update for the "old" SketchyPhysics?
No its not. I will extend the release of MSPhysics to other date, but so none of you get upset I thought to fix SketchyPhysics as a backup.
-
I need some people to test this on Mac OS X.
Please test these models on both SU2013 and SU2014:- SP MIDI Piano
- 3d sounds
- Delta Squad Particularly I want to know if the Joystick and keyboard controls are working.
Woudle be great if anyone could test,
ThanksI ain't really care if it doesn't work on Macs, but if anyone finds it not working on Macs, then post the error messages if you want it fixed.
-
Hello,
is the workflow the same like in the old SP?
can i use the old helpfile or have any important change?is SP compatible to Eneroth3 Railroad?
tnx
dean
-
@deaneau said:
Hello,
is the workflow the same like in the old SP?
can i use the old helpfile or have any important change?is SP compatible to Eneroth3 Railroad?
tnx
dean
Yes, the workflow should beh exactly the same; however, not all scripted models will work with the current release as there are quite a few changes. All scripted models that use SP LazyScript will not work, but the rest (that don't modify SP content) should work.
This is not compatible with the Eneroth3 Railroad though. You may have both plugins installed, but don't play them at the same time.
-
It doesn`t work on my sketchup pro 8 MAC.
Do you know why?
Thanks! -
@marcorigamonti74 said:
It doesn`t work on my sketchup pro 8 MAC.
Do you know why?
Thanks!No, I don't know why. Perhaps, a little more info would give me an idea whats not working. post a screenshot of an error that raises when you start SU or perhaps describe what exactly is not working... eh
-
Well this is certainly very good work by the looks of it, must have taken hell of a lot of time.
But is this officially approved by Chris? Because if it isn't I would suggest a more distinctive name that makes it clear these are not the same plugins any more.The issue of compatibility is no small matter, anyone who will search for the latest Sketchyphysics will find your version which might break old models, for anyone but expert users this will be a major problem.
-
Mister K, I tried keeping everything as compatible as I could. The reason old scripts don't work is because (1) they use Sketchup API modifying methods (such as ComponentInstance.entities) and (2) they were improperly written in the first place. Quite a few advanced developers suggested to disable SketchyPhysics because it was incompatible with other plugins. They even placed it in the quarantine list: http://sketchucation.com/forums/viewtopic.php?f=323%26amp;t=47371 I'm pretty sure that to remove SP from quarantine Chris would still have to make a choice to remove those Sketchup API modifying methods anyway.
I tried contacting Chris before, but no reply was given, so yeah. But I dont claim any authorization. All credit goes to him.
BTW, It only took me 12 days to do all that mess.
-
@anton_s said:
[...]
This is not compatible with the Eneroth3 Railroad though. You may have both plugins installed, but don't play them at the same time.
yes i have try this.
iΒ΄ll hope this will be possible in the future.
ok ERS is a young plugin and all ideas will be placed. this will need time. my dream is to work with SP and ERS together. 2009-2014 is a long time,too.
how you would setup a train in SP? for example a steamloco, coupling cars, driving on the track etc.? how i could tell SP the loco have a weight and the cars have different weight?
the starting speed is an other if the train is empty or when the train is loaded etc.
this setup would be interesting.
to simulate a real train start and train stop or when the train have an emergency break...how long need the train to stop. etc....ok an other example. i will simulate an earth quake.
how i can tell SP this is a concrete block and this is a paperbox. both have a different gravity.
ok i will stop with question, otherwise this text will be long.
regards dean
-
I'm not disputing your work, simply pointing out that your version will not be compatible with older models, a problem which none but experts will be able to fix. So in the interest of avoiding confusion this release should get a more distinctive name.
-
@deaneau said:
ok ERS is a young plugin and all ideas will be placed. this will need time. my dream is to work with SP and ERS together. 2009-2014 is a long time,too.
Deaneau, I respect your request, but I'm not willing to place much time on this plugin. You know, I have to work on MSPhysics the similar plugin to SketchyPhysics... The reason I fixed SP was because there are many SketchyPhysics models at 3Dwarehouse. It was hard for me to see them all be left behind.
However, nothing stops other users from improving SketchyPhysics. They may add their own features, as long as they keep author as Chris Phillips and the version tittle with Unofficial. Maybe someone wouldn't mind integrating trains into SP.
Maybe trains could be implemented into MSPhysics, but that won't happen until I release the basic version of MSPhysics, 1.0.
@mister k said:
I'm not disputing your work, simply pointing out that your version will not be compatible with older models, a problem which none but experts will be able to fix. So in the interest of avoiding confusion this release should get a more distinctive name.
Oh, I see where you coming from.
I'm planning to add compatibility files, so that all prior models could work on SP. The compatibility files will be loaded if the detected version is not 3.3. For instance, if detected version is 3.2, then a 3.2 compatibility file be loaded, adding and all removed methods from 3.2... As well, if the detected version is 3RC1 then the compatibility file for 3RC1 be loaded. You know how some models in SP3RC1 were not working with 3.2? Well, this could be eliminated due to the compatiblity files. I'm not sure if this be possible, but we'll see. This feature could be available in 3.4. And then a descent renaming of this plugin wouldn't be required.
I repeatedly ask for Mac OS X testers! Some people reported this version doesn't work on Mac, but did not post the error message. I'm pretty sure I had all the libraries compatible with Mac, but I'm certain that there's an error somewhere. You know, I'm a human. There is no way I can write a plugin without bugs in one try. If anyone is willing to test, then please do so. I'll be graceful for yaur help.
Thanks
-
@anton_s said:
@deaneau said:
ok ERS is a young plugin and all ideas will be placed. this will need time. my dream is to work with SP and ERS together. 2009-2014 is a long time,too.
Deaneau, I respect your request, but I'm not willing to place much time on this plugin. You know, I have to work on MSPhysics the similar plugin to SketchyPhysics... The reason I fixed SP was because there are many SketchyPhysics models at 3Dwarehouse. It was hard for me to see them all be left behind.
However, nothing stops other users from improving SketchyPhysics. They may add their own features, as long as they keep author as Chris Phillips and the version tittle with Unofficial. Maybe someone wouldn't mind integrating trains into SP.
Maybe trains could be implemented into MSPhysics, but that won't happen until I release the basic version of MSPhysics, 1.0.
@mister k said:
I'm not disputing your work, simply pointing out that your version will not be compatible with older models, a problem which none but experts will be able to fix. So in the interest of avoiding confusion this release should get a more distinctive name.
Oh, I see where you coming from.
I'm planning to add compatibility files, so that all prior models could work on SP. The compatibility files will be loaded if the detected version is not 3.3. For instance, if detected version is 3.2, then a 3.2 compatibility file be loaded, adding and all removed methods from 3.2... As well, if the detected version is 3RC1 then the compatibility file for 3RC1 be loaded. You know how some models in SP3RC1 were not working with 3.2? Well, this could be eliminated due to the compatiblity files. I'm not sure if this be possible, but we'll see. This feature could be available in 3.4. And then a descent renaming of this plugin wouldn't be required.
I repeatedly ask for Mac OS X testers! Some people reported this version doesn't work on Mac, but did not post the error message. I'm pretty sure I had all the libraries compatible with Mac, but I'm certain that there's an error somewhere. You know, I'm a human. There is no way I can write a plugin without bugs in one try. If anyone is willing to test, then please do so. I'll be graceful for yaur help.
Thanks
Hi everyone! For those that don't remember me, I did the original port of SketchyPhysics to the Mac years ago. I've been talking with Chris on and off for a few months now to see if SP was going to get re-energized. I haven't spoken with him recently but I'm sure he would find these developments exciting! I know that I do!
Anyway, I'm reaching out to offer any and all support I can to this effort to get SP 3.3 into shape and working for everyone on SU 2014. Anton, you've done an amazing job.
This release doesn't work on Mac at the moment since FFI is not directly support by the Ruby in Sketchup and an FFI bundle is not included in SP 3.3 . The Ruby that ships with SU (at least on the Mac) does support FIDDLE, which is a variant of FFI. If that is also supported on the windows version then we should consider moving to FIDDLE for SP3.3 so that it is directly supported by SU.
There are a lot of other Mac issues that Anton has documented in his findings. I'll be working on clearing those up and getting a working Mac version out as soon as I can.
Lets get this done!
-
This is really exciting!!! It even works with the Xbox controller!
-
Very well, lets get this done
-
At very least this crane works. Kudos to the coders, the modelers AND the Physicsers. Awesome, incredible work all around!
-
@mptak said:
3D Warehouse
3D Warehouse is a website of searchable, pre-made 3D models that works seamlessly with SketchUp.
(3dwarehouse.sketchup.com)
At very least this crane works. Kudos to the coders, the modelers AND the Physicsers. Awesome, incredible work all around!
On Mac?
-
Nope sorry for the confusion, I was working on a windows machine. I was just so excited to see Sketchy Physics resurrected (:)).
Advertisement