geonodes-web-render 0.3.14 → 0.3.15

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.
@@ -0,0 +1,7 @@
1
+ import { ColorRampData } from '../ir/types';
2
+ /** Evaluate the ramp at t∈[0,1], returning scene-linear RGBA. */
3
+ export declare function evalColorRamp(data: ColorRampData, t: number): [number, number, number, number];
4
+ export declare function ColorRampViz({ data, width }: {
5
+ data: ColorRampData;
6
+ width: number;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { NodeProps } from '@xyflow/react';
2
+ export declare function NodeFrame(props: NodeProps): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { FloatCurveData, GraphIR, SocketDefaultValue, SocketDisplayShape } from '../ir/types';
1
+ import { ColorRampData, FloatCurveData, GraphIR, SocketDefaultValue, SocketDisplayShape } from '../ir/types';
2
2
  type BlenderSocket = {
3
3
  id: number;
4
4
  data: {
@@ -19,6 +19,7 @@ type BlenderNode = {
19
19
  width?: number;
20
20
  location?: [number, number];
21
21
  location_absolute?: [number, number];
22
+ parent?: number | null;
22
23
  inputs?: {
23
24
  data: {
24
25
  items: BlenderSocket[];
@@ -66,6 +67,24 @@ type BlenderNode = {
66
67
  };
67
68
  };
68
69
  };
70
+ color_ramp?: {
71
+ data: {
72
+ interpolation?: string;
73
+ hue_interpolation?: string;
74
+ color_mode?: string;
75
+ elements: {
76
+ data: {
77
+ items: Array<{
78
+ data: {
79
+ color: [number, number, number, number];
80
+ alpha?: number;
81
+ position: number;
82
+ };
83
+ }>;
84
+ };
85
+ };
86
+ };
87
+ };
69
88
  };
70
89
  };
71
90
  type BlenderLink = {
@@ -119,10 +138,13 @@ export type NormalizedNode = {
119
138
  inputs: NormalizedSocket[];
120
139
  outputs: NormalizedSocket[];
121
140
  floatCurve?: FloatCurveData;
141
+ colorRamp?: ColorRampData;
122
142
  properties?: Record<string, string>;
123
143
  /** For group nodes: id/name of the referenced node tree (if present in the export). */
124
144
  groupTreeId?: string;
125
145
  groupTreeName?: string;
146
+ /** Id of the NodeFrame this node is parented to (Blender "parent"), if any. */
147
+ parentFrameId?: string;
126
148
  };
127
149
  export type NormalizedLink = {
128
150
  id: string;
@@ -11,6 +11,20 @@ export type FloatCurveData = {
11
11
  extend: string;
12
12
  points: FloatCurvePoint[];
13
13
  };
14
+ export type ColorRampStop = {
15
+ position: number;
16
+ /** Scene-linear RGBA, as stored by Blender. */
17
+ color: [number, number, number, number];
18
+ };
19
+ export type ColorRampData = {
20
+ /** LINEAR | EASE | CONSTANT | B_SPLINE | CARDINAL */
21
+ interpolation: string;
22
+ /** RGB | HSV | HSL */
23
+ colorMode: string;
24
+ /** NEAR | FAR | CW | CCW */
25
+ hueInterpolation: string;
26
+ stops: ColorRampStop[];
27
+ };
14
28
  export type SocketDisplayShape = 'CIRCLE' | 'DIAMOND' | 'LINE' | 'LIST' | 'VOLUME_GRID';
15
29
  export type SocketDefaultValue = {
16
30
  kind: 'scalar';
@@ -45,11 +59,14 @@ export type NodeIR = {
45
59
  inputs: SocketIR[];
46
60
  outputs: SocketIR[];
47
61
  floatCurve?: FloatCurveData;
62
+ colorRamp?: ColorRampData;
48
63
  /** Node-type-specific enum properties (e.g. operation, data_type for Compare) */
49
64
  properties?: Record<string, string>;
50
65
  /** For group nodes: id/name of the referenced node tree within the export */
51
66
  groupTreeId?: string;
52
67
  groupTreeName?: string;
68
+ /** Id of the NodeFrame this node is parented to (Blender "parent"), if any. */
69
+ parentFrameId?: string;
53
70
  };
54
71
  export type EdgeIR = {
55
72
  id: string;
@@ -1,5 +1,5 @@
1
1
  import { Edge, Node } from '@xyflow/react';
2
- import { FloatCurveData, GraphIR, SocketIR } from '../ir/types';
2
+ import { ColorRampData, FloatCurveData, GraphIR, SocketIR } from '../ir/types';
3
3
  export type GNFlowNodeData = {
4
4
  label: string;
5
5
  type: string;
@@ -9,6 +9,7 @@ export type GNFlowNodeData = {
9
9
  outputs: SocketIR[];
10
10
  connectedInputIds: string[];
11
11
  floatCurve?: FloatCurveData;
12
+ colorRamp?: ColorRampData;
12
13
  properties?: Record<string, string>;
13
14
  groupTreeId?: string;
14
15
  groupTreeName?: string;
@@ -21,6 +22,9 @@ export type GNRerouteNodeData = {
21
22
  export type SimulationZoneNodeData = {
22
23
  label: string;
23
24
  };
25
+ export type NodeFrameData = {
26
+ label: string;
27
+ };
24
28
  export declare function mapGraphIRToFlow(graph: GraphIR): {
25
29
  nodes: Node[];
26
30
  edges: Edge[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geonodes-web-render",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
4
4
  "description": "Browser-based viewer for Blender Geometry Nodes exported via Tree Clipper. Renders node trees as a read-only, Blender-styled graph.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -32,7 +32,6 @@
32
32
  "build:lib": "vite build --config vite.lib.config.ts",
33
33
  "lint": "eslint .",
34
34
  "preview": "vite preview",
35
- "convert:nodebpy": "rolldown scripts/convertExamples.ts --format esm --file node_modules/.tmp/convertExamples.mjs --external node:fs --external node:path && node node_modules/.tmp/convertExamples.mjs",
36
35
  "prepublishOnly": "npm run build:lib"
37
36
  },
38
37
  "dependencies": {