Repository navigation
This release adds automatic GPU instancing for repeated glTF geometry, a hover preview and one-gesture move for rectangle transforms, and an opt-in drag threshold so a click no longer moves a dragged object. It also fixes several cases where overlapping interactive objects, selections and drags did not behave as expected, a freeze on models with many emoji 3D tags, and restriction grids that did not show up after a computation.
GPU Instancing
- Repeated glTF geometry is now drawn with GPU instancing (SS-6458): occurrences of the same part (screws, mullions, panels, …) are batched into one draw call instead of one per mesh. This is on by default and needs no change to the model.
- A primitive is batched when at least two occurrences of it are loaded from the same asset: a glTF mesh referenced by several nodes, a byte-identical primitive (the material may differ in its base color, which is applied per instance), or a copy of another primitive with the transform baked into its vertices (rotation and translation, not mirrored).
- Only plain triangle meshes are batched. Lines, points, morph targets, skinning,
KHR_materials_variants, transparent materials and content that is not glTF keep the regular rendering.EXT_mesh_gpu_instancingis unchanged. - Batched geometry supports picking, hover, selection and drag effects, outline and selective bloom, the pulse effect, visibility per node, material updates per occurrence, camera fitting and glTF export (each occurrence is exported with its own transform).
- Rectangle transforms and the other transformation tools use the correct bounding box for baked-transform copies.
Interaction / Transformation Tools
- Added the rectangle transform setting
preview(SS-10334): a rectangle shown while the pointer hovers an object, before it is selected. A preview sends the new eventEVENTTYPE_TRANSFORMATION_TOOLS.HOVER_CHANGED(IRectangleTransformHoverEvent) when the pointer enters or leaves its area, and keeps the hover effect of its objects. - Added the rectangle transform setting
translateOnObjects(SS-10334): a press on the transformed objects also starts the translation, not only a press on the plane, and the camera does not move. The press becomes a drag once the pointer moved by 4 CSS px (10 on touch). - Added the event
EVENTTYPE_TRANSFORMATION_TOOLS.GESTURE_START(IRectangleTransformGestureEvent), sent when a press on a handle or the plane of a rectangle transform starts a gesture, before anything changes (SS-10334). - Added
promote(id),setNodes(nodes, restrictions?),startTranslation(event),containsPointer(event)andhitsPointer(event)toIRectangleTransform(SS-10334). With them a preview can be turned into a regular rectangle transform, moved to another hovered object, or start moving with the press that selected its object, so an object can be selected and moved in one gesture (also on touch). - A rectangle transform at rest reports the identity matrix instead of small rounding errors, so listeners no longer see a move after each computation. Objects far from the origin no longer jump back after a real move (SS-10334).
- The object moves while the pointer is down during a rectangle transform drag, without rebuilding the node (SS-10334).
- Added the drag setting
dragThreshold(SS-10359, default false): a press on a draggable node only becomes a drag once the pointer moved by 4 CSS px (mouse and pen) or 10 CSS px (touch). A shorter press (a click) moves nothing and emits no drag events. - Added
pointerDownFilter,hitsPointer(event)andcontinueGesture(event)to the drawing tools API, andpointerDownFilter,receivesPointerDown(event)andcontinueGesture(event)to the interaction engine, so several tools on one viewport can decide which one gets a press. - Interaction managers can implement the new optional
onClaimedPress(IInteractionManager): when another tool won a press (e.g. the plane of a rectangle transform), the select managers of the object under the pointer still select it once the pointer is released. - A cancelled pointer gesture (
pointercancel, e.g. a touch taken over by the browser) cancels the interactions in progress; a drag returns its nodes to their placement before the drag.
Bugfixes
- Fixed overlapping interactive objects (SS-10327, SS-10334): only the closest object gets the hover, the cursor and the press, also across hover managers and rectangle transforms; text on a rectangle wins the pointer over the rectangle; invisible meshes such as the translation plane of a rectangle transform no longer hide the objects behind them.
- Fixed clicking an object with a rectangle transform not selecting it or opening its menu (SS-10334).
- Fixed a click sometimes being detected as a drag, and selections not following the click (SS-10555): with one select manager per object, clicking another object now deselects the previous one; a press on an object in front no longer toggles the selection of an object behind it; a drag on the rectangle of the selected object keeps the selection.
- Fixed another pointer's release ending a press that had not become a drag yet (SS-10359).
- Fixed drags with plane restrictions leaving the plane in edge-on orthographic views (front, back, left, right), e.g. objects lifted off the floor (SS-10521).
- Fixed the restriction grid of geometry restrictions not showing when the nodes were handed over right after a computation (SS-10546).
- Fixed models with many emoji or other non-ASCII 3D tags freezing or crashing on load: the font for these characters is now loaded once instead of once per tag (SS-10586).
Included from the 3.22 patch releases
3.22.1
-
Fixed a performance issue of the pulse effect: starting it on a material with textures no longer turns every texture image into a data URL (SS-10277).
3.22.2
-
No code changes.
3.22.3
-
Fixed node name patterns of interaction parameters for instances: names are matched relative to the instance and its output.
-
Updated
@shapediver/sdk.sdtf-primitivesto1.7.4and@shapediver/sdk.sdtf-v1to1.9.0.3.22.4
-
Added
pause(),continue(),pausedandpauseWhileBusyto the interaction engine, the drawing tools and the transformation tools (gumball and rectangle transform). While paused, for example during a computation, they stay visible but ignore user input; an interaction in progress is cancelled and a drag returns its nodes to their placement before the drag. WithpauseWhileBusythey pause automatically while the viewport is busy. A cancelled drag sendsDRAG_ENDwithcancelled: true. -
Added the rectangle transform parameter setting
exclusive(SS-10334): withactiveMode"alwaysActive", only one exclusive rectangle transform per viewport is selected at a time, and nothing is selected on load.maximumSelectionmust then be omitted, null or 1. -
Fixed overlapping interactive objects and rectangle transforms (SS-10327): when several tools claim a press, the closest one wins; objects outside a shown rectangle stay interactive.
-
A rectangle transform on nodes with an empty bounding box (not yet added to the scene) logs a warning instead of failing; the drawing tools no longer fail when their points are updated before the viewport has converted them.
-
Updated
@shapediver/viewer.settingsto1.3.3,zodto4.6.7anddompurifyto3.4.17.
What's Changed
- SS-6458: gpu instancing by @MajorMeerkatThe3rd in #255
- SS-10024: automaticSceneUpdate implementation from the viewer side by @MajorMeerkatThe3rd in #257
- SS-10327 Closest object wins overlapping rectangle transforms by @MajorMeerkatThe3rd in #259
- SS-10334: exclusive setting for the rectangle transform by @MajorMeerkatThe3rd in #260
- SS-10334: exclusive setting for the rectangle transform by @MajorMeerkatThe3rd in #262
- SS-10327 Closest object wins overlapping rectangle transforms by @MajorMeerkatThe3rd in #261
- SS-10334 Rectangle transform hover preview and one-press gestures by @MajorMeerkatThe3rd in #265
- SS-10334: move the object while a rectangle drag is in progress by @MajorMeerkatThe3rd in #266
- SS-10334: apply a rectangle drag without rebuilding the node by @MajorMeerkatThe3rd in #272
- SS-10521: keep plane-restricted drags on the plane in edge-on orthographic views by @MajorMeerkatThe3rd in #299
- SS-10334: let only the closest object win the hover across hover managers by @MajorMeerkatThe3rd in #300
- SS-10334: test moving the hover from the object behind onto the one in front by @MajorMeerkatThe3rd in #302
- SS-10359: opt-in drag threshold so a click does not move a dragged object by @majormeerkatthe3rd-ai[bot] in #314
- SS-10334: report the identity for a transformation tool at rest by @majormeerkatthe3rd-ai[bot] in #312
- SS-10546: Restriction grid empty when drawing starts right after a computation by @majormeerkatthe3rd-ai[bot] in #341
- SS-10586: load each tag font only once when tags load in parallel by @majormeerkatthe3rd-ai[bot] in #339
- SS-10555: a click selects the pressed object, past rectangle transforms and objects in front by @majormeerkatthe3rd-ai[bot] in #340
Full Changelog: https://github.com/shapediver/Viewer/compare/viewer@3.22.0...viewer@3.23.0