Script: Unicorn 3D Scan

Unicorn 3D Scan picture
Type
Blockly logo indicatorblockly
Date Created
Nov 1, 2022, 4:44:25 PM
Last Edit Date
Oct 2, 2025, 6:21:40 PM

Project Information

We used amazing Artificial Intelligence app Luma AI to scan this toy unicorn and create this small script.

View Full Project

Script Code

<xml xmlns="https://developers.google.com/blockly/xml">
 <variables>
  <variable id="@J1wn?RWbB9,x+(;gOD)">result</variable>
  <variable id="zZtv8c;Q-@@niTLsoB3e">unicorns</variable>
  <variable id="D{w4=xy6Z+dTb.DHa)An">i</variable>
  <variable id="Mgd4=~A%C[+Es~$N!|^n">j</variable>
  <variable id="-nw%Rv%sQqXA`r$=}d}u">timeElapsedFromPreviousFrame</variable>
  <variable id="2.7X6G|Q{J:#=fB3of^+">unicornInstance</variable>
  <variable id="vGLn9oiv=72PjD7/Ak[.">k</variable>
 </variables>
 <block type="bitbybit.babylon.scene.enableSkybox" id="(-.Y{v4XcIUIM[:JXrPj" x="-32" y="-369">
  <value name="Skybox">
   <block type="bitbybit.babylon.enums.skyboxEnum" id="K[s1y/|26%l#7LCauU^y">
    <field name="bitbybit.babylon.enums.skyboxEnum">'city'</field>
   </block>
  </value>
  <value name="Size">
   <block type="math_number" id="L;Tc/pX`u^!^JBV7q?g#">
    <field name="NUM">1000</field>
   </block>
  </value>
  <value name="Blur">
   <block type="math_number" id="]ihCtR,UyX]saRflwU#)">
    <field name="NUM">0.2</field>
   </block>
  </value>
  <value name="EnvironmentIntensity">
   <block type="math_number" id="bagVK6W;RDi(o[./o*!{">
    <field name="NUM">0.6</field>
   </block>
  </value>
  <value name="HideSkybox">
   <block type="logic_boolean" id="8QHINmu$n9yCsKLv}.:U">
    <field name="BOOL">FALSE</field>
   </block>
  </value>
  <next>
   <block type="bitbybit.babylon.scene.drawDirectionalLightNoReturn" id="jrkzj)KHE_+Jshj9~VJR">
    <value name="Direction">
     <block type="bitbybit.point.pointXYZ" id="~rSw(TB,q:vHRjaP`zLv">
      <value name="X">
       <block type="math_number" id="N8ep_:#lANk9tj_biX#,">
        <field name="NUM">-100</field>
       </block>
      </value>
      <value name="Y">
       <block type="math_number" id="iarKSgVj]_s*oe#sz_er">
        <field name="NUM">-100</field>
       </block>
      </value>
      <value name="Z">
       <block type="math_number" id="K@8Qp,Sc2$A0[J~!EQFR">
        <field name="NUM">-100</field>
       </block>
      </value>
     </block>
    </value>
    <value name="Intensity">
     <block type="math_number" id="9(!{wMx{!9}RZc1GQ6E5">
      <field name="NUM">0.5</field>
     </block>
    </value>
    <value name="Diffuse">
     <block type="colour_picker" id="9O(E];]qFFR2uI#Xro%T">
      <field name="COLOUR">#ffffff</field>
     </block>
    </value>
    <value name="Specular">
     <block type="colour_picker" id="|R~c]$Fc7mvk6,|{lDq%">
      <field name="COLOUR">#ffffff</field>
     </block>
    </value>
    <value name="ShadowGeneratorMapSize">
     <block type="math_number" id="z*OivS]v/hT}YD,P)W*_">
      <field name="NUM">1024</field>
     </block>
    </value>
    <value name="EnableShadows">
     <block type="logic_boolean" id="CbyF*m%^kUM3|:~ZW.`X">
      <field name="BOOL">TRUE</field>
     </block>
    </value>
    <value name="ShadowDarkness">
     <block type="math_number" id="dDz8=xW8-=9Zj@73KKrR">
      <field name="NUM">0</field>
     </block>
    </value>
    <next>
     <block type="bitbybit.draw.drawAnyAsyncNoReturn" id="]Q.9uS.}v:5cbCZKBnM?">
      <value name="Entity">
       <block type="bitbybit.jscad.shapes.cuboid" id="UVhRvno6{gX-CGU)nFlM">
        <value name="Center">
         <block type="bitbybit.point.pointXYZ" id="f5S#X~Lt16cNyDFt/K}Z">
          <value name="X">
           <block type="math_number" id="P/R:e:ji=V@b_)}MvRZo">
            <field name="NUM">0</field>
           </block>
          </value>
          <value name="Y">
           <block type="math_number" id="9fSzgQYnZ,x*TT*:O.=Y">
            <field name="NUM">-0.9</field>
           </block>
          </value>
          <value name="Z">
           <block type="math_number" id=";pxn1B^9u`5bb@(=GR_|">
            <field name="NUM">0</field>
           </block>
          </value>
         </block>
        </value>
        <value name="Width">
         <block type="math_number" id="kg#gqDK(Ey;@XDNUZO9@">
          <field name="NUM">15</field>
         </block>
        </value>
        <value name="Length">
         <block type="math_number" id="@2*oFIKU:mF[OX-+uS:h">
          <field name="NUM">15</field>
         </block>
        </value>
        <value name="Height">
         <block type="math_number" id="JurhHwG,QlkKB-P7;;Db">
          <field name="NUM">0.1</field>
         </block>
        </value>
       </block>
      </value>
      <value name="Options">
       <block type="bitbybit.draw.optionsSimple" id="a~EiGqt/_/*eu0AtUzen">
        <value name="Colours">
         <block type="colour_picker" id="deekn4G({|/Aq{IE{s)_">
          <field name="COLOUR">#ffffff</field>
         </block>
        </value>
        <value name="Size">
         <block type="math_number" id="H}UDiSL+|dgW=34lBb-M">
          <field name="NUM">3</field>
         </block>
        </value>
        <value name="Opacity">
         <block type="math_number" id="v{:|7;-ecUe{ZW1T/r)G">
          <field name="NUM">1</field>
         </block>
        </value>
        <value name="Updatable">
         <block type="logic_boolean" id="gc8J+K0Rk4b4G~]m,lA~">
          <field name="BOOL">FALSE</field>
         </block>
        </value>
        <value name="Hidden">
         <block type="logic_boolean" id="wH%(VMd=]q?Wf$rdhcHg">
          <field name="BOOL">FALSE</field>
         </block>
        </value>
       </block>
      </value>
      <next>
       <block type="base_time_then" id="oc]s*d(a(G-j6fZ#Zy6L">
        <field name="Result" id="@J1wn?RWbB9,x+(;gOD)">result</field>
        <value name="Promise">
         <block type="bitbybit.babylon.io.loadAssetIntoScene" id="FU#a}#a+x6@HQ`~R0#Qg">
          <value name="AssetFile">
           <block type="bitbybit.asset.getFile" id=")$`QY1c]ej6OXLxmc.HB">
            <value name="FileName">
             <block type="text" id="Zf=tZIG:P;gDnOD!jZrK">
              <field name="TEXT">unicorn.glb</field>
             </block>
            </value>
           </block>
          </value>
         </block>
        </value>
        <statement name="Then">
         <block type="bitbybit.babylon.mesh.setRotation" id="/q27Q.-t5u8[e)Kto8Zm">
          <value name="BabylonMesh">
           <block type="variables_get" id="3})MNfP.y?BRI0Tiq#2e">
            <field name="VAR" id="@J1wn?RWbB9,x+(;gOD)">result</field>
           </block>
          </value>
          <value name="Rotation">
           <block type="bitbybit.point.pointXYZ" id="AK5yDay~XW8~0oH*aBTG">
            <value name="X">
             <block type="math_number" id="gp9wuxp/ZwLTPlp5y?]W">
              <field name="NUM">-90</field>
             </block>
            </value>
            <value name="Y">
             <block type="math_number" id="f`~hTjxjLg5:dbVXG~Tn">
              <field name="NUM">0</field>
             </block>
            </value>
            <value name="Z">
             <block type="math_number" id="Q4hlK*MNVb!EyNo+Y6yH">
              <field name="NUM">135</field>
             </block>
            </value>
           </block>
          </value>
          <next>
           <block type="bitbybit.babylon.mesh.hide" id="AqZ1FlxJ%rrM1OB|0^`.">
            <value name="BabylonMesh">
             <block type="variables_get" id="f79fr9[;8lB])`w)qg3f">
              <field name="VAR" id="@J1wn?RWbB9,x+(;gOD)">result</field>
             </block>
            </value>
            <value name="IncludeChildren">
             <block type="logic_boolean" id="4-}u2]8@UJP!lnFD^yae">
              <field name="BOOL">TRUE</field>
             </block>
            </value>
            <next>
             <block type="variables_set" id="`=dRtsi`Vr!r}8ovmhSx">
              <field name="VAR" id="zZtv8c;Q-@@niTLsoB3e">unicorns</field>
              <value name="VALUE">
               <block type="lists_create_with" id="B2G`N#IojZ|[iwmhGM^^">
                <mutation items="0">
                </mutation>
               </block>
              </value>
              <next>
               <block type="controls_for" id="It[E^~QjjG8eO$?VK#r#">
                <field name="VAR" id="D{w4=xy6Z+dTb.DHa)An">i</field>
                <value name="FROM">
                 <block type="math_number" id="#DuD6+DjWb|R_3JCI_|8">
                  <field name="NUM">-5</field>
                 </block>
                </value>
                <value name="TO">
                 <block type="math_number" id="VQ*f6R^F+5*~+[!w)Q2:">
                  <field name="NUM">5</field>
                 </block>
                </value>
                <value name="BY">
                 <block type="math_number" id="k?5ygXl^`o}{I)!!+`aR">
                  <field name="NUM">2</field>
                 </block>
                </value>
                <statement name="DO">
                 <block type="controls_for" id="eJ;r}n6Sg#GFL6B-w#jc">
                  <field name="VAR" id="Mgd4=~A%C[+Es~$N!|^n">j</field>
                  <value name="FROM">
                   <block type="math_number" id="!#BojvmZ4/gTm3e43]=5">
                    <field name="NUM">-5</field>
                   </block>
                  </value>
                  <value name="TO">
                   <block type="math_number" id="/EYPT)b,oPye/8.ab(Y_">
                    <field name="NUM">5</field>
                   </block>
                  </value>
                  <value name="BY">
                   <block type="math_number" id="}Ze=N1n]$.y;h|THkZeQ">
                    <field name="NUM">2</field>
                   </block>
                  </value>
                  <statement name="DO">
                   <block type="variables_set" id="_C!PFN}qPMCdvNKQ|L+L">
                    <field name="VAR" id="2.7X6G|Q{J:#=fB3of^+">unicornInstance</field>
                    <value name="VALUE">
                     <block type="bitbybit.babylon.mesh.createMeshInstance" id="89v%tsMhBsgs18dnBkpF">
                      <value name="Mesh">
                       <block type="variables_get" id="ZkmKaO,DxK8y*6z?3[x`">
                        <field name="VAR" id="@J1wn?RWbB9,x+(;gOD)">result</field>
                       </block>
                      </value>
                     </block>
                    </value>
                    <next>
                     <block type="bitbybit.babylon.mesh.setRotation" id="O*yN@=m%hQU(p~]t!,YR">
                      <value name="BabylonMesh">
                       <block type="variables_get" id="p6Elj6o)m]A?5@DU{?V4">
                        <field name="VAR" id="2.7X6G|Q{J:#=fB3of^+">unicornInstance</field>
                       </block>
                      </value>
                      <value name="Rotation">
                       <block type="bitbybit.point.pointXYZ" id="_|0+XF]f^R0G#z:YXr5f">
                        <value name="X">
                         <block type="math_number" id="eE?c82;mMDsFymjQN$2P">
                          <field name="NUM">-90</field>
                         </block>
                        </value>
                        <value name="Y">
                         <block type="math_number" id=".5B;u7nm9pUe5fZl~_[P">
                          <field name="NUM">0</field>
                         </block>
                        </value>
                        <value name="Z">
                         <block type="math_number" id="5QTF]Jl;QCY#k7o!+f~R">
                          <field name="NUM">135</field>
                         </block>
                        </value>
                       </block>
                      </value>
                      <next>
                       <block type="bitbybit.babylon.mesh.setPosition" id="J;rpPwpRF#vXT[r7!/GX">
                        <value name="BabylonMesh">
                         <block type="variables_get" id="7r=PUT;_vHPA[Z2jR,%(">
                          <field name="VAR" id="2.7X6G|Q{J:#=fB3of^+">unicornInstance</field>
                         </block>
                        </value>
                        <value name="Position">
                         <block type="bitbybit.point.pointXYZ" id="*Z-CUWC?G0qIy(PDOyVX">
                          <value name="X">
                           <block type="variables_get" id="S$!OnI}Bt#DtbkB[}`~I">
                            <field name="VAR" id="D{w4=xy6Z+dTb.DHa)An">i</field>
                           </block>
                          </value>
                          <value name="Y">
                           <block type="math_number" id="79KcKMtQ}EJL^X7ym_|o">
                            <field name="NUM">0</field>
                           </block>
                          </value>
                          <value name="Z">
                           <block type="variables_get" id="8Yw*,Lp@m/~mIA26JcZR">
                            <field name="VAR" id="Mgd4=~A%C[+Es~$N!|^n">j</field>
                           </block>
                          </value>
                         </block>
                        </value>
                        <next>
                         <block type="lists_setIndex" id="VGCG5MbIczZ]v*mN3gEe">
                          <mutation at="false">
                          </mutation>
                          <field name="MODE">INSERT</field>
                          <field name="WHERE">LAST</field>
                          <value name="LIST">
                           <block type="variables_get" id="yIe$~Rsc[PjrPa3b9DeF">
                            <field name="VAR" id="zZtv8c;Q-@@niTLsoB3e">unicorns</field>
                           </block>
                          </value>
                          <value name="TO">
                           <block type="variables_get" id="fWR7*VyZwft{?2I=WDBS">
                            <field name="VAR" id="2.7X6G|Q{J:#=fB3of^+">unicornInstance</field>
                           </block>
                          </value>
                         </block>
                        </next>
                       </block>
                      </next>
                     </block>
                    </next>
                   </block>
                  </statement>
                 </block>
                </statement>
                <next>
                 <block type="base_time_update" id="4FfDmDGs2u~Bp#Mkcz|_">
                  <field name="TimePassedMs" id="-nw%Rv%sQqXA`r$=}d}u">timeElapsedFromPreviousFrame</field>
                  <statement name="Update">
                   <block type="controls_forEach" id="_v4`^lZ~):uLvpT;QJV{">
                    <field name="VAR" id="vGLn9oiv=72PjD7/Ak[.">k</field>
                    <value name="LIST">
                     <block type="variables_get" id="{o5U?uI^xGW9MX8U|p2s">
                      <field name="VAR" id="zZtv8c;Q-@@niTLsoB3e">unicorns</field>
                     </block>
                    </value>
                    <statement name="DO">
                     <block type="bitbybit.babylon.mesh.roll" id="0Cs]tnC:tDF)t!?g,U?9">
                      <value name="BabylonMesh">
                       <block type="variables_get" id="Qm8^=axB/Q!2+}l-/!HQ">
                        <field name="VAR" id="vGLn9oiv=72PjD7/Ak[.">k</field>
                       </block>
                      </value>
                      <value name="Rotate">
                       <block type="math_number" id="AK3nW~X%WRO-5OZG=VLi">
                        <field name="NUM">0.1</field>
                       </block>
                      </value>
                     </block>
                    </statement>
                   </block>
                  </statement>
                 </block>
                </next>
               </block>
              </next>
             </block>
            </next>
           </block>
          </next>
         </block>
        </statement>
       </block>
      </next>
     </block>
    </next>
   </block>
  </next>
 </block>
</xml>