roavatar-renderer
    Preparing search index...

    Class OutfitRenderer

    Example on usage

    const auth = new Authentication()
    const outfit = new Outfit()
    const renderScene = RBXRenderer.addScene()

    const outfitRenderer = new OutfitRenderer(auth, outfit, renderScene)
    outfitRenderer.startAnimating()
    outfitRenderer.setMainAnimation("anim.1234") //animation with id 1234, check documentation for other possible values

    outfitRenderer.onRenderSuccess.Connect(() => {
    //handle Instance tree + renderDesc being successfuly
    })
    outfitRenderer.onError.Connect(() => {
    //handle Instance tree error
    })
    outfitRenderer.onRenderError.Connect(() => {
    //handle renderDesc error
    })

    //onRenderSuccess is fired once after some time

    outfitRenderer.setOutfit(new Outfit())

    //onRenderSuccess is fired again once after some time

    //when we're done rendering
    outfitRenderer.destroy()
    renderScene.destroy()
    Index

    Constructors

    Properties

    animationFPS: number = 60
    animationInterval?: Timeout
    backgroundRenderer: BackgroundRenderer
    currentlyChangingRig: boolean = false
    currentlyUpdating: boolean = false
    currentRig?: Instance
    currentRigType: AvatarType
    deltaTimeMultiplier: number = 1
    doAddInstance: boolean = true
    doCameraUpdate: boolean = false
    doCameraUpdateOnLoad: boolean = true
    forceAnimationLoop: boolean = true
    hasFiredFullyRendered: boolean = false
    hasNewUpdate: boolean = false
    lastFrameTime: number = ...
    onError: Event = ...

    Event is fired if a new outfit failed to load (specifically the Instance tree, not the rendering part)

    Simple: Fired when, Instance tree = fail

    OutfitRendererErrorType

    onRenderError: Event = ...

    Event is fired if a renderDesc fails to compile, it can be fired multiple times

    Simple: Fired when, Rendering = fail

    void

    onRenderSuccess: Event = ...

    Event is fired when all the renderDescs have been compiled, if any renderDescs fail to render this wil never be fired (can only be fired after Instance tree is done)

    Simple: Fired when, Instance tree = done & Rendering = done (AKA everything)

    NOTE: If FLAGS.LAYERED_CLOTHING_COOLDOWN > 0 (non-default), this may be fired too early and later fire again

    void

    onSuccess: Event = ...

    Event is fired if a new outfit successfully loaded (specifically the Instance tree, not the rendering part)

    Simple: Fired when, Instance tree = done

    void

    outfit: Outfit
    outfitModel?: OutfitModel
    renderScene: RBXRendererScene = RBXRenderer.firstScene

    Methods

    • Rerenders the current outfit, called internally by setOutfit() and constructor

      Returns void

    • Updates the animation once

      Parameters

      • OptionaldeltaTimeOverride: number

      Returns void

    • Calls destroy on the rig, stops animating and disconnects connections. The OutfitRenderer should not be interacted with after this

      Returns void

    • Prepares the OutfitRenderer to be used for a thumbnail, call IMMEDIATELY after creating the OutfitRenderer

      Returns Promise<boolean>

      true on success

    • Sets the current animation being played

      Parameters

      • name: string

        The name of the animation, for example "idle", "run", "emote.1234" or "anim.1234"

      Returns Promise<boolean>

      If the animation started playing, it may start playing later if it has been queued despite returning false

    • Updates rendered particles so they face the camera without simulating them (usually used when generating thumbnails)

      Returns void