[x3d-public] [cad] aopt options for SRC conversions

vmarchetti at kshell.com vmarchetti at kshell.com
Fri Oct 13 09:52:41 PDT 2017


aopt will also prepare .glb  (glTF binary extension) files using an option -Y "binaryGLTFVersion(1.0)"
What this does is read in an X3D file, write a .glb file for each IndexedTriangleSet node, and then output an .html file with the X3DOM markup in which
those meshes are imported into the X3D scene using the ExternalShape node -- ExternalShape is part of X3DOM, not standard X3D.

This is discussed in a github issues thread: https://doc.x3dom.org/tutorials/models/aopt/ ; look for the comment by user bmegli on Dec 28 2016

And for those working on MacOS, the aopt executable is distributed in the InstantPlayer.app bundle, you can execute it from the command line at filepath 
Instant Player.app/Contents/MacOS/aopt

Vince Marchetti


> On Oct 13, 2017, at 12:17 PM, Don Brutzman <brutzman at nps.edu> wrote:
> 
> @Web3dConsortium had an inquiry via Twitter regarding aopt converter, in response to
> 
> 	" Thomas Paviot briefs @pythonocc to #X3D CAD Working Group #X3DOM documentation, aopt/SRC binary, compare performance https://threejs.org "
> 	https://twitter.com/Web3DConsortium/status/817047832016220160
> 
> momo @Momo_LeCousin asked "hi i want to have info about the aopt/SRC binary could you help me just want to use aopt to export in SRC ... i don't find the right command"
> 
> Initial responses:
> 
> 1.aopt online at http://doc.instantreality.org/tools/x3d_encoding_converter
> 
> 2. Executable binary is included in InstantReality distribution. Under windows, "aopt.exe" on command line for help
> 
> ============================================================
> ============================================================
> C:\Program Files\Instant Reality\bin> aopt
> 
> LOG     Avalon   Init: 24/449, V2.8.0 build: R-36098 Jul 27 2016 Windows x86_64
> License has no 'hub/aopt' feature!
> WARNING Avalon   Unable to acquire license for feature hub/aopt
> ===============================================================================
> ! Unlicensed Version: limited functionality and only for non-commercial use !
> ===============================================================================
> 
> Command Line: C:\Program Files\Instant Reality\bin\aopt.exe
> Name:        aopt (avalon optimizer; www.instantreality.org)
> SYNOPSIS:    aopt [OPTION] [PARAMS] ...
> DESCRIPTION: Command line tool to optimize and convert
>             vrml/x3d/avalon files with different encodings
>             (e.g. classic/xml/binary with/without compression)
> ERROR:       Returns 0 on succes and <0 on error
>             (-1: NO_PARAM, -2: INVALID_SUBCALL: -3: INVALID_DATA)
> USAGE:
>  -A: convert Interpolators and Routes to TimedAnimationContainer
>  -B: inlines image files as data URLs into the scene
>  -C: create a node in DEFed parent or (if no parent found) in all nodes of this type
>  -D: Collect all leafs into a remote selection group
>  -E: create a DEFS for the given types
>  -F: create flatten and merged tree
>  -G: Transform PrimitiveSet to BinaryGeometry, [binPath]:[gen params]:[bbox]
>  -H: print osg GraphOpSeq usage
>  -I: read/write backend image; input:output
>  -J: print mesh statistics on full scene, optional filename for HTML output file
>  -K: Transform PrimitiveSet to POPGeometry, [binPath]:[gen params]:[bbox]
>  -L: print hostID to use for license
>  -M: writes data to given xhtml filename for X3DOM, can be '-' for stdout
>  -N: writes data to given html filename[:serverBase] for X3DOM, can be '-' for stdout
>  -O: add a prefix to all node names for making them unique
>  -P: deletes all PROTOs without a body
>  -Q: set global parameters for following operations
>  -R: runs a given script on the scene
>  -S: read/write backend scene; input:output[:GraphOpSeq]
>  -T: texture export path and suffix
>  -U: write output without any USE
>  -V: creates a viewall viewpoint
>  -W: writes data to given HSI folder
>  -X: defines the number of max elem per field for XML-attrib-encoding
>  -Y: Externalize data to SRC files, [binPath]
>  -a: set tree state to live and sync
>  -b: writes data to given binary X3D filename, can be '-' for stdout
>  -c: create a 'Toggler' Controller for every TimeSensor
>  -d: deletes all node[s] by DEF-Name or Type[:Field:Value/[]] or [ParentType:]Type
>  -e: exports the backend tree to the given fileName[:GraphOpSeq]
>  -f: set Type:Field:Value for all objects
>  -g: Transform PrimitiveSet to ImageGeometry, [texPath]:[gen params]:[bbox]
>  -h: print usage
>  -i: input url, can be '-' for stdin
>  -j: Exports all url resources to a local folder
>  -k: copies all textures with relative filesystem URLs into folder aopt is called from
>  -l: removes leafs of the given types
>  -m: attach TextureCoordinateGenerator with mode/ params
>  -n: removes invalid (negative) scale from Transform nodes
>  -o: deletes every extra link to the same parent
>  -p: print all node types and opt count
>  -q: resolves Inline nodes and merges subgraphs into scenegraph directly
>  -r: create a reverse TimeSensor/ScalarInterpolator pair for every TS
>  -s: Transform IndexedFaceSets to IndexedTriangleStripSets
>  -t: Transform PrimitiveSet to single index IndexedTriangleSet
>  -u: removes all equal (with equal field values) nodes; creates DEF/USE
>  -v: writes the data to the given VRML filename, can be '-' for stdout
>  -w: Replaces all matrix transform in the scene with standard transforms
>  -x: writes data to given X3D filename, can be '-' for stdout
>  -y: removes all TextureCoordinates if no Texture defined
>  -z: write output with gzip compression
> Unused Opt:
> EXAMPLE:
>  1) Print some information about the scene and quit
>     #aopt -i foo.x3d -p
>  2) Convert a vrml file to a x3d-xml file:
>     #aopt -i foo.wrl -x foo.x3d
>  3) Convert a x3d-xml file to a x3d-binary with compression
>     #aopt -i foo.x3d -z -b foo.x3db
>  4) Delete all Switch Nodes, create DEF/USE and write binary
>     #aopt -i foo.wrl -d Switch -u -b foo.x3db
>  5) Read a file; switch all light off; and write the file
>     #aopt -i foo.x3d -f Light:on:FALSE -x foo.x3d
>  6) Read/Write from pipes; create tri-strips
>     #cat foo.x3d | aopt -i -:model/x3d -s -b - > foo.x3db
> 
> Error: no parameters.
> ============================================================
> ============================================================
> 
> Seems to have broad value, further responses welcome.
> 
> all the best, Don
> -- 
> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
> 
> _______________________________________________
> cad mailing list
> cad at web3d.org
> http://web3d.org/mailman/listinfo/cad_web3d.org




More information about the x3d-public mailing list