Commit graph

553 commits

Author SHA1 Message Date
Anthony J. Thibault
253e4cbb73 validate arguments to MyAvatar.addAnimationStateHandler()
Also validate arguments to MyAvatar.removeAnimationStateHandler() and the return result from the user provided callback function.
2016-04-14 16:25:17 -07:00
Brad Hefta-Gaub
ce1625b551 Merge pull request #7600 from sethalves/fix-entity-script-error-message
attempt to make the failed-to-load-entity-script error-message be more helpful
2016-04-07 09:17:04 -07:00
Brad Hefta-Gaub
986b4bea7c Merge pull request #7603 from zzmp/fix/entities-thread-crash
Fix intermittent crash on exit
2016-04-07 08:21:51 -07:00
Zach Pomerantz
06e827cb5e Guard against no script engine thread affinity 2016-04-06 15:41:13 -07:00
howard-stearns
f35c59ce5f Guard against meaningless query and fragment parts. 2016-04-06 15:21:43 -07:00
Seth Alves
672b4df7c1 get rid of magic number 2016-04-06 13:36:44 -07:00
Seth Alves
21c2db7cdc attempt to make the failed-to-load-entity-script error-message be more helpful 2016-04-06 12:40:59 -07:00
Zach Pomerantz
1e710712cc Check entities scripting thread before signaling it 2016-04-06 11:19:07 -07:00
howard-stearns
7b7ec5a174 Prohibit entity script file includes from outside the original entity
script's directory (unless its in our resources).
2016-04-04 16:41:21 -07:00
Seth Alves
35affe26e3 trying again on script loading changes 2016-04-01 11:52:47 -07:00
Seth Alves
63595e196e fix batch-loaded local scripts 2016-03-31 14:02:47 -07:00
Seth Alves
cfa847ba54 don't put empty folders at end of scripts tree. allow /~/ to work from outside scripts 2016-03-31 09:45:28 -07:00
Seth Alves
bb43347599 Merge branch 'master' of github.com:highfidelity/hifi into use-local-scripts 2016-03-30 13:33:59 -07:00
Seth Alves
26e01bbacd rewrite a bunch of path/url mangling code 2016-03-30 13:33:49 -07:00
Andrew Meadows
5ac0640cbe check for time machine 2016-03-27 16:33:53 -07:00
Ryan Huffman
1a2f74f43a Add protection around ScriptEngine::runInThread being called twice 2016-03-22 11:26:10 -07:00
Anthony J. Thibault
0d62b10a8f Added Mat4 support to script
Also, hooked up MyAvatar.sensorToWorldMatrix access to script.
2016-03-07 16:16:14 -08:00
Howard Stearns
05943ed353 Entity scripts keep of the which entity they are executing for. When the entity goes away, any created timers do, too. Also, loading interface scripts is not allowed from entity scripts. 2016-03-01 16:50:58 -08:00
Brad Davis
c07f3789e4 Don't crash on script destructor 2016-02-22 14:26:33 -08:00
Brad Davis
55af5eaf06 Fix crash on shutdown due to lifetime of scripts 2016-01-12 12:40:02 -08:00
Brad Davis
d28f80aa07 Moving running scripts functionality to scripting library 2016-01-11 12:44:03 -08:00
Brad Hefta-Gaub
553e455a53 Merge pull request #6759 from huffman/script-engine-slot-exception
Add logging of signal slot exceptions in ScriptEngine
2016-01-07 08:54:34 -08:00
Ryan Huffman
810da77abe Update ScriptEngine signal exception handling to call hadUncaughtExceptions 2016-01-04 10:34:55 -08:00
Ryan Huffman
f60cd09b45 Add logging of signal slot exceptions in ScriptEngine 2016-01-03 21:12:21 -08:00
Brad Davis
07531353e4 Allow a script to set a resource override. 2015-12-30 09:06:04 -08:00
Brad Hefta-Gaub
111a8caa3c Merge pull request #6701 from highfidelity/graphics
Graphics merge into Master: Adding Gamma correction, Tone Mapping and Debugging tool
2015-12-21 13:54:50 -08:00
Brad Davis
05b7fcc957 Remove script -> qt::webchannel dependency 2015-12-21 11:19:05 -08:00
samcake
1e8e3fec87 Merge branch 'master' of https://github.com/highfidelity/hifi into graphicsMaster 2015-12-19 11:38:20 -08:00
Brad Davis
6098c4a1d6 Revert "Revert "Migrate QML based web views to Qt WebEngine""
This reverts commit 1f3adeb666.
2015-12-18 17:18:46 -08:00
samcake
7e66515beb Merge branch 'master' of https://github.com/highfidelity/hifi into graphicsMaster 2015-12-18 17:13:48 -08:00
Brad Davis
1f3adeb666 Revert "Migrate QML based web views to Qt WebEngine" 2015-12-18 17:09:38 -08:00
samcake
41525a7c4d Merge branch 'master' of https://github.com/highfidelity/hifi into graphicsMaster 2015-12-18 16:20:41 -08:00
Zach Pomerantz
919a4b6728 Split global JS Scene into Render 2015-12-18 10:33:41 -08:00
Brad Davis
82c865af2c Rename QmlWebWindow to OverlayWebWindow, move ctor registration to script engine 2015-12-17 12:20:38 -08:00
James B. Pollack
d21e4ff5e1 Merge pull request #6592 from huffman/script-engine-fixes
Fix concurrency issues for bools in ScriptEngine
2015-12-10 10:48:54 -08:00
Brad Davis
978d39b7f4 Moving OpenVR to external plugin and updating to latest version 2015-12-09 16:20:24 -08:00
Ryan Huffman
a21e07327d Update ScriptEngine::stop() to always run on its thread 2015-12-09 14:50:30 -08:00
Ryan Huffman
e7a1550b64 Update ScriptEngine::finished to include 2015-12-09 14:50:09 -08:00
Ryan Huffman
4dbfd3bfd9 Fix concurrency issues for bools in ScriptEngine
Several member variables were unsafely being accessed from multiple threads. Making these variables std::atomic makes this safe.
2015-12-08 11:13:27 -08:00
Atlante45
1d498af76e Merge branch 'master' of https://github.com/highfidelity/hifi into baseball 2015-12-04 15:18:25 -08:00
Brad Hefta-Gaub
46556b7fa5 Merge pull request #6513 from huffman/fix-script-race-condition
Fix ScriptEngine setting _isFinished when it shouldn't, causing scripts to accumulate when restarting
2015-12-03 17:17:42 -08:00
Ryan Huffman
4d84362757 Fix ScriptEngine setting _isFinished when it shouldn't 2015-12-01 11:30:56 -08:00
Stephen Birarda
c3f3639374 more spacing adjustments in ScriptEngine.cpp 2015-11-30 15:57:10 -08:00
Stephen Birarda
b1a69bb2cf cleanup spacing in ScriptEngine 2015-11-30 15:52:10 -08:00
Stephen Birarda
4573e5c59e resolve conflicts on merge with upstream/master 2015-11-30 13:32:38 -08:00
David Rowe
e25d4c17e8 Fix InputController (Leap Motion) not able to be created 2015-11-25 09:29:40 +13:00
Brad Hefta-Gaub
5f88d958ab CR feedback 2015-11-23 18:26:15 -08:00
Brad Hefta-Gaub
ce46c30647 change the ScriptEngine::waitTillDoneRunning() to wait for the script thread to complete 2015-11-23 16:27:06 -08:00
David Rowe
c72c6a0a47 Make multiline strings from JavaScript's print() readably in log file
Addresses quoting of newline characters as "\n" which was introduced in
Qt 5.5.
2015-11-21 10:44:21 +13:00
Brad Hefta-Gaub
f80a765a29 add Assets.uploadData() and Assets.downloadData() 2015-11-19 17:28:20 -08:00
samcake
d2f3b48637 Merge branch 'master' of https://github.com/highfidelity/hifi into controllers 2015-11-17 17:36:38 -08:00
Brad Hefta-Gaub
2f142eb088 add a receiver example 2015-11-17 13:33:30 -08:00
Brad Hefta-Gaub
32bf81ef0d move MessagesClient to agent 2015-11-17 12:59:12 -08:00
Sam Gateau
5b92929833 Moving the REcordingScriptingInterface into the script-engine and wiiring up in the assignment-client 2015-11-17 09:32:22 -08:00
Eric Levin
a2abc11df1 Merge pull request #6351 from huffman/script-path-resolution
Update script engine path resolution behavior to behave consistently
2015-11-10 14:10:42 -08:00
Ryan Huffman
f6df7e298e Merge branch 'script-path-resolution' into baseball 2015-11-09 14:03:10 -08:00
Atlante45
b15054c1fb Merge branch 'master' of https://github.com/highfidelity/hifi into baseball 2015-11-09 13:41:06 -08:00
Eric Levin
7700e67734 Merge pull request #6326 from imgntn/entity_params
Add Ability to Pass Parameters When Calling Methods on Entities
2015-11-09 12:17:58 -08:00
Ryan Huffman
b835711266 Update script engine path resolution behavior
The path resolution will now be relative to the script currently
being evaluated *on its initial evaluation.* The previous behavior
was that all paths would be resolved relative to the root script
for client scripts, and inconsistent for entity scripts depending
on the order that scripts were loaded. The entity script situation
was particularly bad because including more than 1 level deep produced
inconsistent results.
2015-11-09 12:04:17 -08:00
Atlante45
55c6706f76 Merge branch 'master' of https://github.com/highfidelity/hifi into baseball 2015-11-06 13:31:39 -08:00
James B. Pollack
e928c8278b overload a single function and cleanup, add examples 2015-11-06 11:48:51 -08:00
James B. Pollack
3cee569bae pass parameters to entities 2015-11-05 16:57:39 -08:00
James Pollack
751d51ee72 entity call params 2015-11-05 14:19:11 -08:00
Atlante45
0508091130 Rebase fixes 2015-11-03 11:37:57 -08:00
Zach Pomerantz
6bf9a4518a Bail early from ScriptEngine::run if stopped
evaluate() bails anyway, so this will avoid the cost of init().
If run() is invoked from runInThread(), this may avoid a race
where _isRunning is set after it is checked because the check
occured during init().
2015-11-03 11:24:04 -08:00
Stephen Birarda
8cd41b9383 resolve conflicts on merge with huffman/baseball 2015-11-03 11:13:15 -08:00
Ryan Huffman
afffe7f5c6 Merge branch 'master' of github.com:Atlante45/hifi into baseball 2015-11-03 11:10:14 -08:00
Brad Hefta-Gaub
8839458d54 Merge pull request #6242 from highfidelity/controllers
New Controller interfaces/api
2015-10-30 12:47:51 -07:00
Howard Stearns
ada32dd260 typo 2015-10-29 19:17:52 -07:00
Stephen Birarda
d03a837263 resolve conflicts on merge with upstream master 2015-10-29 14:28:50 -07:00
Brad Davis
ccbae81dad Merge branch 'master' into HEAD
Conflicts:
	interface/src/avatar/SkeletonModel.cpp
2015-10-29 10:24:38 -07:00
Howard Stearns
d79d0bc5c5 Merge branch 'master' of https://github.com/highfidelity/hifi into expose-anim-vars 2015-10-29 08:25:41 -07:00
Atlante45
136747929e Fix typo 2015-10-28 17:11:46 -07:00
Atlante45
7695afec0a Fix ScriptEngine crash 2015-10-28 16:43:41 -07:00
Stephen Birarda
cee029f752 resolve conflicts on merge with upstream/master 2015-10-28 15:19:10 -07:00
Brad Davis
3c1a0930da Merge remote-tracking branch 'upstream/master' into HEAD
Conflicts:
	interface/src/avatar/MyAvatar.h
	libraries/script-engine/src/ScriptEngine.cpp
	libraries/script-engine/src/ScriptEngine.h
2015-10-28 13:38:22 -07:00
Atlante45
c0138bd189 Rename check functions and make them static 2015-10-27 12:39:40 -07:00
Atlante45
ffe73348fb Move check functions to cpp only 2015-10-27 12:11:27 -07:00
Atlante45
a53a576aa3 checkExceptions after testing entity scripts in the sandbox 2015-10-27 12:11:27 -07:00
Atlante45
ea56f965a4 Lambda conversion fix for windows 2015-10-27 12:11:27 -07:00
Atlante45
3e43a3c345 Some more script checks 2015-10-27 12:11:27 -07:00
Atlante45
13b7fa6b5d Typo 2015-10-27 12:11:27 -07:00
Atlante45
c8c9118d4d Improve script engine error logging + some cleanup 2015-10-27 12:11:27 -07:00
Atlante45
3742c169b5 Make handler generators more readable 2015-10-27 12:11:27 -07:00
Atlante45
380139364c checkExceptions after testing entity scripts in the sandbox 2015-10-26 12:41:49 -07:00
Atlante45
1c048880ee Lambda conversion fix for windows 2015-10-26 12:27:48 -07:00
Atlante45
8d72fcada5 Some more script checks 2015-10-26 11:33:13 -07:00
Atlante45
9771361840 Typo 2015-10-26 10:49:41 -07:00
Howard Stearns
4b4907c9ef Allow multiple scripts to register, and allow them to specify the specific anim vars they are interested in. 2015-10-26 10:04:55 -07:00
Howard Stearns
e11b0add9a Update safety trampoline with correct arguments. 2015-10-24 15:29:49 -07:00
Atlante45
421d967e49 Improve script engine error logging + some cleanup 2015-10-23 15:41:31 -07:00
Atlante45
4e33aa84e8 Make handler generators more readable 2015-10-23 15:41:31 -07:00
Howard Stearns
2b7ceffd64 Get rid of globalObject().property("MyAvatar").property("animationStateHandlerResult"). 2015-10-22 16:23:09 -07:00
Howard Stearns
1d0464ede5 Name change and thread checks per comments. 2015-10-22 15:15:10 -07:00
Howard Stearns
9fd61907f5 Call back to Javascript asynchronously, so that we don't block and the script's engine doesn't have thread conflicts. 2015-10-21 20:50:07 -07:00
Brad Davis
bea6fdd890 Working on JSON parsing and cleanup
Conflicts:
	libraries/controllers/src/controllers/Route.cpp
	libraries/controllers/src/controllers/ScriptingInterface.cpp
	libraries/controllers/src/controllers/StandardController.cpp
	libraries/controllers/src/controllers/impl/RouteBuilderProxy.h
2015-10-20 10:20:28 -07:00
Brad Davis
734a39f962 Breaking up UserInputMapper, restoring some mappings 2015-10-18 18:58:03 -07:00
Brad Davis
57be59935d Move controller test to app 2015-10-17 19:13:38 -07:00
Brad Davis
e39219c2b5 Fixes and PR comments 2015-10-14 16:51:52 -07:00
Brad Davis
0063f9ae1d Merging old and new controller interfaces 2015-10-14 15:16:54 -07:00
Brad Hefta-Gaub
d3ee9b0f39 more work on exposing device inputs as JavaScript named constants 2015-10-09 20:58:23 -07:00
Brad Davis
99d1e17ae8 Support reload-on-change for local scripts 2015-10-07 19:18:59 -07:00
Brad Hefta-Gaub
08babecb75 add support for mapping EntityPropertyFlags to QScriptValues and wire in desiredProps 2015-09-17 19:51:21 -07:00
Brad Hefta-Gaub
b16dfb8a9e whitespace repair 2015-09-17 17:41:54 -07:00
Brad Hefta-Gaub
81255c8379 whitespace repair 2015-09-17 17:40:41 -07:00
Brad Hefta-Gaub
6fac447b97 Merge branch 'master' of https://github.com/highfidelity/hifi into getEntityPropertiesPerformance
Conflicts:
	libraries/entities-renderer/src/EntityTreeRenderer.cpp
	libraries/entities-renderer/src/EntityTreeRenderer.h
	libraries/script-engine/src/ScriptCache.cpp
	libraries/script-engine/src/ScriptCache.h
2015-09-16 17:16:57 -07:00
Brad Hefta-Gaub
248107c468 add reload all support for entity scripts 2015-09-16 16:45:26 -07:00
Brad Hefta-Gaub
0a41ab2f41 Merge pull request #5827 from jherico/homer
fix ScriptEngine location property
2015-09-16 15:19:54 -07:00
Brad Davis
cbb8bee962 Trying to fix ScriptEngine location property 2015-09-16 15:00:24 -07:00
Stephen Birarda
5df7ce7424 fix for missing jurisdiction listener in Agent 2015-09-16 11:43:54 -07:00
Brad Hefta-Gaub
016a5e5f0a cleanup comments 2015-09-15 11:52:07 -07:00
Brad Hefta-Gaub
41caa36038 removed some debug code 2015-09-15 11:50:10 -07:00
Brad Hefta-Gaub
6521de8163 rework ScriptEngine and worker thread shutdown 2015-09-15 11:00:05 -07:00
Brad Hefta-Gaub
e92d195030 tweak 2015-09-14 21:18:36 -07:00
Brad Hefta-Gaub
54a45f3173 Merge branch 'master' of https://github.com/highfidelity/hifi into scriptEngineCleanup
Conflicts:
	libraries/entities-renderer/src/EntityTreeRenderer.cpp
	libraries/script-engine/src/ScriptEngine.cpp
	libraries/script-engine/src/ScriptEngine.h
2015-09-14 21:13:08 -07:00
Brad Hefta-Gaub
94b273a029 more work on script engine 2015-09-14 20:59:10 -07:00
Brad Hefta-Gaub
a3c0288eae more work on proper threading of ScriptEngine 2015-09-14 20:26:04 -07:00
Brad Hefta-Gaub
18fbf896f1 first cut at moving entity scripts into ScriptEngine 2015-09-14 15:13:43 -07:00
Seth Alves
49ee251238 quiet compiler 2015-09-12 09:59:25 -07:00
Brad Hefta-Gaub
56118e4204 migrate Agent to use standard APIs of ScriptEngine 2015-09-11 22:12:42 -07:00
Brad Hefta-Gaub
54c56a92f1 move agent specific code out of ScriptEngine 2015-09-11 21:56:00 -07:00
Brad Hefta-Gaub
8395fb6eff normalize how ScriptCache::getScript() works relative to ResourceManager 2015-09-11 21:24:39 -07:00
Brad Hefta-Gaub
f85cb2c888 first cut at cleaning up ScriptEngine class 2015-09-11 19:12:09 -07:00
Brad Hefta-Gaub
5c6d8da97b Revert "Make sure all entity script callbacks happen on the Entities script engine thread" 2015-09-11 11:55:36 -07:00
Brad Hefta-Gaub
b9d5412aad prevent sending signals in the entities script engine 2015-09-11 09:48:42 -07:00
Brad Hefta-Gaub
92a5a999c6 quiet some debug 2015-09-10 19:52:44 -07:00
Brad Hefta-Gaub
8eacdbf1c4 first cut at making sure entity scripts are called on the entities script engine thread 2015-09-10 13:02:02 -07:00
Brad Hefta-Gaub
f45e182d33 fix CR feedback, add examples 2015-09-10 09:06:56 -07:00
Brad Hefta-Gaub
ede0a39b5b prevent Script.include() from including the same file multiple times 2015-09-09 17:54:09 -07:00
Seth Alves
0c8848a463 don't update _lastSendJointData if we didn't send 2015-09-03 15:41:40 -07:00
Seth Alves
36ca789d92 fix differential avatar-joint sending to work if more than 2 avatars are in the domain 2015-09-03 14:08:04 -07:00
Seth Alves
76923583ee Interface only sends joint data to avatar-mixer if they have changed enough since the last send 2015-09-01 13:31:34 -07:00
Thijs Wenker
0e255f4f3e properly exposed WebSocketClass::ReadyState to the ScriptEngine 2015-08-22 01:59:44 +02:00
Thijs Wenker
d89ecc1e42 Move WebSocketServer to be accessable from Assignment-Client:Agent only. 2015-08-21 22:43:49 +02:00
Thijs Wenker
e43dc3f9fe Completed implementation of WebSocket and WebSocketServer 2015-08-18 03:21:48 +02:00
Thijs Wenker
7c77e0e941 initial WebSocketServer 2015-08-13 18:21:50 +02:00
Thijs Wenker
d10ae4a68d Merge branch 'master' of https://github.com/worklist/hifi into 20638 2015-08-07 21:43:32 +02:00
Thijs Wenker
25266b986c added basic implementation of WebSocket class ( https://developer.mozilla.org/en-US/docs/Web/API/WebSocket ) using QWebSocket 2015-08-07 21:43:14 +02:00
Andrew Meadows
0a5ada3c09 remove legacy shapes 2015-07-29 09:02:24 -07:00
Ryan Huffman
396bb613f8 Avoid creating a new variable in js print 2015-07-23 15:32:40 -07:00
Ryan Huffman
5f33ac5459 Update script print() to be variadic 2015-07-23 15:30:54 -07:00
Stephen Birarda
7a13c867ae quit the ScriptEngine thread once the script is done 2015-07-17 11:18:14 -07:00
Stephen Birarda
5a2d59c530 fix ScriptEngine cleanup for Agent 2015-07-15 15:07:34 -07:00
Atlante45
bbb00b9d3a Merge branch 'protocol' of https://github.com/birarda/hifi into protocol 2015-07-14 14:11:41 -07:00
Stephen Birarda
821c16cbc4 resolve conflicts on merge with uptream/master 2015-07-14 09:52:20 -07:00
Atlante45
c80df94b06 Update includes for moved files 2015-07-13 15:28:55 -07:00
Atlante45
957e6394a9 sendPacket function take Node& not a pointer 2015-07-13 11:57:20 -07:00
ZappoMan
a8a4c99529 on script shutdown, wait to process all pending edit messages before ending the script engine 2015-07-09 15:01:16 -07:00
Stephen Birarda
1b4e333c49 Merge pull request #3 from birarda/atp
initial networking API changes for new protocol
2015-07-09 16:51:37 -04:00
Stephen Birarda
2417981c9d resolve conflicts on merge with clement/protocol 2015-07-09 13:27:59 -07:00