Dynamic and interactive 3d block for WordPress

Greenshift has many 3D blocks: a model viewer, a Spline3d Viewer, and a 3D Woocommerce gallery. The dynamic 3D block extends 3D functions even more and introduces 3D API. Dynamic 3d block has 3 basic dynamic options.

Dynamic 3d Block works with Spline3D app and .splinecode format. To use it, click on Export in the Spline3d app, then select Viewer or Code export and copy the file URL (or download it from Spline and upload it to your site)

Advanced Animations

You can animated not only model parts but also camera and light

Animations in 3d block is similar to Chained animations in Animation Container and it uses the same principles. The only difference is that you can select objects to animate in each chain. You need to know few important things about animation chains

  1. You can animate the same properties inside the Spline app, and it’s recommended if you have interactions directly in the model. But if you plan to use Scroll animations, it is better to do them in Dynamic 3d block because they will work more smoothly and have more flexibility
  2. Each animation chain starts from zero time. To have one chain animated after the previous one, use the symbol “>” in the chain’s custom time. All GSAP timeline features are supported
  3. Values are related to the model and not to the browser. For example, if your model is placed on 100px, then if you use 200px for animation, the shift will be only 100px and not 200px
  4. If you want to use interpolated animation, enable Scroll Interpolation option. For the trigger end, use values like +=1000px, meaning it will take 1000px from the beginning of the animation. Use the word “max” if you want to make animation for the whole available scroll distance of the page
  5. In scroll interpolated animations, duration is converted to distance. So, if you have 2 chains with a 9-second duration and the other 1 second, and you use a +=1000 scroll distance, then the first will take 900px, and the second will be 100px. For more precise distance, enable Linear Ease in each animation
  6. By default, the animation will start when the object is in view at the bottom of the page. If your object is in the first screen, you can use 0 as a trigger start.
  7. If model has baked animations and you add animations also in block, then model’s animations will have priority

Dynamic fields for 3d block

Dynamic options are based on a variable system in spline, but now, you can connect them to dynamic fields on your site. You can make your post title dynamic 3D or build a custom 3D chart based on the meta field values of the post—there are no limits at all.

Connection to site is pretty simple, once you load model, you will see all available variables in your model. Then you can change values manually or connect them to your Site dynamic fields

Interaction layers for 3d

You can connect dynamic data and interaction layers to 3d variables. For this, you need to copy the ID from the block and the name of the variable

Preparations in Spline3d

There are some essential options in the app for preparing files for use on the web.

The first important option is AutoZoom and responsive. Usually, it would be best if you kept them ON

Second. When you click on export, visit also Play settings. If you plan to make animations via block instead of animations on model, you need to disable some events, for example, Pan and Zoom, this will keep only scroll and will remove accidental shifting of model when you scroll page

Next. If you update your model, You need to click on Update Code Export button, otherwise, model will use old data on your site.

Performance

For better speed, it’s not recommended to load more than 1-2 models on page. Anyway, block has special Smart Loading feature that can delay library and model loading. This will save your web vitals because 3d libraries are very heavy.

For developers

When you copy Model ID from block, you can use it for making more advanced setup, because this ID will register global variable where Scene is saved. So, you can use any Spline Runtime functions to modify scene further.

Copy this post’s content
Copy code below, and paste it (CTRL+V) in content of page
«
»