Skip to content

Commit

Permalink
Move editableInPropertyPage to Core and Update Observable Import (#59)
Browse files Browse the repository at this point in the history
Move editableInPropertyPage from editor to core package so that block libraries don't need to have a dependency on editor. Also, fix an Observable import that was too broad.
  • Loading branch information
alexchuber authored Oct 9, 2024
1 parent 29db14f commit ae3ed18
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Observable } from "@babylonjs/core";
import type { Observable } from "@babylonjs/core/Misc/observable";

/**
* Enum defining the type of properties that can be edited in the property pages in the node editor
*/
export const enum PropertyTypeForEdition {
export enum PropertyTypeForEdition {
/** property is a boolean */
Boolean,
/** property is a float */
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export { type SmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
export { InternalSmartFilterRuntime } from "./runtime/smartFilterRuntime.js";
export { RenderTargetGenerator } from "./runtime/renderTargetGenerator.js";

export { SmartFilter } from "./smartFilter.js";
export { SmartFilter, type InitializationData } from "./smartFilter.js";

export { SmartFilterOptimizer } from "./optimization/smartFilterOptimizer.js";
export * from "./utils/textureLoaders.js";
export * from "./serialization/index.js";
export * from "./editorUtils/editableInPropertyPage.js";
4 changes: 1 addition & 3 deletions packages/demo/src/configuration/blocks/effects/blurBlock.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import type { ConnectionPoint, ConnectionPointType } from "@babylonjs/smart-filters";
import { AggregateBlock, SmartFilter } from "@babylonjs/smart-filters";

import { AggregateBlock, SmartFilter, editableInPropertyPage, PropertyTypeForEdition } from "@babylonjs/smart-filters";
import { DirectionalBlurBlock } from "./directionalBlurBlock";
import { BlockNames } from "../blockNames";
import { editableInPropertyPage, PropertyTypeForEdition } from "@babylonjs/smart-filters-editor";

const defaultBlurTextureRatioPerPass = 0.5;
const defaultBlurSize = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { Effect } from "@babylonjs/core/Materials/effect";

import type { SmartFilter, IDisableableBlock, RuntimeData, ShaderProgram } from "@babylonjs/smart-filters";
import {
ConnectionPointType,
createStrongRef,
editableInPropertyPage,
PropertyTypeForEdition,
DisableableShaderBinding,
DisableableShaderBlock,
} from "@babylonjs/smart-filters";
import { BlockNames } from "../blockNames";
import { editableInPropertyPage, PropertyTypeForEdition } from "@babylonjs/smart-filters-editor";

/** Defines that alpha blending is disabled */
export const ALPHA_DISABLE = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import type { Effect } from "@babylonjs/core/Materials/effect";

import type { SmartFilter, RuntimeData, ShaderProgram } from "@babylonjs/smart-filters";
import { ConnectionPointType, ShaderBinding, ShaderBlock } from "@babylonjs/smart-filters";
import {
ShaderBlock,
ConnectionPointType,
ShaderBinding,
editableInPropertyPage,
PropertyTypeForEdition,
} from "@babylonjs/smart-filters";
import { BlockNames } from "../blockNames";
import { editableInPropertyPage, PropertyTypeForEdition } from "@babylonjs/smart-filters-editor";

const shaderProgram: ShaderProgram = {
fragment: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import type { ThinEngine } from "@babylonjs/core/Engines/thinEngine.js";
import { WebCamRuntime } from "./webCamRuntime";
import { ConnectionPointType, type SmartFilter, InputBlock, createStrongRef } from "@babylonjs/smart-filters";
import type { InitializationData } from "core/src/smartFilter";
import {
ConnectionPointType,
type SmartFilter,
type InitializationData,
InputBlock,
createStrongRef,
editableInPropertyPage,
PropertyTypeForEdition,
type IEditablePropertyListOption,
} from "@babylonjs/smart-filters-editor";
} from "@babylonjs/smart-filters";
import { Observable } from "@babylonjs/core/Misc/observable";

export type WebCamSource = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { Effect } from "@babylonjs/core/Materials/effect";

import {
type SmartFilter,
type IDisableableBlock,
type RuntimeData,
DisableableShaderBinding,
type ShaderProgram,
editableInPropertyPage,
PropertyTypeForEdition,
} from "@babylonjs/smart-filters";
import { ConnectionPointType, DisableableShaderBlock } from "@babylonjs/smart-filters";
import { BlockNames } from "../blockNames";
import { editableInPropertyPage, PropertyTypeForEdition } from "@babylonjs/smart-filters-editor";

const shaderProgram: ShaderProgram = {
fragment: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { Effect } from "@babylonjs/core/Materials/effect";

import {
type SmartFilter,
type IDisableableBlock,
type RuntimeData,
DisableableShaderBinding,
DisableableShaderBlock,
type ShaderProgram,
editableInPropertyPage,
PropertyTypeForEdition,
} from "@babylonjs/smart-filters";
import { ConnectionPointType } from "@babylonjs/smart-filters";
import { BlockNames } from "../blockNames";
import { editableInPropertyPage, PropertyTypeForEdition } from "@babylonjs/smart-filters-editor";

const shaderProgram: ShaderProgram = {
fragment: {
Expand Down
1 change: 0 additions & 1 deletion packages/demo/src/helpers/createThinEngine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ThinEngine } from "@babylonjs/core/Engines/thinEngine";
import "@babylonjs/core/Engines/Extensions/engine.alpha.js";

export function createThinEngine(canvas: HTMLCanvasElement) {
const antialias = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import * as react from "react";
import { LineContainerComponent } from "../../sharedComponents/lineContainerComponent.js";

import { TextInputLineComponent } from "@babylonjs/shared-ui-components/lines/textInputLineComponent.js";
import { TextLineComponent } from "@babylonjs/shared-ui-components/lines/textLineComponent.js";
import type { IPropertyComponentProps } from "@babylonjs/shared-ui-components/nodeGraphSystem/interfaces/propertyComponentProps";
import type { BaseBlock } from "@babylonjs/smart-filters";
import {
type BaseBlock,
PropertyTypeForEdition,
type IEditablePropertyOption,
type IPropertyDescriptionForEdition,
} from "../../nodeDecorators/editableInPropertyPage.js";
} from "@babylonjs/smart-filters";
import { CheckBoxLineComponent } from "../../sharedComponents/checkBoxLineComponent.js";
import { FloatSliderComponent } from "../../sharedComponents/floatSliderComponent.js";
import { FloatLineComponent } from "@babylonjs/shared-ui-components/lines/floatLineComponent.js";
Expand Down
1 change: 0 additions & 1 deletion packages/editor/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ export { createDefaultValue } from "./graphSystem/registerDefaultInput.js";

export type { TexturePreset } from "./globalState.js";
export * from "./helpers/serializationTools.js";
export * from "./nodeDecorators/editableInPropertyPage.js";

0 comments on commit ae3ed18

Please sign in to comment.