Skip to content

Effect editor#755

Open
Soullnik wants to merge 85 commits into
BabylonJS:masterfrom
Soullnik:feat/fx-editor
Open

Effect editor#755
Soullnik wants to merge 85 commits into
BabylonJS:masterfrom
Soullnik:feat/fx-editor

Conversation

@Soullnik
Copy link
Copy Markdown
Contributor

No description provided.

@Soullnik Soullnik marked this pull request as draft December 19, 2025 13:37
Comment thread tools/src/effect/loggers/logger.ts Outdated
/**
* Logger utility for operations
*/
export class Logger {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me there is already a lotter in Babylon.js (like Tools.Warn(...) etc.).
Is it not enought? Saying it's not fitting your needs is completely acceptable and we could go with that logger you propose

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have removed my development logs, and use Tools.Warn for all cases

/**
* Utility for calculating particle system capacity
*/
export class CapacityCalculator {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static classes are considered deprecated. In the editor, functions like those static methods are exposed as simple exported functions like export function (calculateForParticleSystem) { ... }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,407 @@
import { ReactNode, MouseEvent, useState, useRef, useEffect } from "react";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really awesome, I'll check if they fit the requirements for the generic particle systems already supported by the editor. The particle system inspector also defines a gradient component to help modifying the gradients. If it fits, maybe replace the existing one with the one you propose combined with the gradient.tsx provided in the inspector/fields folder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you move this component to the fields, and then I can use it in my place, although I'm not sure that everything works well there

{mesh && (
<div className="flex flex-col gap-1 mt-1 w-full">
<EditorInspectorNumberField noUndoRedo={this.props.noUndoRedo} label="Vertices" object={{ count: mesh.getTotalVertices() }} property="count" />
<EditorInspectorNumberField
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be drawn as a simple react element like here for example: https://github.com/BabylonJS/Editor/blob/master/editor/src/editor/layout/inspector/mesh/mesh.tsx#L105
This example draws the type of the mesh which is not editable but here just for information

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread editor/src/editor/layout/toolbar.tsx Outdated
<MenubarMenu>
<MenubarTrigger>Window</MenubarTrigger>
<MenubarContent className="border-black/50">
<MenubarItem onClick={() => this._handleOpenFXEditor()}>FX Editor...</MenubarItem>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we treat FX like an asset. And then the FX Editor would open on the user double-clicks the asset in the assets panel. And everything saved in the FX Editor would be saved in the asset (the asset can be a folder). We can discuss it together so I can present you how I managed .navmesh asset type (which is a folder asset containing the configuration of navmesh and bin files for pre-computed navmesh to improve loading time when playing the game)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to take care of adding the .fx files to the assets, open that file with a mouse click, and remove the effects editor from the window menu. after base implementaton

@Soullnik Soullnik marked this pull request as ready for review February 11, 2026 06:34
Mikalai Lazitski added 22 commits March 31, 2026 21:20
…ding add, delete, and context menu interactions
…viors, geometry handling, and new types for improved visual effects management
…or components for improved clarity and performance
…imports for improved clarity and consistency
…Editor for improved node handling and clarity
…reation and transformation application for improved performance and clarity
…and consolidating emitter factories for improved clarity and performance
… by integrating emitter logic into VFXSystemFactory for improved clarity and performance
…d matrix utility classes, improving particle system initialization and configuration for better performance and clarity
…ce management and streamline geometry and material creation processes
…factories and enhancing gradient systems for improved performance and clarity
Mikalai Lazitski and others added 15 commits March 31, 2026 21:22
- Included necessary shader imports to enable particle system functionality.
- Note: This approach is not ideal but is currently required for proper shader loading.
- Changed rotation representation from Quaternion to Vector3 in QuarksConverter and UnityConverter for consistency.
- Simplified rotation handling in EffectEditorObjectProperties by removing the custom rotation inspector and directly using Vector3.
- Updated NodeFactory and EffectSolidParticleSystem to reflect the new rotation type, ensuring compatibility across the system.
- Adjusted ITransform interface to use Vector3 for rotation, enhancing clarity in transformation definitions.
- Removed unused import of EffectSolidParticleSystem and EffectParticleSystem from babylonjs-editor-tools.
- Streamlined the code for better readability and maintainability.
…nodeFactory

- Introduced a new method to convert column-major matrices to row-major format for Babylon.js compatibility in QuarksConverter.
- Updated the transform application in nodeFactory to utilize the new conversion method, ensuring consistent handling of particle system transforms.
…ctions

- Updated import paths for consistency and clarity in the Quarks converter files.
- Refactored the QuarksConverter to utilize new utility functions for converting materials, textures, and images.
- Introduced new files for behavior, color, and resource conversion, enhancing modularity and maintainability.
- Added constants for default values used in conversions, improving code readability.
- Implemented transform conversion utilities to handle right-handed to left-handed matrix transformations.
…ditor

- Consolidated import statements across various files for improved clarity and consistency.
- Removed unnecessary line breaks and whitespace to enhance code readability.
- Updated function implementations to utilize new utility functions for parsing values, ensuring a more modular approach.
- Cleaned up unused imports and streamlined logic in several converter files, contributing to better maintainability.
- Replaced the EditorInspectorNumberField components with a more structured layout for displaying vertices and faces.
- Enhanced the visual presentation by using flexbox for better alignment and spacing of the geometry information.
- Removed unnecessary imports to streamline the code.
- Introduced a new context menu item to add FX files directly from the assets browser.
- Implemented loading and saving of FX files with a new structured format, supporting backward compatibility.
- Updated the effect editor to handle both new and old file formats, ensuring seamless integration.
- Enhanced serialization methods for effects, allowing for better data management and export capabilities.
- Cleaned up unused imports and streamlined the code for improved readability and maintainability.
- Replaced the originalJsonData property with a more comprehensive data structure for effects, enhancing serialization capabilities.
- Introduced a new method to serialize effects to IData format, improving data management during export.
- Cleaned up console logs and unnecessary comments to streamline the code.
- Updated various references to ensure consistency with the new data structure.
- Added a new deserializer module to convert JSON data into proper Color4, Vector3, Quaternion instances, enhancing data integrity.
- Updated the EffectEditorGraph to utilize the new deserialization methods, ensuring compatibility with both new and old effect data formats.
- Streamlined the handling of effect data by replacing direct assignments with deserialized instances, improving code clarity and maintainability.
…larity

- Refactored the createParticleMesh method to accept parameters in a more intuitive order, enhancing usability.
- Updated the createMaterial method to handle undefined materialId, providing a default PBR material when necessary.
- Adjusted the internal logic of the _loadParticleGeometry method to streamline geometry loading based on instancingGeometry ID.
- Enhanced the EffectSolidParticleSystem to support setting mesh material, improving flexibility in particle system configurations.
…r application

- Introduced BEHAVIOR_TYPES constants for consistent behavior type management across the editor and runtime.
- Updated the BehaviorRegistry to utilize these constants, improving maintainability and reducing potential errors.
- Refactored behavior application logic in EffectParticleSystem and EffectSolidParticleSystem to streamline the application of system-level and per-particle behaviors.
- Added a new behaviorApplier module to centralize behavior application logic, enhancing code organization and clarity.
- Improved color handling in various behaviors to ensure colors are converted to linear space for accurate rendering.
…y access

- Introduced a new utility function `getUnityProp` to streamline access to Unity serialized properties, supporting both standard and prefixed naming conventions.
- Updated various converters (e.g., color, shape, particle system) to utilize the new utility function, improving code clarity and reducing redundancy.
- Refactored error handling in the Unity prefab conversion process to ensure consistent return of empty data structures on failure.
- Enhanced the handling of GameObject and component references to ensure proper type conversion and error resilience.
…tions

- Removed redundant "converted from Quarks" comments across various type definition files to enhance clarity.
- Standardized comment formatting for better readability and consistency in the codebase.
- Ensured that all type definitions maintain a clear and concise description of their purpose.
@Soullnik Soullnik closed this Apr 1, 2026
@Soullnik Soullnik deleted the feat/fx-editor branch April 1, 2026 07:54
@Soullnik Soullnik restored the feat/fx-editor branch April 1, 2026 07:54
@Soullnik Soullnik reopened this Apr 1, 2026
Mikalai Lazitski added 10 commits May 11, 2026 18:36
- Added `babylon.quarks` dependency to package.json for enhanced particle system capabilities.
- Introduced new `compat-lite.ts` file to define behaviors and types for Quarks integration.
- Updated `EffectEditorGraph` to handle Quarks effect documents, including loading and playback functionalities.
- Refactored `EffectEditorPreview` and `EffectEditorToolbar` to support Quarks-based effects.
- Removed unused Unity import modal and related converter files to streamline the codebase.
- Enhanced error handling and user notifications for effect loading processes.
- Deleted the `compat-lite.ts` file and migrated its contents to a new `types.ts` file for better organization and clarity.
- Updated various editor components to reference the new `types.ts`, ensuring consistent type definitions across the effect editor.
- Enhanced the handling of color and value parsing functions within the new types module.
- Streamlined the codebase by removing outdated references and improving import statements.
- Introduced a new `quarks-adapter.ts` file to define types and utility functions for handling color, value, and rotation in the effect editor.
- Added interfaces for various editor value types, including constant values, intervals, piecewise bezier curves, and color definitions.
- Implemented functions to convert between editor values and quarks generators, enhancing integration with the quarks library.
- Updated existing editor components to utilize the new adapter functions for improved consistency and maintainability.
- Changed the default effect version from "1.0.0" to "quarks-editor-1" for better version tracking.
- Improved the effect editor's handling of empty effects by creating a default effect document when no effects are loaded.
- Enhanced the playback state management by ensuring natural idle tracking for effects, improving user experience during playback.
- Updated the save functionality to allow saving to a specified file path, enhancing flexibility in file management.
- Introduced a new preview selection feature to visually indicate selected nodes in the effect editor, improving usability.
- Updated package.json scripts to use del-cli instead of rimraf for cleaning up node_modules and build directories across various packages.
- Refactored effect editor and plugin package scripts to enhance consistency in post-installation and cleaning processes.
- Improved code readability by consolidating import statements and simplifying script commands in multiple files.
- Removed unused imports in preview.tsx for better clarity.
- Added missing Engine import in preview-selection.ts to support depth function adjustments.
- Updated material properties in preview-selection.ts to improve rendering behavior.
- Enhanced EditorMultiMaterialInspector usage in renderer.tsx to include editor state, improving integration with the effect editor.
- Changed the format of the node-gyp dependency URL in yarn.lock to use the standard HTTPS format instead of the git+ prefix, ensuring better compatibility and clarity in dependency resolution.
- Introduced user-controlled expansion state for tree nodes in the EffectEditorGraph, allowing users to expand or collapse nodes without losing their previous state.
- Updated the tree node rendering logic to respect user overrides for expanded states.
- Modified the EffectColorEditor to ensure color changes are directly applied to the respective properties, improving user interaction and experience.
…editor

- Updated the geometry field to support embedded placeholder text and instancing counts for better visualization when no mesh is assigned.
- Introduced a new ShaderMaterial inspector component to manage shader properties and texture slots, improving the material editing experience.
- Enhanced the import functionality to ensure proper loading of GLB/GLTF files with necessary scene loader plugins.
- Improved effect editor's handling of particle systems by integrating new utility functions for geometry and material management.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants