is it possible to save the rube file from rubescript ?
I am creating different template (scale and postion) of one world and would like to save the current world after scale step in script.
The file name needs to be set as well ....
Can I maybe access the editor functionality from script ? Like open the file menu and simulate a mouse click on save file ?
Although you can't do that from within the GUI, you automate scripting and saving by invoking RUBE as a command-line utility (it will start without the GUI if given some parameters on the command line). There is some discussion on this here: viewtopic.php?f=6&t=380
In your case, it sounds like you would have to prepare multiple scripts to get the multiple scales you need, and run multiple invocations as a command-line utility. Note that the cursor position will be 0,0 when starting up so if you want the scale to be about some other point, you would need to setCursor() first.
thanks for your answer, calling rube from the command line works well.
I do have two problems here though:
1) I tried searching for an issue in the forum where you had answered regarding scripting and export.
But when type anything in the forum search I do just get:
The following words in your search query were ignored because they are too common words: export script.
I tried searching with google but did not find the issue either.
You would save yourself a lot of duplicate work if the search in the forum could be improved.
2) If I executed my script in the editor, everything worked, but I got a pop-up, that one of my bodies had a radius of less than 0.05m. (I do understand, that Box2D works best between 0.1m and 10m so that radius of 0.05 would be a diameter of 0.1m.)
The problem is now that when calling rube from the command line, that popup would just crash rube !
From the stacktrace below you can see a segmentation fault when a delayed pop-up was supposed to be started.
Changing the diameter for 0.1m stopped the pop-up and everything worked.
Have a you seen this problem before ?
As mentioned before I am working on the latest OSX and maybe it is related.
Thanks,
Thomas
Process: rube [8231]
Path: /Applications/rube-mac32-1.7.3/R.U.B.E.app/Contents/MacOS/rube
Identifier: com.iforce2d.rube
Version: 1.7.3 (1.7.3)
Code Type: X86 (Native)
Parent Process: sh [8228]
Responsible: Terminal [692]
User ID: 501
Date/Time: 2015-12-01 14:09:16.346 +0100
OS Version: Mac OS X 10.11.1 (15B42)
Report Version: 11
Anonymous UUID: 20AFBF20-5FA7-C79E-6F07-5CFD02F58CC5
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000000000007c
VM Regions Near 0x7c:
-->
__TEXT 0000000000001000-00000000005f0000 [ 6076K] r-x/rwx SM=COW /Applications/rube-mac32-1.7.3/R.U.B.E.app/Contents/MacOS/rube
Mmmhhh, thinking about the crash of point 2) above and the crash in viewtopic.php?f=7&t=480.
Could the crashes be caused by Rube picking up some Qt 5.5 libs from my system, while Rube is based on Qt 4.8 ?
Maybe Rube needs to run in virtualenv or be statically linked ?
Or is Qt 4.8 too old for the latest OSX ?
1) that is a problem with phpbb just having a terrible search function, I think I would need to do a full upgrade of the forums to fix it, assuming the problem has been taken care of in later versions of phpbb. The best way for now is actually to use google, you can specify the scope of the search by including a site: qualifier, eg.