babylon.quarks-editor 0.17.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/core/binding.d.ts +43 -0
- package/dist/core/binding.js +82 -0
- package/dist/core/collision.d.ts +20 -0
- package/dist/core/collision.js +39 -0
- package/dist/core/colors.d.ts +31 -0
- package/dist/core/colors.js +60 -0
- package/dist/core/effectTree.d.ts +25 -0
- package/dist/core/effectTree.js +115 -0
- package/dist/core/groups.d.ts +12 -0
- package/dist/core/groups.js +27 -0
- package/dist/core/history.d.ts +25 -0
- package/dist/core/history.js +69 -0
- package/dist/core/loadEffect.d.ts +8 -0
- package/dist/core/loadEffect.js +87 -0
- package/dist/core/scrub.d.ts +11 -0
- package/dist/core/scrub.js +24 -0
- package/dist/core/shapes.d.ts +31 -0
- package/dist/core/shapes.js +98 -0
- package/dist/core/systems.d.ts +25 -0
- package/dist/core/systems.js +76 -0
- package/dist/core/textureExport.d.ts +9 -0
- package/dist/core/textureExport.js +58 -0
- package/dist/core/timeline.d.ts +35 -0
- package/dist/core/timeline.js +69 -0
- package/dist/core/values.d.ts +31 -0
- package/dist/core/values.js +81 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +9 -0
- package/dist/react/CurveEditor.d.ts +12 -0
- package/dist/react/CurveEditor.js +106 -0
- package/dist/react/EffectEditor.d.ts +22 -0
- package/dist/react/EffectEditor.js +30 -0
- package/dist/react/EffectEditorHost.d.ts +42 -0
- package/dist/react/EffectEditorHost.js +247 -0
- package/dist/react/GradientEditor.d.ts +7 -0
- package/dist/react/GradientEditor.js +72 -0
- package/dist/react/ModuleSection.d.ts +9 -0
- package/dist/react/ModuleSection.js +24 -0
- package/dist/react/PromptDialog.d.ts +14 -0
- package/dist/react/PromptDialog.js +45 -0
- package/dist/react/SubEmittersModule.d.ts +10 -0
- package/dist/react/SubEmittersModule.js +39 -0
- package/dist/react/TimelinePanel.d.ts +32 -0
- package/dist/react/TimelinePanel.js +225 -0
- package/dist/react/TimelineTrackRow.d.ts +23 -0
- package/dist/react/TimelineTrackRow.js +107 -0
- package/dist/react/ValueField.d.ts +13 -0
- package/dist/react/ValueField.js +19 -0
- package/dist/react/behaviorModules.d.ts +23 -0
- package/dist/react/behaviorModules.js +139 -0
- package/dist/react/fields.d.ts +24 -0
- package/dist/react/fields.js +30 -0
- package/dist/react/index.d.ts +20 -0
- package/dist/react/index.js +14 -0
- package/dist/react/modules.d.ts +35 -0
- package/dist/react/modules.js +439 -0
- package/dist/react/theme.d.ts +26 -0
- package/dist/react/theme.js +78 -0
- package/package.json +63 -0
- package/src/core/binding.ts +105 -0
- package/src/core/collision.ts +40 -0
- package/src/core/colors.ts +84 -0
- package/src/core/effectTree.ts +143 -0
- package/src/core/groups.ts +29 -0
- package/src/core/history.ts +77 -0
- package/src/core/loadEffect.ts +102 -0
- package/src/core/scrub.ts +28 -0
- package/src/core/shapes.ts +133 -0
- package/src/core/systems.ts +98 -0
- package/src/core/textureExport.ts +63 -0
- package/src/core/timeline.ts +94 -0
- package/src/core/values.ts +113 -0
- package/src/index.ts +32 -0
- package/src/react/CurveEditor.tsx +168 -0
- package/src/react/EffectEditor.tsx +111 -0
- package/src/react/EffectEditorHost.tsx +377 -0
- package/src/react/GradientEditor.tsx +127 -0
- package/src/react/ModuleSection.tsx +54 -0
- package/src/react/PromptDialog.tsx +85 -0
- package/src/react/SubEmittersModule.tsx +80 -0
- package/src/react/TimelinePanel.tsx +354 -0
- package/src/react/TimelineTrackRow.tsx +267 -0
- package/src/react/ValueField.tsx +60 -0
- package/src/react/behaviorModules.tsx +658 -0
- package/src/react/fields.tsx +76 -0
- package/src/react/index.ts +43 -0
- package/src/react/modules.tsx +1034 -0
- package/src/react/theme.ts +85 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, {useEffect, useState} from 'react';
|
|
2
|
+
import {inputStyle, labelStyle, rowStyle} from './theme';
|
|
3
|
+
|
|
4
|
+
export function Row(props: {label: string; children: React.ReactNode}) {
|
|
5
|
+
return (
|
|
6
|
+
<div style={rowStyle}>
|
|
7
|
+
<span style={labelStyle} title={props.label}>
|
|
8
|
+
{props.label}
|
|
9
|
+
</span>
|
|
10
|
+
{props.children}
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Number input that keeps focus-friendly local text state and commits parsed values. */
|
|
16
|
+
export function NumberField(props: {value: number; onChange: (value: number) => void; step?: number; min?: number}) {
|
|
17
|
+
const [text, setText] = useState(String(round(props.value)));
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setText(String(round(props.value)));
|
|
20
|
+
}, [props.value]);
|
|
21
|
+
return (
|
|
22
|
+
<input
|
|
23
|
+
type="number"
|
|
24
|
+
className="qe-hover"
|
|
25
|
+
style={inputStyle}
|
|
26
|
+
value={text}
|
|
27
|
+
step={props.step ?? 0.1}
|
|
28
|
+
min={props.min}
|
|
29
|
+
onChange={(e) => {
|
|
30
|
+
setText(e.target.value);
|
|
31
|
+
const parsed = parseFloat(e.target.value);
|
|
32
|
+
if (!Number.isNaN(parsed)) {
|
|
33
|
+
props.onChange(props.min !== undefined ? Math.max(props.min, parsed) : parsed);
|
|
34
|
+
}
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function CheckboxField(props: {value: boolean; onChange: (value: boolean) => void}) {
|
|
41
|
+
return (
|
|
42
|
+
<input
|
|
43
|
+
type="checkbox"
|
|
44
|
+
className="qe-hover"
|
|
45
|
+
checked={props.value}
|
|
46
|
+
onChange={(e) => props.onChange(e.target.checked)}
|
|
47
|
+
style={{justifySelf: 'start', width: 15, height: 15, accentColor: '#78a5ff', cursor: 'pointer'}}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function SelectField<T extends string | number>(props: {
|
|
53
|
+
value: T;
|
|
54
|
+
options: Array<{value: T; label: string}>;
|
|
55
|
+
onChange: (value: T) => void;
|
|
56
|
+
}) {
|
|
57
|
+
const numeric = typeof props.value === 'number';
|
|
58
|
+
return (
|
|
59
|
+
<select
|
|
60
|
+
className="qe-hover"
|
|
61
|
+
style={{...inputStyle, cursor: 'pointer'}}
|
|
62
|
+
value={String(props.value)}
|
|
63
|
+
onChange={(e) => props.onChange((numeric ? Number(e.target.value) : e.target.value) as T)}
|
|
64
|
+
>
|
|
65
|
+
{props.options.map((o) => (
|
|
66
|
+
<option key={String(o.value)} value={String(o.value)}>
|
|
67
|
+
{o.label}
|
|
68
|
+
</option>
|
|
69
|
+
))}
|
|
70
|
+
</select>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function round(v: number): number {
|
|
75
|
+
return Math.round(v * 1000) / 1000;
|
|
76
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export {EffectEditor} from './EffectEditor';
|
|
2
|
+
export type {EffectEditorProps} from './EffectEditor';
|
|
3
|
+
export {
|
|
4
|
+
SpeedOverLifeModule,
|
|
5
|
+
LimitSpeedOverLifeModule,
|
|
6
|
+
ForceOverLifeModule,
|
|
7
|
+
GravityModule,
|
|
8
|
+
RotationOverLifeModule,
|
|
9
|
+
NoiseModule,
|
|
10
|
+
TurbulenceModule,
|
|
11
|
+
CollisionModule,
|
|
12
|
+
EmitDirectionModule,
|
|
13
|
+
TextureSheetModule,
|
|
14
|
+
ColorBySpeedModule,
|
|
15
|
+
SizeBySpeedModule,
|
|
16
|
+
RotationBySpeedModule,
|
|
17
|
+
OrbitOverLifeModule,
|
|
18
|
+
WidthOverTrailModule,
|
|
19
|
+
} from './behaviorModules';
|
|
20
|
+
export type {TextureOption, GeometryOption, GeometryData} from './modules';
|
|
21
|
+
export {SubEmittersModule} from './SubEmittersModule';
|
|
22
|
+
export {TimelinePanel} from './TimelinePanel';
|
|
23
|
+
export type {TimelinePanelProps, PlaybackState} from './TimelinePanel';
|
|
24
|
+
export {TimelineTrackRow} from './TimelineTrackRow';
|
|
25
|
+
export type {TimelineTrackRowProps} from './TimelineTrackRow';
|
|
26
|
+
export {ModuleSection} from './ModuleSection';
|
|
27
|
+
export {PromptDialog} from './PromptDialog';
|
|
28
|
+
export type {PromptDialogProps} from './PromptDialog';
|
|
29
|
+
export {CurveEditor} from './CurveEditor';
|
|
30
|
+
export {GradientEditor} from './GradientEditor';
|
|
31
|
+
export {ValueField} from './ValueField';
|
|
32
|
+
export {Row, NumberField, CheckboxField, SelectField} from './fields';
|
|
33
|
+
export {
|
|
34
|
+
MainModule,
|
|
35
|
+
EmissionModule,
|
|
36
|
+
ShapeModule,
|
|
37
|
+
SizeOverLifeModule,
|
|
38
|
+
ColorOverLifeModule,
|
|
39
|
+
RendererModule,
|
|
40
|
+
} from './modules';
|
|
41
|
+
export {theme, inputStyle, rowStyle, labelStyle, buttonStyle} from './theme';
|
|
42
|
+
export {EffectEditorHost, QuarksEffectEditor} from './EffectEditorHost';
|
|
43
|
+
export type {EffectEditorHostProps, EffectEditorHostHandle} from './EffectEditorHost';
|