Summary by Kiril
We can control the IS through the Browser Console with a public API that could Get Current Step, Set Rotation, Get Rotation, Reorder Steps. We have delivered instructions generated from SolidWorks in the latest implementation of IS and IC. It is possible for every author to create a custom animation for their instructions using Blender.
Table of contents
- [IC-1.2] Project general
- [IS-6.0] Show a loading progress
- [IS-6.0-Fredi] Show the number of the step in the Steps Tree Viewer
- [IS-6.0-Fredi] Extract the listeners from global dev to is-global_iterator-dev and is-core-dev
- [IS-6.0-Fredi] Prepare an API for setting rotation of the steps directly in the browser while looking at the instructions
- [IS-6.0-Fredi] Prepare an edit functionality for Instructions Authors
- [IS-6.0-Fredi] Create thumbnail for Fredi material
- [IS-6.0] Fix event documentation
[IC-1.2] Project general
We have new architecture, workflow to create and deliver Animations, generate Preview, migrated to Blender 2.81a, updated the structure of the map, some bug fixes and some other minor improvements. In total 20 cards were finished
Highlights
-
We now have a workflow to create Animations:
- Take the source (for example https://s3.amazonaws.com/fllcasts/materials/srcs/000/000/248/9311b62bb6891096c60eb43d272a28ac511f8427/ActiveAttachmentTop.zip) of a material and using the ISExportforBlenderAnimation build you create a blend file with armature ready for animation.
- Using Blender create an animation. Name the blend file with the number of the step you want the animation to be played on.
- Add the created blend file to the source of the material.
- Build the material.
- Feel proud of the great instruction you have created.
Note: Currently, just one Animation can be appended to the Instruction. We have planned to allow more.
-
Preview is now generated for gltf files. The cool thing is that the whole map is delivered, but the geometry is removed from the steps outside of the preview. This way you feel like you have the whole instruction but you do not. This should increase purchase interest. Example -> https://www.fllcasts.com/materials/882-kiddo-the-compact-roller-coaster-box-robot-for-robotics-competitions.
[IS-6.0] Show a loading progress
When a file is being loaded the user is being showed a progress bar.
[IS-6.0-Fredi] Show the number of the step in the Steps Tree Viewer
The step number is now currently displayed in the is-stepstreeeditor
You can open an instruction like https://www.fllcasts.com/materials/846-bag-3-from-first-lego-league-2019-2020-city-shaper-challenge and in the Bill of Materials section you will see the tree with the step number
[IS-6.0-Fredi] Extract the listeners from global dev to is-global_iterator-dev and is-core-dev
There is a new GlobalIterator-Dev extension available at:
https://sf.robopartans.com/jenkins/view/IS/job/is-global_iterator-dev%20Build%20and%20Release/
This is its documentation
https://sf.robopartans.com/jenkins/view/IS/job/is-release_pack%20Build%20and%20Release/ws/docs/IS.GlobalIterator.Dev.GlobalIteratorListener.html
[IS-6.0-Fredi] Prepare an API for setting rotation of the steps directly in the browser while looking at the instructions
I have prepared an API call with which eng. Mitaka could rotate the steps. You can also see the rotation of the step.
UI is to follow. The call is
Set rotation
To execute the script
1. Open an instructions in SDK mode -> https://www.fllcasts.com/materials/846-bag-3-from-first-lego-league-2019-2020-city-shaper-challenge?mode=sdk
2. Open browser dev console
3. Type in
function r(rotation, stepNumber=undefined) {
const globalIterator = window["IS.GlobalIterator.Dev.GlobalIteratorListener"]["globalIterator"]
const scene = window["IS.BabylonScene.Dev.SceneListener"]["scene"]
const container = window["IS.GlobalIterator.Dev.GlobalIteratorListener"]["stepsContainer"]
if(stepNumber == undefined) {
stepNumber = globalIterator.getCurrentIndex()+1;
}
const stepName = container.get(stepNumber-1).getId()
const metadata = scene.getNodeByID(stepName).metadata
metadata.gltf.extras = (metadata.gltf.extras === undefined) ? {} : metadata.gltf.extras;
metadata.gltf.extras.ai3d = (metadata.gltf.extras.ai3d === undefined) ? {} : metadata.gltf.extras.ai3d;
metadata.gltf.extras.ai3d.rotation=rotation
const core = IS.AxlesIS.GetInstance().getCore();
core.scheduleNotify({"triedMoveIterator": new IS.GlobalIterator.TriedMoveEvent(1)})
core.scheduleNotify({"triedMoveIterator": new IS.GlobalIterator.TriedMoveEvent(-1)})
}
- Now you can rotate the step by calling
r("0 0 0")
To rotate specific
r("0 0 0",20)
where rotation is the rotation is "X Y Z"
Get rotation
To execute the script
1. Open an instructions in SDK mode -> https://www.fllcasts.com/materials/846-bag-3-from-first-lego-league-2019-2020-city-shaper-challenge?mode=sdk
2. Open browser dev console
3. Type in
function gr(stepNumber) {
const globalIterator = window["IS.GlobalIterator.Dev.GlobalIteratorListener"]["globalIterator"]
const container = window["IS.GlobalIterator.Dev.GlobalIteratorListener"]["stepsContainer"]
if(stepNumber == undefined) {
stepNumber = globalIterator.getCurrentIndex()+1;
}
const scene = window["IS.BabylonScene.Dev.SceneListener"]["scene"]
const stepName = container.get(stepNumber-1).getId()
const metadata = scene.getNodeByID(stepName).metadata
if(metadata.gltf && metadata.gltf.extras && metadata.gltf.extras.ai3d) {
return metadata.gltf.extras.ai3d.rotation
}
}
- Now you can get the rotation by calling
gr(1)
or if called without arguments it will have get the rotation of the current step
gr()
[IS-6.0-Fredi] Prepare an edit functionality for Instructions Authors
There is a public api implemented. In SDK mode A step could be moved by
const stepsLoadedEvents = window["IS.StepsTree.Dev.StListener"]["stepsTreeLoaded"]
const rootStep = stepsLoadedEvents[stepsLoadedEvents.length-1]["rootStep"]
const container = IS.TreeUtil.ContainerFromTree(rootStep, new IS.PostOrderTraverser(), function(step) {
return step.getId();
});
const history = IS.AxlesIS.GetInstance().getCore().getExtensionDefsForService("com.axlessoft.ai3d.is.commands.history")[0].getExtension();
const command = new IS.Commands.StepReorderCommand(container.get(stepPosition-1), container.get(parentPosition-1), newPosition-1)
history.execute([command])
To use the functionality.
1. Open instruction in SDK mode - https://www.fllcasts.com/materials/846-bag-3-from-first-lego-league-2019-2020-city-shaper-challenge?mode=sdk
2. Open browser console - "Ctrl+Shift+I".
3. Type in the following fragment
function m(stepPosition, parentPosition, newPosition) {
const stepsLoadedEvents = window["IS.StepsTree.Dev.StListener"]["stepsTreeLoaded"]
const rootStep = stepsLoadedEvents[stepsLoadedEvents.length-1]["rootStep"]
const container = IS.TreeUtil.ContainerFromTree(rootStep, new IS.PostOrderTraverser(), function(step) {
return step.getId();
});
const history = IS.AxlesIS.GetInstance().getCore().getExtensionDefsForService("com.axlessoft.ai3d.is.commands.history")[0].getExtension();
const command = new IS.Commands.StepReorderCommand(container.get(stepPosition-1), container.get(parentPosition-1), newPosition-1)
history.execute([command])
}
m(1,9,2)
- See how the instruction has changed - this will change the first and the second step
[IS-6.0-Fredi] Create thumbnail for Fredi material
The fredi material has a thumbnail:
www.fllcasts.com/materials/950
[IS-6.0] Fix event documentation
Improved documentation available with is-core 6.0.0.pre.95
Available at IS.CoreInitEvent