Skip to content
Open
Changes from all commits
Commits
Show all changes
267 commits
Select commit Hold shift + click to select a range
76e5651
move opensim-viewer folder under opensim in distro
aymanhab May 2, 2025
dbec238
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab May 2, 2025
f8994b2
Fix path to server root
aymanhab May 2, 2025
e1e00a4
start page url change
aymanhab May 2, 2025
df12507
Update JettyMain.java
aymanhab May 3, 2025
74ecbab
Remove threejs folder/submodule
aymanhab May 5, 2025
2b43674
Revert "Remove threejs folder/submodule"
aymanhab May 5, 2025
fc611e2
use new branch on opensim-visualizer to keep old builds working
aymanhab May 5, 2025
1ba157e
commit opensim-viewer module
aymanhab May 6, 2025
a69837a
Build viewer on mac
aymanhab May 6, 2025
9f3bb9a
Update build script to move assets folder to top level
aymanhab May 6, 2025
a804152
Place assets one level up for easy access
aymanhab May 6, 2025
fd3b6e1
Attempt fix mac build
aymanhab May 6, 2025
e1a287f
Another attempt at copying assets folder rather than contents
aymanhab May 6, 2025
a2fb818
Move serverRootDir
aymanhab May 7, 2025
a9677d9
Remove extra copying of assets and fix linux build
aymanhab May 7, 2025
f58a41e
Update build.xml
aymanhab May 8, 2025
eb866fb
update viewer module
aymanhab May 9, 2025
f412a6b
Change log to summarize high level change to viewer
aymanhab May 12, 2025
0a2c2b2
Wire viewer to gui (#1551)
aymanhab May 12, 2025
0fafabc
update module
aymanhab May 15, 2025
846e5e9
Update module
aymanhab May 15, 2025
40e91e8
push viewer module
aymanhab May 16, 2025
346aac8
Merge branch 'wire_viewer_to_gui' into viewer_dev
aymanhab May 16, 2025
15c3235
Update viewer commit for snapshot options
aymanhab May 22, 2025
44eda09
update viewer with snapshot dialog commit
aymanhab Jun 3, 2025
2d12b62
Update viewer commit
aymanhab Jun 10, 2025
4db72a3
update viewer repo
aymanhab Jun 24, 2025
994ad09
Update opensim-viewer to merge in tree-components branch
aymanhab Jul 23, 2025
a8bd6c6
Update viewer module
aymanhab Jul 24, 2025
cd7ba7a
Upgrade module for viewer
aymanhab Aug 7, 2025
96c9927
update viewer module
aymanhab Aug 12, 2025
d3ba5b9
Update bindings
aymanhab Aug 13, 2025
9136014
Remove obsolete Wrap-Obst classes, also remove reference to forwardto…
aymanhab Aug 13, 2025
d5ffaaa
Update bindings
aymanhab Aug 13, 2025
06f88a3
Remove obsolete Wrap-Obst classes, also remove reference to forwardto…
aymanhab Aug 13, 2025
9e9e1ad
Update viewer module Dolly definition and animation works
aymanhab Aug 14, 2025
e0ac46c
Upgrade opensim-viewer module
aymanhab Aug 18, 2025
8da683f
Update continuous-integration.yml
aymanhab Aug 19, 2025
9fadf34
Update continuous-integration.yml
aymanhab Aug 19, 2025
4de7559
Update viewer module
aymanhab Aug 19, 2025
40e8a05
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab Aug 19, 2025
70a848a
Update viewer commit
aymanhab Aug 19, 2025
632eaa9
Upfate viewer repo
aymanhab Aug 25, 2025
e175aba
update viewer
aymanhab Aug 26, 2025
7f5485c
Update viewer
aymanhab Aug 26, 2025
c691d62
Update viewer
aymanhab Aug 26, 2025
f6aadf3
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab Aug 26, 2025
a3c0490
update viewer again
aymanhab Aug 27, 2025
49aedd0
update viewer
aymanhab Sep 2, 2025
dc25ba5
Start server early and extend timeout to handle large models
aymanhab Sep 2, 2025
fa20f88
update viewer with fix to camera add in tree
aymanhab Sep 2, 2025
82dbc4d
update viewer module
aymanhab Sep 4, 2025
b1df8b7
Update viewer commit
aymanhab Sep 4, 2025
2f17673
update viewer commit
aymanhab Sep 4, 2025
1ad2c19
send endAnimation message to viewer on pause
aymanhab Sep 5, 2025
7f517e4
Update viewer commit
aymanhab Sep 5, 2025
8a82b24
Uninstall cmake before installing packages
aymanhab Sep 5, 2025
743b47e
Fix build failure on ci due to CMake upgrade to version 4
aymanhab Sep 6, 2025
4f77341
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab Sep 6, 2025
9f44ea6
undo cmake version upgrade and add cli alternative
aymanhab Sep 6, 2025
3bc36e7
Free cmake version for Apple
aymanhab Sep 6, 2025
5ae9768
force min version 3.5
aymanhab Sep 6, 2025
c334750
cmake 3.5 to 4
aymanhab Sep 6, 2025
73477a8
Update Icon
aymanhab Sep 6, 2025
6e09c0d
Undo CMake version change
aymanhab Sep 6, 2025
4a4074f
no min cmake version
aymanhab Sep 7, 2025
6c69ae0
Cmake min version 3.5
aymanhab Sep 8, 2025
8ae16b4
Update opensim-models to use latest repo and update cmake min version
aymanhab Sep 8, 2025
b7ff5a0
Update viewer module to latest commit
aymanhab Sep 8, 2025
76e1c32
Merge branch 'main' of https://github.com/opensim-org/opensim-gui
aymanhab Sep 9, 2025
20f18c9
switch gui to new branch that is in sync with dev so future developme…
aymanhab Sep 11, 2025
198a3b8
Add caching for Netbeans installer on windows in CI workflow (#1558)
aymanhab Sep 11, 2025
90500c6
Update opensim-viewer module
aymanhab Sep 11, 2025
985d92e
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab Sep 11, 2025
5355e72
Update ui branding and viewer module
aymanhab Sep 12, 2025
8144b4a
Update ui branding and viewer module
aymanhab Sep 12, 2025
a509d02
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab Sep 12, 2025
19ba317
Modify NetBeans installation condition in CI workflow
aymanhab Sep 12, 2025
a15e197
Update viewer commit
aymanhab Sep 15, 2025
de23a67
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab Sep 15, 2025
acc1232
shorter timeout and update viewer
aymanhab Sep 15, 2025
14a5c9a
Disable transparency by default
aymanhab Sep 19, 2025
fb41d18
Turn debug on for now
aymanhab Sep 19, 2025
2b3cfcc
Update opensim-viewer commit
aymanhab Sep 19, 2025
5a64644
undo duplicated server initialization
aymanhab Sep 22, 2025
9b96776
Update viewer with dolly fixes
aymanhab Sep 22, 2025
a3a3e3b
upgrade viewer again with skySphere changes
aymanhab Sep 22, 2025
6c3a65b
Merge dolly fixes after review comments
aymanhab Sep 23, 2025
a82ae15
Undo debug messages
aymanhab Sep 24, 2025
55e88a9
Use fps from viewer to regulate frame rate, adjust gui side accordingly
aymanhab Sep 24, 2025
fb1fb4b
Update viewer
aymanhab Sep 24, 2025
7578afa
Enable transparency for bones and contacts nothing else
aymanhab Sep 26, 2025
c212d43
try fix permissions on install for mac
aymanhab Sep 30, 2025
17882e7
Update viewer module
aymanhab Sep 30, 2025
e060310
update viewer
aymanhab Sep 30, 2025
6dca976
Update visualizer module with url parameters
aymanhab Sep 30, 2025
cfa3e59
Use dev branch rather than dev-gui branch
aymanhab Sep 30, 2025
660214e
Update viewer-commit
aymanhab Oct 1, 2025
c14de06
Update commit
aymanhab Oct 1, 2025
c4c5bc8
Update jxbrowser commit
aymanhab Oct 1, 2025
b4f7c14
Separate option to modify opacity so that muscles are not transparent…
aymanhab Oct 9, 2025
50dca4a
Use Scrollpane and embedded panel to handle long list of coordinates,…
aymanhab Oct 9, 2025
7d99126
Update viewer commit
aymanhab Oct 10, 2025
85aacd6
Update macOS runner version in CI workflow
aymanhab Oct 12, 2025
7a0d24c
Downgrade macOS version in CI workflow
aymanhab Oct 12, 2025
5b13e54
Update viewer commit to default to mp4 video format
aymanhab Oct 13, 2025
5bece51
Merge branch 'wire_viewer_to_gui' of https://github.com/opensim-org/o…
aymanhab Oct 13, 2025
d52db56
jxbrowser7 api calls
aymanhab Oct 16, 2025
62ed03e
Merge branch 'main' into wire_viewer_to_gui_jxbrowser7
aymanhab Oct 16, 2025
5cdc1f9
Update CI workflow to use NetBeans 17 on windows
aymanhab Oct 16, 2025
fa7281b
Upgrade macOS version and NetBeans installation
aymanhab Oct 16, 2025
04815b8
java source version 1.8 as earlier are deprecated in netbeans 17
aymanhab Oct 16, 2025
0ec7968
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
aymanhab Oct 16, 2025
728e210
Add jxBrowser JAR download steps to CI workflow on osx
aymanhab Oct 16, 2025
797939f
Update jxbrowser download commands in CI
aymanhab Oct 16, 2025
115d32d
Modify jxBrowser download and add copy command
aymanhab Oct 16, 2025
5d78462
Modify jxbrowser download steps in CI configuration
aymanhab Oct 16, 2025
bbe5697
List folder contents after downloading JXBrowser jars
aymanhab Oct 16, 2025
809b05d
Modify jxbowserJars download step in CI workflow
aymanhab Oct 16, 2025
818bc0c
Refactor CI workflow to streamline folder listing
aymanhab Oct 16, 2025
78aa75e
Update folder listing command in CI workflow
aymanhab Oct 16, 2025
53c59ba
Remove redundant folder contents listing step
aymanhab Oct 16, 2025
f83329d
Update CI workflow to list contents of opensim-visualizer
aymanhab Oct 17, 2025
5488e4c
Update CI workflow to use new branch reference
aymanhab Oct 17, 2025
97993a2
Upgrade opensim-visualizer commit
aymanhab Oct 17, 2025
1e9d7e7
Clean up CI workflow by removing unused steps
aymanhab Oct 17, 2025
c60ebfe
Upgrade opensim-visualizer commit
aymanhab Oct 17, 2025
5606f05
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
aymanhab Oct 17, 2025
c3e865f
update commit to fix build.xml
aymanhab Oct 17, 2025
d28e905
remove clutter from local file system
aymanhab Oct 17, 2025
74cef36
update browser module commit
aymanhab Oct 17, 2025
130d0dd
Upgrade macOS runner to version 15
aymanhab Oct 17, 2025
b9622ee
Update JDK version and fix conditional statements on osx
aymanhab Oct 17, 2025
6d5bcb5
Update JDK version to 1.11 in CI workflow
aymanhab Oct 17, 2025
fad5573
Update CI configuration for macOS and JDK version
aymanhab Oct 17, 2025
c90555f
Not deleting jar files to avoid qccidentally deletion of jxbrowser ja…
Oct 18, 2025
a3092a9
no jre on osx
Oct 18, 2025
431bf41
manual copy of jar files remove broken updater and new modules broken…
Oct 18, 2025
1f99922
jar folder fix for osx
Oct 18, 2025
58f2093
jar folder fix for osx
Oct 18, 2025
f939214
jar folder fix for osx
Oct 19, 2025
15df3ed
update opensim-visualizer commiti
Oct 19, 2025
dfa10e2
Remove jxbrowser jar copy task from build-mac-installer
aymanhab Oct 19, 2025
0903246
Update visualizer commit and tweak build script
aymanhab Oct 21, 2025
db859ed
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
aymanhab Oct 21, 2025
e87072a
Update commit
aymanhab Oct 21, 2025
3e18e90
undo jdk11 hardcode
aymanhab Oct 21, 2025
d8528b1
disable janitor module
aymanhab Oct 22, 2025
6a0b34d
Try fix permissions on osx
aymanhab Oct 22, 2025
5398f13
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
aymanhab Oct 22, 2025
046e127
add back janitor
Oct 22, 2025
25cc74d
Update opensim-visualizer commit
aymanhab Oct 22, 2025
daa6798
Entry points to play and interact with animations from viewer
aymanhab Oct 30, 2025
6d072cc
USe timestep passed in from viewer to regulate frame generation, send…
aymanhab Nov 3, 2025
0f997cc
chown of viewer folder
Nov 4, 2025
4671174
Update THREEJS_EDITOR_DIR path in postinstall script
aymanhab Nov 4, 2025
52c6fbd
Update GUI and viewer commit
aymanhab Nov 4, 2025
dd1daa2
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
aymanhab Nov 4, 2025
0ca8d15
Fix rate of sending frames from GUI to viewer
aymanhab Nov 10, 2025
9be26d2
Handle Animation messages to start animation and set frame rate
Nov 24, 2025
c76d595
Merge and fix GUI to handle messages from viewer
Nov 24, 2025
528672a
add frameNumer and frameAck messages to regulate communication with v…
Nov 25, 2025
652afe8
update viewer with fixes
Nov 26, 2025
d8516d7
update viewer commit
Nov 27, 2025
3c8ab50
Add directory listings in CI workflow
aymanhab Dec 16, 2025
3a30fbd
Fix paths for module directory listings in CI
aymanhab Dec 16, 2025
60cf826
Merge branch 'main' of https://github.com/opensim-org/opensim-gui
aymanhab Dec 20, 2025
834f002
Change path for Visual C++ redistributable installer
aymanhab Jan 19, 2026
6c64f9f
Update Visual C++ redistributable installer path
aymanhab Jan 19, 2026
baaff9f
Fix variable reference for redistributable installer
aymanhab Jan 19, 2026
d44de6f
Download VC++ Redistributable in CI process
aymanhab Jan 19, 2026
affcf2f
Send string rather than ping to clients
Jan 20, 2026
fb1cc54
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
Jan 20, 2026
ef22873
create animation clips from Animations to send to viewer
Jan 21, 2026
98b86e9
Create and send messages to viewer with animation clips and to commun…
aymanhab Jan 24, 2026
b606443
Send Com trajectory as a separate animation track
aymanhab Jan 25, 2026
3b2efbd
Simplify passing animations to viewer by adding them as motions are l…
aymanhab Jan 25, 2026
3d571cf
Remove now unused variables and functions
aymanhab Jan 26, 2026
737fcc7
Minor cleanup, associate path color with first pathpoint as it gets p…
aymanhab Jan 27, 2026
47a65b6
Support for associate marker data, fix coloring paths and support mov…
aymanhab Jan 27, 2026
51c5942
Use ModelCom rather than Com so name is unique and animation of COM w…
aymanhab Jan 29, 2026
25cc357
Merge branch 'main' into wire_viewer_to_gui_jxbrowser7
aymanhab Jan 29, 2026
3c36285
Merge remote-tracking branch 'remotes/origin/main' into wire_viewer_t…
aymanhab Jan 30, 2026
f589189
Stop playback in reverse when start time is non-zero
aymanhab Jan 30, 2026
f59b8a0
Handle muscle wrapping, tested with arm26 BRA
aymanhab Jan 30, 2026
cc582f6
Fix handling of pathwrapping in animation clips
aymanhab Feb 2, 2026
c340eb8
Delegate creation of AnimationClip tracks to individual subtypes, imp…
aymanhab Feb 4, 2026
6a6413c
Change color spectrum for muscles to approximate earlier version usin…
aymanhab Feb 4, 2026
8f3d3df
Merge branch 'pass_animations_viewer' into wire_viewer_to_gui_jxbrowser7
aymanhab Feb 5, 2026
c51bc60
Update opensim-viewer module commit
aymanhab Feb 5, 2026
5067c27
Update core bindings
aymanhab Feb 6, 2026
f97794e
Unlock coordinates while generating the animation clip
aymanhab Feb 6, 2026
d72442e
Notify observers of time change so plotter tick updates while playback
aymanhab Feb 6, 2026
38521c1
Color muscles from file now working for animation clips
aymanhab Feb 6, 2026
3876950
Remove debugging lines by default to reduce clutter
aymanhab Feb 9, 2026
a7ec134
Update opensim-viewer commit to latest on dev branch
aymanhab Feb 9, 2026
e6300d0
Add MeyerFregly2016Muscle and avoid writing debugging file
aymanhab Feb 10, 2026
a67240d
Add precompiled jxbrowser7 setup in CI workflow
aymanhab Feb 10, 2026
2cb8aa2
Refactor cache conditions and file handling in CI
aymanhab Feb 11, 2026
10dc7ac
Update opensim-visualizer repo
aymanhab Feb 11, 2026
6b42e70
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
aymanhab Feb 11, 2026
b2a632e
Undo jxbrowser hack in ci
aymanhab Feb 11, 2026
ac3d024
update opensim-visualizer commit
aymanhab Feb 11, 2026
657566e
Fix conditional for building opensim-core
aymanhab Feb 11, 2026
ff00f5c
Try again to update opensim-visualizer commit
aymanhab Feb 11, 2026
1d673e6
download jxbrowser jar after build to avoid it being overwritten
Feb 12, 2026
d8267b1
Rename MSVC_REDIST variable to msvc.redist.exe
aymanhab Feb 12, 2026
f282970
Update CI workflow for VC++ Redistributable download
aymanhab Feb 12, 2026
3f9e37c
Fix conditional statements in CI workflow
aymanhab Feb 12, 2026
9e7159e
Upgrade opensim-viewer for selection bugfix
aymanhab Feb 12, 2026
0fd4427
Merge branch 'wire_viewer_to_gui_jxbrowser7' of https://github.com/op…
aymanhab Feb 12, 2026
98221c5
Correct if condition for Netbeans installation
aymanhab Feb 12, 2026
085860f
Upgrade JDK setup from 1.8 to 11 on windows
aymanhab Feb 12, 2026
9129a0f
Add MSVC redistributable path to CI configuration
aymanhab Feb 12, 2026
c34becb
remove erroneous ls command from build script
aymanhab Feb 13, 2026
2a2ab26
Copy browser jar with correct license on windows
aymanhab Feb 13, 2026
c664d38
Fix dependencies for unzip-distro target
aymanhab Feb 13, 2026
53a6ea5
Merge branch 'main' of https://github.com/opensim-org/opensim-gui
aymanhab Mar 3, 2026
87e0a6a
Send AnimationSpeed update message on spinner change
aymanhab Mar 4, 2026
c330a79
Remove debugging info dump by default
aymanhab Mar 5, 2026
df089cd
Send animationtime rather than full frames when scrubbing
aymanhab Mar 5, 2026
dcd7df5
Entry for visualizer in CHANGELOG.md
aymanhab Mar 7, 2026
d9670e3
Let branch be default based on github PRs rather than hardcoded
aymanhab Mar 7, 2026
f87149a
Opensim 46 fixes (#1597)
aymanhab Mar 9, 2026
bb118e9
Use new splash png file (#1600)
aymanhab Mar 9, 2026
8a3efcf
Update continuous integration script for JAR copying platform-specifi…
AlbertoCasasOrtiz Mar 12, 2026
fb16377
Update viewer commit (#1601)
aymanhab Mar 12, 2026
7656a46
Patch ci for 46 (#1605)
aymanhab Mar 17, 2026
c3a6a31
Update viewer commit with recording fix (#1606)
aymanhab Mar 19, 2026
21c7e41
Update opensim-visualizer commit (#1607)
aymanhab Mar 20, 2026
176fd10
send message to viewer to update animationLoop behavior from GUI
aymanhab Mar 25, 2026
e67d615
Use different branch for opensim-viewer
aymanhab Mar 25, 2026
99cc5fe
Update viewer commit with fixes for video recording
aymanhab Mar 25, 2026
fc1ea02
Update opensim-viewer commit
aymanhab Mar 26, 2026
4e786ee
Refresh viewer dev branch commit
aymanhab Mar 26, 2026
e23e46d
Apply suggestion from @Copilot
aymanhab Mar 27, 2026
9ffd776
Apply suggestion from @Copilot
aymanhab Mar 27, 2026
3ad77e9
send message to viewer to update animationLoop behavior from GUI (#1612)
aymanhab Mar 27, 2026
0477b06
Fix typo in another method name and remove deprecated unused method
aymanhab Mar 27, 2026
e2b2b78
Merge remote-tracking branch 'remotes/origin/opensim_46_guifixes' int…
aymanhab Mar 27, 2026
2464890
Fix viewer looping behavior with multiple motions (#1614)
aymanhab Apr 11, 2026
198972a
Merge branch 'main' into opensim_46
aymanhab Apr 11, 2026
5382b75
Update GUI branch to use viewer opensim_46 branch
aymanhab May 7, 2026
87059c0
Opensim 46 beta fixes core 46 branch (#1643)
aymanhab Jul 10, 2026
31e1e8e
update swig bindings before merging
aymanhab Jul 20, 2026
3b1dd63
Add support for ScholzGeometryPath ignoring wrapping for now
aymanhab Jul 21, 2026
0eddbcd
Merge branch 'main' into visualize_scholzpath
aymanhab Jul 23, 2026
9479ca3
Refactor CMake build commands in CI workflow
aymanhab Jul 23, 2026
171e8f4
fix merge error
aymanhab Jul 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 87 additions & 16 deletions Gui/opensim/view/src/org/opensim/threejs/ModelVisualizationJson.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.openide.util.Exceptions;
import org.opensim.modeling.AbstractGeometryPath;
import org.opensim.modeling.AbstractOutput;
import org.opensim.modeling.AbstractPathPoint;
import org.opensim.modeling.AbstractProperty;
Expand Down Expand Up @@ -73,6 +74,7 @@
import org.opensim.modeling.PropertyHelper;
import org.opensim.modeling.Quaternion;
import org.opensim.modeling.Rotation;
import org.opensim.modeling.Scholz2015GeometryPath;
import org.opensim.modeling.State;
import org.opensim.modeling.StatesTrajectory;
import org.opensim.modeling.Storage;
Expand Down Expand Up @@ -142,7 +144,7 @@ public void setShowCom(boolean showCom) {
private JSONObject pathPointGeometryJSON = null;
private JSONObject editablePathPointGeometryJSON = null;
private JSONObject marker_mat_json;
public static boolean verbose=false;
public static boolean verbose=true;
private boolean ready = false;
private static final HashMap<String, Boolean> movableOpensimTypes = new HashMap<String, Boolean>();
public final ArrayList<MotionDisplayer> motionDisplayers = new ArrayList<MotionDisplayer>();
Expand Down Expand Up @@ -537,16 +539,27 @@ private void processDecorationsForComponent(Component comp) {
visualizerFrames.put(ownerFrame, vf);
}
}
GeometryPath gPath = GeometryPath.safeDownCast(comp);
boolean isGeometryPath = (gPath!=null);
if (isGeometryPath){
if (debug_path)
System.out.println("Creating Json for GeometryPath of "+gPath.getOwner().getName());
UUID pathUUID = createJsonForGeometryPath(gPath, visibleStatus, null);
pathList.put(gPath, pathUUID);
// Add to the ID map so that PathOwner translates to GeometryPath
Component parentComp = gPath.getOwner();
addComponentToUUIDMap(parentComp, pathUUID);
AbstractGeometryPath aPath = AbstractGeometryPath.safeDownCast(comp);
boolean isPath = (aPath!=null);
if (isPath){
GeometryPath gPath = GeometryPath.safeDownCast(comp);
if (gPath!=null){
if (debug_path)
System.out.println("Creating Json for GeometryPath of "+gPath.getOwner().getName());

UUID pathUUID = createJsonForGeometryPath(gPath, visibleStatus, null);
pathList.put(gPath, pathUUID);
// Add to the ID map so that PathOwner translates to GeometryPath
Component parentComp = gPath.getOwner();
addComponentToUUIDMap(parentComp, pathUUID);
}
else {
Scholz2015GeometryPath sPath = Scholz2015GeometryPath.safeDownCast(comp);
System.out.println("Creating Json for GeometryPath of "+sPath.getOwner().getName());
UUID pathUUID = createJsonForScholzPath(sPath, visibleStatus, null);
//pathList.put(sPath, pathUUID);
addComponentToUUIDMap(comp, pathUUID);
}
}
else{
adg.clear();
Expand Down Expand Up @@ -1480,7 +1493,7 @@ public void setTransformWRTScene(Transform transformWRTScene) {
private final HashMap<UUID, ComputedPathPointInfo> computedPathPoints = new HashMap<UUID, ComputedPathPointInfo>();
private final HashMap<GeometryPath, JSONArray> pathsWithWrapping = new HashMap<GeometryPath, JSONArray>();
// Keep track if PathPoints are displayed/enlarged to sync. UI and to keep across edits
private final HashMap<GeometryPath, Boolean> pathDisplayStatus = new HashMap<GeometryPath, Boolean>();
private final HashMap<AbstractGeometryPath, Boolean> pathDisplayStatus = new HashMap<>();
// GeometryPath has material (with Skinning) and another material without Skinning for PathPoints
// this Map maintains the mapping so the colors can stay in sync.
private final HashMap<OpenSimObject, UUID> mapGeometryPathToPathPointMaterialUUID =
Expand Down Expand Up @@ -1846,9 +1859,67 @@ else if (secondIndex == -1){ // Conditional Path point that's inactive
return mesh_uuid;
}

private UUID createPathPointMaterial(GeometryPath path) {
private UUID createJsonForScholzPath(Scholz2015GeometryPath path, boolean visible, UUID reuse_uuid){
UUID mat_uuid = createPathMaterial(path);
UUID pathpt_mat_uuid = createPathPointMaterial(path);
// Cycle through pathElements and create reps for points, #NUM_WRAP_POINTS for each obstacle
// for now these are notr exposed and we don't know how to get them so will just assume no wrapping
// to explore downstream issues
JSONArray pathpoint_jsonArr = new JSONArray();
// Keep track of First path point so that when changing color we can propagate to all path points, since they share material
// Also so that when adding pathpoints due to wrapping, we can get proper/shared material
mapGeometryPathToPathPointMaterialUUID.put(path, pathpt_mat_uuid);
// Fix issue #2569 where moving pathpoint is not handled properly if first in path
int nPts = path.getNumPathPoints();
for (int iE=0; iE < nPts; iE++){
PathPoint ppt = path.getPathPoint(iE);
UUID pathpoint_uuid = addPathPointObjectToParent(ppt, pathpt_mat_uuid.toString(), visible);
addComponentToUUIDMap(ppt, pathpoint_uuid);
pathpoint_jsonArr.add(pathpoint_uuid.toString());
}
JSONObject pathGeomJson = new JSONObject();
UUID uuidForPathGeomGeometry = UUID.randomUUID();
pathGeomJson.put("uuid", uuidForPathGeomGeometry.toString());
pathGeomJson.put("type", "CylinderGeometry");
pathGeomJson.put("radiusTop", actualMuscleDisplayRadius);
pathGeomJson.put("radiusBottom", actualMuscleDisplayRadius);
pathGeomJson.put("height", 0.01);
pathGeomJson.put("radialSegments", 4);
pathGeomJson.put("heightSegments", 2*(pathpoint_jsonArr.size()-1)-1);
pathGeomJson.put("openEnded", true);
// height, radialSegments, heightSegments, openended
pathGeomJson.put("name", path.getName()+"Control");
if (reuse_uuid == null) {
json_geometries.add(pathGeomJson);
}
// Now the object/mesh to connect the geometry, material
JSONObject gndJson = mapBodyIndicesToJson.get(0);
if (gndJson.get("children")==null)
gndJson.put("children", new JSONArray());
JSONArray gndChildren = (JSONArray) gndJson.get("children");
Map<String, Object> obj_json = new LinkedHashMap<String, Object>();
UUID mesh_uuid = (reuse_uuid==null)? UUID.randomUUID(): reuse_uuid;
obj_json.put("uuid", mesh_uuid.toString());
obj_json.put("type", "GeometryPath");
obj_json.put("name", path.getName());
obj_json.put("points", pathpoint_jsonArr);
obj_json.put("active", pathpoint_jsonArr);
obj_json.put("geometry", uuidForPathGeomGeometry.toString());
obj_json.put("userData",JSONUtilities.createUserDataObject("Path", false));
gndChildren.add(obj_json);
// Create json entry for material (path_material) and set skinning to true
obj_json.put("material", mat_uuid.toString());
if (!visible){ // path-belly = cylinder
obj_json.put("visible", false);
}
pathDisplayStatus.put(path, true);
return mesh_uuid;


}
private UUID createPathPointMaterial(AbstractGeometryPath path) {
// Repeat for pathpointMaterial
Map<String, Object> pathpt_mat_json = new LinkedHashMap<String, Object>();
Map<String, Object> pathpt_mat_json = new LinkedHashMap<>();
UUID pathpt_mat_uuid = UUID.randomUUID();
pathpt_mat_json.put("uuid", pathpt_mat_uuid.toString());
populatePathMaterialDefaults(pathpt_mat_json, path);
Expand All @@ -1857,7 +1928,7 @@ private UUID createPathPointMaterial(GeometryPath path) {
return pathpt_mat_uuid;
}

private UUID createPathMaterial(GeometryPath path) {
private UUID createPathMaterial(AbstractGeometryPath path) {
// Create material for path, pathpts
Map<String, Object> mat_json = new LinkedHashMap<String, Object>();
UUID mat_uuid = UUID.randomUUID();
Expand Down Expand Up @@ -1897,7 +1968,7 @@ private void calculateWrapPointsToVisualzerPointsMapping(int firstIndex, int sec
}
}

private void populatePathMaterialDefaults(Map<String, Object> mat_json, GeometryPath path) {
private void populatePathMaterialDefaults(Map<String, Object> mat_json, AbstractGeometryPath path) {
mat_json.put("type", "MeshStandardMaterial");
Vec3 pathColor = path.getDefaultColor();
String colorString = JSONUtilities.mapColorToRGBA(pathColor);
Expand Down
Loading