Procházet zdrojové kódy

Some jsdocs changes

master
Palash Bansal před 1 rokem
rodič
revize
d8b7f7007f
Žádný účet není propojen s e-mailovou adresou tvůrce revize

+ 13
- 3
README.md Zobrazit soubor

@@ -134,6 +134,7 @@ To make changes and run the example, click on the CodePen button on the top righ
- [STLLoadPlugin](#stlloadplugin) - Add support for loading .stl files
- [KTX2LoadPlugin](#ktx2loadplugin) - Add support for loading .ktx2 files
- [KTXLoadPlugin](#ktxloadplugin) - Add support for loading .ktx files
- [USDZLoadPlugin](#usdzloadplugin) - Add support for loading .usdz files
- [GLTFMeshOptDecodePlugin](#gltfmeshoptdecodeplugin) - Decode gltf files with EXT_meshopt_compression extension.
- [SimplifyModifierPlugin](#simplifymodifierplugin) - Boilerplate for plugin to simplify geometries
- [MeshOptSimplifyModifierPlugin](#meshoptsimplifymodifierplugin) - Simplify geometries using meshoptimizer library
@@ -147,6 +148,8 @@ To make changes and run the example, click on the CodePen button on the top righ
- [@threepipe/plugin-blend-importer](#threepipeplugin-blend-importer) - Blender to add support for loading .blend file
- [@threepipe/plugin-geometry-generator](#threepipeplugin-geometry-generator) - Generate parametric geometry types that can be re-generated from UI/API.
- [@threepipe/plugin-gaussian-splatting](#threepipeplugin-gaussian-splatting) - Gaussian Splatting plugin for loading and rendering splat files
- [@threepipe/plugin-network](#threepipeplugin-network) - Network/Cloud related plugin implementations for Threepipe.
- [@threepipe/plugin-svg-renderer](#threepipeplugin-svg-renderer) - Add support for exporting 3d scene as SVG.

## Getting Started

@@ -192,7 +195,10 @@ function ThreeViewerComponent({src, env}: {src: string, env: string}) {

const envPromise = viewer.setEnvironmentMap(env)
const modelPromise = viewer.load(src)
Promise.all([envPromise, modelPromise])
Promise.all([envPromise, modelPromise]).then(([env, model]) => {
console.log('Loaded', model, env, viewer)
})
return () => {
viewer.dispose()
}
@@ -222,7 +228,9 @@ const ThreeViewerComponent = {
const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr');
const modelPromise = viewer.load('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf');

Promise.all([envPromise, modelPromise])
Promise.all([envPromise, modelPromise]).then(([env, model]) => {
console.log('Loaded', model, env, viewer)
})

onBeforeUnmount(() => {
viewer.dispose();
@@ -255,7 +263,9 @@ A sample [svelte](https://svelte.dev/) component in js to render a model with an
const envPromise = viewer.setEnvironmentMap('https://threejs.org/examples/textures/equirectangular/venice_sunset_1k.hdr');
const modelPromise = viewer.load('https://threejs.org/examples/models/gltf/DamagedHelmet/glTF/DamagedHelmet.gltf');

Promise.all([envPromise, modelPromise])
Promise.all([envPromise, modelPromise]).then(([env, model]) => {
console.log('Loaded', model, env, viewer)
})
});
onDestroy(() => viewer.dispose())
</script>

+ 1
- 1
src/plugins/animation/PopmotionPlugin.ts Zobrazit soubor

@@ -26,7 +26,7 @@ export interface AnimationResult{
*
* Overrides the driver in popmotion to sync with the viewer and provide ways to keep track and stop animations.
*
* @category Plugin
* @category Plugins
*/
export class PopmotionPlugin extends AViewerPluginSync<''> {
public static readonly PluginType = 'PopmotionPlugin'

+ 1
- 1
src/plugins/animation/TransformAnimationPlugin.ts Zobrazit soubor

@@ -19,7 +19,7 @@ export interface TSavedTransform {
* Also adds a UI to add and animate transforms on objects.
* Requires the PopmotionPlugin to animate.
*
* @category Plugin
* @category Plugins
*/
export class TransformAnimationPlugin extends AViewerPluginSync<''> {
public static readonly PluginType = 'TransformAnimationPlugin'

+ 7
- 0
src/plugins/base/PipelinePassPlugin.ts Zobrazit soubor

@@ -5,6 +5,13 @@ import {SerializationMetaType, wrapThisFunction2} from '../../utils'
import {uiToggle} from 'uiconfig.js'
import {ICamera, IRenderManager, IScene} from '../../core'

/**
* Pipeline Pass Plugin
*
* Base class for creating a plugin that registers a custom pass to the main render pipeline
*
* @category Plugins
*/
export abstract class PipelinePassPlugin<T extends IPipelinePass, TPassId extends IPassID, TEvent extends string, TViewer extends ThreeViewer=ThreeViewer> extends AViewerPluginSync<TEvent, TViewer> {
abstract passId: TPassId


+ 1
- 0
src/plugins/configurator/MaterialConfiguratorBasePlugin.ts Zobrazit soubor

@@ -8,6 +8,7 @@ import {Color} from 'three'

/**
* Material Configurator Plugin (Base)
*
* This plugin allows you to create variations of materials mapped to material names or uuids in the scene.
* These variations can be applied to the materials in the scene. (This copies the properties to the same material instances instead of assigning new materials)
* The plugin interfaces with the picking plugin and also provides uiConfig to show and edit the variations.

+ 1
- 0
src/plugins/configurator/SwitchNodeBasePlugin.ts Zobrazit soubor

@@ -7,6 +7,7 @@ import {snapObject} from '../../three'

/**
* Switch Node Plugin (Base)
*
* This plugin allows you to configure object variations in a file and apply them in the scene.
* Each SwitchNode is a parent object with multiple direct children. Only one child is visible at a time.
* This works by toggling the `visible` property of the children of a parent object.

+ 7
- 0
src/plugins/export/FileTransferPlugin.ts Zobrazit soubor

@@ -1,6 +1,13 @@
import {AViewerPluginSync, ThreeViewer} from '../../viewer'
import {downloadBlob} from 'ts-browser-helpers'

/**
* File Transfer Plugin
*
* Provides a way to extend the viewer.export functionality with custom actions. Used in `AWSClientPlugin` to upload files directly to S3.
*
* @category Plugins
*/
export class FileTransferPlugin extends AViewerPluginSync<'transferFile'> {
enabled = true


+ 4
- 1
src/plugins/extras/GLTFKHRMaterialVariantsPlugin.ts Zobrazit soubor

@@ -10,9 +10,12 @@ import {
import {gltfExporterMaterialsVariantsExtensionExport} from './helpers/GLTFMaterialsVariantsExtensionExport'

/**
* GLTF khr_material_variants plugin
*
* This plugin allows to import and export gltf files with KHR_materials_variants extension.
* The material data is stored in the object userData. The plugin also provides a UI to select the variant.
* @category Plugin
*
* @category Plugins
*/
export class GLTFKHRMaterialVariantsPlugin extends AViewerPluginSync<''> {
public static readonly PluginType = 'GLTFKHRMaterialVariantsPlugin'

+ 1
- 1
src/plugins/extras/Object3DGeneratorPlugin.ts Zobrazit soubor

@@ -14,7 +14,7 @@ import {Vector3} from 'three'

/**
* Adds support for generating different types of lights and camera objects in the viewer.
* @category Plugin
* @category Plugins
*/
@uiPanelContainer('Generate Scene Objects')
export class Object3DGeneratorPlugin extends AViewerPluginSync<''> {

+ 1
- 1
src/plugins/extras/Object3DWidgetsPlugin.ts Zobrazit soubor

@@ -13,7 +13,7 @@ export interface IObject3DHelper<T extends Object3D&IWidget = Object3D&IWidget>{
/**
* Adds light and camera helpers/gizmos in the viewer.
* A helper is automatically created when any supported light or camera is added to the scene.
* @category Plugin
* @category Plugins
*/
export class Object3DWidgetsPlugin extends AViewerPluginSync<''> {
@onChange(Object3DWidgetsPlugin.prototype.setDirty)

+ 2
- 1
src/plugins/postprocessing/AScreenPassExtensionPlugin.ts Zobrazit soubor

@@ -24,8 +24,9 @@ export abstract class AScreenPassExtensionPlugin<T extends string> extends AView
if (v) this.setDirty()
}

constructor() {
constructor(shaderPatch = '') {
super()
this._shaderPatch = shaderPatch
this.setDirty = this.setDirty.bind(this)
}


+ 6
- 0
src/plugins/postprocessing/VignettePlugin.ts Zobrazit soubor

@@ -54,10 +54,16 @@ export class VignettePlugin extends AScreenPassExtensionPlugin<''> {

protected _shaderPatch = 'diffuseColor = Vignette(diffuseColor);'

/**
* @deprecated
*/
get bgcolor() {
console.warn('VignettePlugin.bgcolor is deprecated, use VignettePlugin.color instead')
return this.color
}
/**
* @deprecated
*/
set bgcolor(v) {
console.warn('VignettePlugin.bgcolor is deprecated, use VignettePlugin.color instead')
this.color = v

+ 1
- 1
src/viewer/version.ts Zobrazit soubor

@@ -1 +1 @@
export const VERSION = '0.0.32'
export const VERSION = '0.0.33'

Načítá se…
Zrušit
Uložit