Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo-artwork/changing-seasons.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/isometric-fountain.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/marbled-mandelbrot.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/painted-dreams.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/parametric-dunescape.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/procedural-string-lights.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/red-dress.graphite

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo-artwork/valley-of-spires.graphite

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use graphene_std::text::{Font, TypesettingConfig};
use graphene_std::vector::VectorData;
use graphene_std::vector::style::{Fill, Stroke};
use graphene_std::vector::{PointId, VectorModificationType};
use graphene_std::{GraphicElement, NodeInputDecleration};
use graphene_std::{Graphic, NodeInputDecleration};

#[derive(PartialEq, Clone, Copy, Debug, serde::Serialize, serde::Deserialize)]
pub enum TransformIn {
Expand Down Expand Up @@ -303,7 +303,7 @@ impl<'a> ModifyInputsContext<'a> {
// TODO: Allow the path node to operate on Graphic Group data by utilizing the reference for each vector data in a group.
if node_definition.identifier == "Path" {
let layer_input_type = self.network_interface.input_type(&InputConnector::node(output_layer.to_node(), 1), &[]).0.nested_type().clone();
if layer_input_type == concrete!(Table<GraphicElement>) {
if layer_input_type == concrete!(Table<Graphic>) {
let Some(flatten_path_definition) = resolve_document_node_type("Flatten Path") else {
log::error!("Flatten Path does not exist in ModifyInputsContext::existing_node_id");
return None;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use graphene_std::transform::{Footprint, ReferencePoint, Transform};
use graphene_std::vector::VectorData;
use graphene_std::vector::misc::{ArcType, CentroidType, GridType, MergeByDistanceAlgorithm, PointSpacingType};
use graphene_std::vector::style::{Fill, FillChoice, FillType, GradientStops, GradientType, PaintOrder, StrokeAlign, StrokeCap, StrokeJoin};
use graphene_std::{GraphicElement, NodeInputDecleration};
use graphene_std::{Graphic, NodeInputDecleration};

pub(crate) fn string_properties(text: &str) -> Vec<LayoutGroup> {
let widget = TextLabel::new(text).widget_holder();
Expand Down Expand Up @@ -185,7 +185,7 @@ pub(crate) fn property_from_type(
// ====================
Some(x) if x == TypeId::of::<Table<VectorData>>() => vector_data_widget(default_info).into(),
Some(x) if x == TypeId::of::<Table<Raster<CPU>>>() || x == TypeId::of::<Table<Raster<GPU>>>() => raster_widget(default_info).into(),
Some(x) if x == TypeId::of::<Table<GraphicElement>>() => group_widget(default_info).into(),
Some(x) if x == TypeId::of::<Table<Graphic>>() => group_widget(default_info).into(),
// ============
// STRUCT TYPES
// ============
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6611,7 +6611,7 @@ struct InputTransientMetadata {
fn migrate_output_names<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Result<Vec<String>, D::Error> {
use serde::Deserialize;

const REPLACEMENTS: [(&str, &str); 12] = [
const REPLACEMENTS: &[(&str, &str)] = &[
// Single to table data
("VectorData", "Table<VectorData>"),
("GraphicGroup", "Table<GraphicGroup>"),
Expand All @@ -6622,11 +6622,13 @@ fn migrate_output_names<'de, D: serde::Deserializer<'de>>(deserializer: D) -> Re
("Instances<VectorData>", "Table<VectorData>"),
("Instances<GraphicGroup>", "Table<GraphicGroup>"),
("Instances<Image>", "Table<Image>"),
("Instances<GraphicElement>", "Table<GraphicElement>"),
("Instances<GraphicElement>", "Table<Graphic>"),
("Table<GraphicElement>", "Table<Graphic>"),
("Future<Instances<VectorData>>", "Future<Table<VectorData>>"),
("Future<Instances<GraphicGroup>>", "Future<Table<GraphicGroup>>"),
("Future<Instances<Image>>", "Future<Table<Image>>"),
("Future<Instances<GraphicElement>>", "Future<Table<GraphicElement>>"),
("Future<Instances<GraphicElement>>", "Future<Table<Graphic>>"),
("Future<Table<GraphicElement>>", "Future<Table<Graphic>>"),
];

let mut names = Vec::<String>::deserialize(deserializer)?;
Expand Down
2 changes: 1 addition & 1 deletion editor/src/messages/portfolio/document_migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const NODE_REPLACEMENTS: &[NodeReplacement<'static>] = &[
},
NodeReplacement {
node: graphene_std::graphic_element::to_element::IDENTIFIER,
aliases: &["graphene_core::ToGraphicElementNode"],
aliases: &["graphene_core::ToGraphicElementNode", "graphene_core::graphic_element::ToElementNode"],
},
NodeReplacement {
node: graphene_std::graphic_element::to_group::IDENTIFIER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use graphene_std::memo::IORecord;
use graphene_std::raster::Image;
use graphene_std::table::Table;
use graphene_std::vector::VectorData;
use graphene_std::{Artboard, GraphicElement};
use graphene_std::{Artboard, Graphic};
use std::any::Any;
use std::sync::Arc;

Expand Down Expand Up @@ -120,9 +120,9 @@ fn generate_layout(introspected_data: &Arc<dyn std::any::Any + Send + Sync + 'st
Some(io.output.layout_with_breadcrumb(data))
} else if let Some(io) = introspected_data.downcast_ref::<IORecord<(), Table<VectorData>>>() {
Some(io.output.layout_with_breadcrumb(data))
} else if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, Table<GraphicElement>>>() {
} else if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, Table<Graphic>>>() {
Some(io.output.layout_with_breadcrumb(data))
} else if let Some(io) = introspected_data.downcast_ref::<IORecord<(), Table<GraphicElement>>>() {
} else if let Some(io) = introspected_data.downcast_ref::<IORecord<(), Table<Graphic>>>() {
Some(io.output.layout_with_breadcrumb(data))
} else {
None
Expand All @@ -148,9 +148,9 @@ trait TableRowLayout {
fn compute_layout(&self, data: &mut LayoutData) -> Vec<LayoutGroup>;
}

impl TableRowLayout for GraphicElement {
impl TableRowLayout for Graphic {
fn type_name() -> &'static str {
"GraphicElement"
"Graphic"
}
fn identifier(&self) -> String {
match self {
Expand All @@ -160,16 +160,16 @@ impl TableRowLayout for GraphicElement {
Self::RasterDataGPU(_) => "RasterDataGPU".to_string(),
}
}
// Don't put a breadcrumb for GraphicElement
// Don't put a breadcrumb for Graphic
fn layout_with_breadcrumb(&self, data: &mut LayoutData) -> Vec<LayoutGroup> {
self.compute_layout(data)
}
fn compute_layout(&self, data: &mut LayoutData) -> Vec<LayoutGroup> {
match self {
Self::GraphicGroup(table) => table.layout_with_breadcrumb(data),
Self::VectorData(table) => table.layout_with_breadcrumb(data),
Self::RasterDataCPU(_) => label("Raster frame not supported"),
Self::RasterDataGPU(_) => label("Raster frame not supported"),
Self::RasterDataCPU(_) => label("Raster is not supported"),
Self::RasterDataGPU(_) => label("Raster is not supported"),
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions editor/src/node_graph_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use graph_craft::wasm_application_io::EditorPreferences;
use graphene_std::application_io::TimingInformation;
use graphene_std::application_io::{NodeGraphUpdateMessage, RenderConfig};
use graphene_std::renderer::RenderSvgSegmentList;
use graphene_std::renderer::{GraphicElementRendered, RenderParams, SvgRender};
use graphene_std::renderer::{Render, RenderParams, SvgRender};
use graphene_std::renderer::{RenderMetadata, format_transform_matrix};
use graphene_std::text::FontCache;
use graphene_std::transform::Footprint;
Expand Down Expand Up @@ -321,7 +321,7 @@ impl NodeGraphExecutor {
Ok(())
}

fn debug_render(render_object: impl GraphicElementRendered, transform: DAffine2, responses: &mut VecDeque<Message>) {
fn debug_render(render_object: impl Render, transform: DAffine2, responses: &mut VecDeque<Message>) {
// Setup rendering
let mut render = SvgRender::new();
let render_params = RenderParams {
Expand Down
12 changes: 6 additions & 6 deletions editor/src/node_graph_executor/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use graph_craft::{ProtoNodeIdentifier, concrete};
use graphene_std::Context;
use graphene_std::application_io::{ImageTexture, NodeGraphUpdateMessage, NodeGraphUpdateSender, RenderConfig};
use graphene_std::memo::IORecord;
use graphene_std::renderer::{GraphicElementRendered, RenderParams, SvgRender};
use graphene_std::renderer::{Render, RenderParams, SvgRender};
use graphene_std::renderer::{RenderSvgSegmentList, SvgSegment};
use graphene_std::table::{Table, TableRow};
use graphene_std::text::FontCache;
Expand Down Expand Up @@ -299,7 +299,7 @@ impl NodeRuntime {
continue;
};

// Extract the monitor node's stored `GraphicElement` data.
// Extract the monitor node's stored `Graphic` data.
let Ok(introspected_data) = self.executor.introspect(monitor_node_path) else {
// TODO: Fix the root of the issue causing the spam of this warning (this at least temporarily disables it in release builds)
#[cfg(debug_assertions)]
Expand All @@ -308,7 +308,7 @@ impl NodeRuntime {
continue;
};

if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, graphene_std::GraphicElement>>() {
if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, graphene_std::Graphic>>() {
Self::process_graphic_element(&mut self.thumbnail_renders, parent_network_node_id, &io.output, responses, update_thumbnails)
} else if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, graphene_std::Artboard>>() {
Self::process_graphic_element(&mut self.thumbnail_renders, parent_network_node_id, &io.output, responses, update_thumbnails)
Expand All @@ -323,12 +323,12 @@ impl NodeRuntime {
}
}

// If this is `GraphicElement` data:
// If this is `Graphic` data:
// Regenerate click targets and thumbnails for the layers in the graph, modifying the state and updating the UI.
fn process_graphic_element(
thumbnail_renders: &mut HashMap<NodeId, Vec<SvgSegment>>,
parent_network_node_id: NodeId,
graphic_element: &impl GraphicElementRendered,
graphic_element: &impl Render,
responses: &mut VecDeque<FrontendMessage>,
update_thumbnails: bool,
) {
Expand All @@ -352,7 +352,7 @@ impl NodeRuntime {

let bounds = graphic_element.bounding_box(DAffine2::IDENTITY, true);

// Render the thumbnail from a `GraphicElement` into an SVG string
// Render the thumbnail from a `Graphic` into an SVG string
let render_params = RenderParams {
view_mode: ViewMode::Normal,
culling_bounds: bounds,
Expand Down
8 changes: 4 additions & 4 deletions node-graph/gcore/src/artboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ use crate::table::{Table, TableRow};
use crate::transform::TransformMut;
use crate::uuid::NodeId;
use crate::vector::VectorData;
use crate::{CloneVarArgs, Color, Context, Ctx, ExtractAll, GraphicElement, OwnedContextImpl};
use crate::{CloneVarArgs, Color, Context, Ctx, ExtractAll, Graphic, OwnedContextImpl};
use dyn_any::DynAny;
use glam::{DAffine2, DVec2, IVec2};
use std::hash::Hash;

/// Some [`ArtboardData`] with some optional clipping bounds that can be exported.
#[derive(Clone, Debug, Hash, PartialEq, DynAny, serde::Serialize, serde::Deserialize)]
pub struct Artboard {
pub graphic_group: Table<GraphicElement>,
pub graphic_group: Table<Graphic>,
pub label: String,
pub location: IVec2,
pub dimensions: IVec2,
Expand Down Expand Up @@ -95,10 +95,10 @@ impl BoundingBox for Table<Artboard> {
}

#[node_macro::node(category(""))]
async fn to_artboard<Data: Into<Table<GraphicElement>> + 'n>(
async fn to_artboard<Data: Into<Table<Graphic>> + 'n>(
ctx: impl ExtractAll + CloneVarArgs + Ctx,
#[implementations(
Context -> Table<GraphicElement>,
Context -> Table<Graphic>,
Context -> Table<VectorData>,
Context -> Table<Raster<CPU>>,
Context -> Table<Raster<GPU>>,
Expand Down
16 changes: 8 additions & 8 deletions node-graph/gcore/src/blending_nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::raster_types::{CPU, Raster};
use crate::registry::types::Percentage;
use crate::table::Table;
use crate::vector::VectorData;
use crate::{BlendMode, Color, Ctx, GraphicElement};
use crate::{BlendMode, Color, Ctx, Graphic};

pub(super) trait MultiplyAlpha {
fn multiply_alpha(&mut self, factor: f64);
Expand All @@ -20,7 +20,7 @@ impl MultiplyAlpha for Table<VectorData> {
}
}
}
impl MultiplyAlpha for Table<GraphicElement> {
impl MultiplyAlpha for Table<Graphic> {
fn multiply_alpha(&mut self, factor: f64) {
for row in self.iter_mut() {
row.alpha_blending.opacity *= factor as f32;
Expand Down Expand Up @@ -50,7 +50,7 @@ impl MultiplyFill for Table<VectorData> {
}
}
}
impl MultiplyFill for Table<GraphicElement> {
impl MultiplyFill for Table<Graphic> {
fn multiply_fill(&mut self, factor: f64) {
for row in self.iter_mut() {
row.alpha_blending.fill *= factor as f32;
Expand All @@ -76,7 +76,7 @@ impl SetBlendMode for Table<VectorData> {
}
}
}
impl SetBlendMode for Table<GraphicElement> {
impl SetBlendMode for Table<Graphic> {
fn set_blend_mode(&mut self, blend_mode: BlendMode) {
for row in self.iter_mut() {
row.alpha_blending.blend_mode = blend_mode;
Expand All @@ -102,7 +102,7 @@ impl SetClip for Table<VectorData> {
}
}
}
impl SetClip for Table<GraphicElement> {
impl SetClip for Table<Graphic> {
fn set_clip(&mut self, clip: bool) {
for row in self.iter_mut() {
row.alpha_blending.clip = clip;
Expand All @@ -121,7 +121,7 @@ impl SetClip for Table<Raster<CPU>> {
fn blend_mode<T: SetBlendMode>(
_: impl Ctx,
#[implementations(
Table<GraphicElement>,
Table<Graphic>,
Table<VectorData>,
Table<Raster<CPU>>,
)]
Expand All @@ -137,7 +137,7 @@ fn blend_mode<T: SetBlendMode>(
fn opacity<T: MultiplyAlpha>(
_: impl Ctx,
#[implementations(
Table<GraphicElement>,
Table<Graphic>,
Table<VectorData>,
Table<Raster<CPU>>,
)]
Expand All @@ -153,7 +153,7 @@ fn opacity<T: MultiplyAlpha>(
fn blending<T: SetBlendMode + MultiplyAlpha + MultiplyFill + SetClip>(
_: impl Ctx,
#[implementations(
Table<GraphicElement>,
Table<Graphic>,
Table<VectorData>,
Table<Raster<CPU>>,
)]
Expand Down
Loading
Loading