@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
55 lines (54 loc) • 2.66 kB
TypeScript
import { Constructor } from '../../../../types/GlobalTypes';
import { BaseController } from './_BaseController';
import { Material } from 'three';
import { Texture } from 'three';
import { BaseMatNodeType } from '../_Base';
import { NodeContext } from '../../../poly/NodeContext';
import { NodePathParam } from '../../../params/NodePath';
import { BooleanParam } from '../../../params/Boolean';
import { BaseNodeType } from '../../_Base';
import { BaseParamType } from '../../../params/_Base';
export declare function TextureMapParamConfig<TBase extends Constructor>(Base: TBase): {
new (...args: any[]): {
useMap: import("../../utils/params/ParamsConfig").ParamTemplate<import("../../../index_all").ParamType.BOOLEAN>;
map: import("../../utils/params/ParamsConfig").ParamTemplate<import("../../../index_all").ParamType.NODE_PATH>;
};
} & TBase;
type FilterFlags<Base, Condition> = {
[Key in keyof Base]: Base[Key] extends Condition ? Key : never;
};
type AllowedNames<Base, Condition> = FilterFlags<Base, Condition>[keyof Base];
type SubType<Base, Condition> = Pick<Base, AllowedNames<Base, Condition>>;
export declare function BooleanParamOptions(controller_class: typeof BaseTextureMapController): {
cook: boolean;
callback: (node: BaseNodeType, param: BaseParamType) => void;
};
interface NodePathOptionsOptions {
types?: string[];
}
export declare function NodePathOptions(controller: typeof BaseTextureMapController, use_map_name: string, options?: NodePathOptionsOptions): {
visibleIf: {
[x: string]: number;
};
nodeSelection: {
context: NodeContext;
types: string[] | undefined;
};
cook: boolean;
callback: (node: BaseNodeType, param: BaseParamType) => void;
};
type BaseTextureControllerCurrentMaterial = Material;
export declare abstract class BaseTextureMapController extends BaseController {
protected node: BaseMatNodeType;
constructor(node: BaseMatNodeType);
protected add_hooks(use_map_param: BooleanParam, path_param: NodePathParam): void;
static update(node: BaseNodeType): Promise<void>;
private updateBound;
update(): Promise<void>;
_update<M extends BaseTextureControllerCurrentMaterial>(material: M, mat_attrib_name: string, use_map_param: BooleanParam, path_param: NodePathParam): Promise<void>;
_update_texture_on_material<M extends Material>(material: M, mat_attrib_name: keyof SubType<M, Texture | null>, use_map_param: BooleanParam, path_param: NodePathParam): Promise<void>;
private _apply_texture_on_material;
private _remove_texture_from_material;
private _update_required_attribute;
}
export {};