Skip to content

Commit

Permalink
Merge pull request #47 from rdeits/asset-registry
Browse files Browse the repository at this point in the history
switch to AssetRegistry
  • Loading branch information
rdeits authored Jun 23, 2018
2 parents e1cd011 + 1e55486 commit 4048013
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ BinDeps 0.8.7

# Communication
MsgPack 0.1.1
WebIO 0.1.8
WebIO 0.2.0
Mux 0.2.3
JSExpr 0.1.0
AssetRegistry 0.0.1
9 changes: 8 additions & 1 deletion src/MeshCat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ __precompile__()
module MeshCat

using WebIO
import AssetRegistry
using GeometryTypes, CoordinateTransformations
using Rotations: rotation_between, Rotation
using Colors: Color, Colorant, RGB, RGBA, alpha
using StaticArrays: StaticVector, SVector, SDiagonal
using GeometryTypes: raw
using Parameters: @with_kw
using Base.Random: UUID, uuid1
using DocStringExtensions
using DocStringExtensions: SIGNATURES
using JSExpr: @js, @new, @var
using Base.Filesystem: rm
using BinDeps: download_cmd, unpack_cmd
Expand Down Expand Up @@ -90,4 +91,10 @@ function develop_meshcat_assets(skip_confirmation=false)
rm(joinpath(meshcat_dir, "..", "meshcat.stamp"))
end

const ASSET_KEYS = String[]

function __init__()
push!(ASSET_KEYS, AssetRegistry.register(abspath(joinpath(VIEWER_ROOT, "main.min.js"))))
end

end
6 changes: 1 addition & 5 deletions src/visualizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ mutable struct CoreVisualizer
controls::Dict{String, Tuple{Observable, AbstractControl}}

function CoreVisualizer()
scope = WebIO.Scope(
imports=[
"pkg/MeshCat/meshcat/dist/main.min.js"
]
)
scope = WebIO.Scope(imports=ASSET_KEYS)
command_channel = Observable(scope, "meshcat-command", UInt8[])
request_channel = Observable(scope, "meshcat-request", "")
controls_channel = Observable(scope, "meshcat-controls", [])
Expand Down

0 comments on commit 4048013

Please sign in to comment.