• Walks the SceneObjects of an already-populated SceneModel, looks up each one's IFC type in the matching DataModel, and attaches a procedurally-painted SceneMaterial to every SceneMesh of that object via the mesh's materialId setter. Materials are created lazily — one shared SceneMaterial per IFC type — and added to the same SceneModel alongside the three SceneTextures (colour, normal, metallic-roughness) they reference.

    The painted materials all carry textures; the SceneGeometries coming out of an IFC loader carry no UVs. The renderer detects the mismatch and dispatches those meshes to its triplanar shader variant, which derives sample coordinates from world position scaled by the material's triplanarScale. Per-vertex smooth normals are auto-filled inside SceneModel.createGeometry, so painted IFC meshes route through the smooth-shaded PBR path without any post-construction geometry mutation.

    Mutation-only — no mesh / object recreation. Whether the renderer picks the new material up at render time depends on whether it subscribes to the SceneModel's mesh-material-changed events.

    Expectations:

    • DataObject.id === SceneObject.id for matching pairs (the convention every loader the SDK ships produces).

    Parameters

    • params: {
          dataModel: DataModel;
          nameRules?: IfcNameRule[];
          onProgress?: (p: LoaderProgress) => void;
          painters?: Record<string, IfcPainterEntry>;
          propertyRules?: IfcPropertyRule[];
          resolveIfcType?: (objectId: string, dataObject: DataObject) => string;
          sceneModel: SceneModel;
          signal?: AbortSignal;
          textureSize?: number;
          uvScale?: number;
      }
      • dataModel: DataModel
      • OptionalnameRules?: IfcNameRule[]

        Name-pattern rules tested against dataObject.name, in order. First match wins, picking the rule's painter-table key.

        Defaults to DEFAULT_IFC_NAME_RULES (covers vegetation-style proxy elements). Pass an explicit array to replace the defaults; spread them ([...DEFAULT_IFC_NAME_RULES, ...mine]) to extend.

      • OptionalonProgress?: (p: LoaderProgress) => void

        Optional progress callback fired between phases and at intervals during the per-object loops. Same LoaderProgress shape the SDK's loaders use, so a UI built for one is directly reusable for the other.

      • Optionalpainters?: Record<string, IfcPainterEntry>

        Per-IFC-type painter overrides, merged into DEFAULT_IFC_PAINTERS. Pass an empty object to start from the defaults; pass a populated object to override or add types.

      • OptionalpropertyRules?: IfcPropertyRule[]

        Property-predicate rules inspecting dataObject.propertySets, in order. First match wins. Use to discriminate same-IFC-type objects by their PropertySet contents — e.g. routing Pset_WallCommon.IsExternal === true walls to a different painter than interior walls.

        Defaults to an empty list. The getDataProperty helper makes predicates concise.

      • OptionalresolveIfcType?: (objectId: string, dataObject: DataObject) => string

        Optional resolver returning the painter-table key for a given SceneObject. Runs first — when it returns a defined string the name-rule and property-rule resolvers below are skipped. Use this for free-form routing decisions that don't fit a regex on name or a property predicate.

        Returning undefined defers to the IfcNameRule list, then to the IfcPropertyRule list, then to dataObject.type.

      • sceneModel: SceneModel
      • Optionalsignal?: AbortSignal

        Optional AbortSignal. When aborted, the function throws AbortError from the next yieldToHost checkpoint. Mid-abort state is not rolled back — meshes already destroyed are gone, materials already created stay; the caller should recover by re-running applyIFCMaterials or removeAttachedMaterials.

      • OptionaltextureSize?: number

        Painter texture size in pixels (square). Default 256.

      • OptionaluvScale?: number

        Approximate metres of geometry per texture repeat. Forwarded to each created SceneMaterial as triplanarScale, which the renderer's triplanar texture-sampling fallback uses to scale world-space UVs on UV-less geometry (typical for IFC). Smaller values tile the texture more times across each surface. Default 1.0.

    Returns Promise<SDKResult<void>>