Create a string input node #84971

Closed
opened 2021-01-22 19:40:31 +01:00 by Simon Thommes · 25 comments
Member

Add a new string input node String in the input category.

Add a new string input node `String` in the input category.
Author
Member

Added subscriber: @SimonThommes

Added subscriber: @SimonThommes
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Alternatively, this can be added to the input value node? Were we can input multiple value types such as boolean int string float.

Alternatively, this can be added to the input value node? Were we can input multiple value types such as boolean int string float.

Added subscriber: @Grady

Added subscriber: @Grady

Love the idea.

With a string input node, later on it could be complimented by a node that takes a string input and font selection then generates a mesh.

Then later on after that, string nodes that take a string input, and perform manipulations, and output the result as a string output.

Love the idea. With a string input node, later on it could be complimented by a node that takes a string input and font selection then generates a mesh. Then later on after that, string nodes that take a string input, and perform manipulations, and output the result as a string output.
Author
Member

For now this node is simply a necessity for the attribute workflow, as the attribute input socket accepts a string as the name of the attribute.

In #84971#1099079, @Blendify wrote:
Alternatively, this can be added to the input value node? Were we can input multiple value types such as boolean int string float.

Having a combined Input node regardless of the type is not a bad idea. For now this is simply following the design we generally have in Blender with e.g. shading nodes. But I can see this possibly changing once we have a broader range of different input types.

For now this node is simply a necessity for the attribute workflow, as the attribute input socket accepts a string as the name of the attribute. > In #84971#1099079, @Blendify wrote: > Alternatively, this can be added to the input value node? Were we can input multiple value types such as boolean int string float. Having a combined `Input` node regardless of the type is not a bad idea. For now this is simply following the design we generally have in Blender with e.g. shading nodes. But I can see this possibly changing once we have a broader range of different input types.

Added subscriber: @ringmaker

Added subscriber: @ringmaker

This comment was removed by @ringmaker

*This comment was removed by @ringmaker*

Added subscriber: @redvant

Added subscriber: @redvant

Hi! Can I work on this?

Hi! Can I work on this?
Member

Added subscriber: @HooglyBoogly

Added subscriber: @HooglyBoogly
Member

Of course, that's why it's a "Good First Issue".

Of course, that's why it's a "Good First Issue".

Great!! I already did some digging and I was wondering if the string node should be a Geometry node or instead a Function node (like the vector node) or a Shading node (like the value node).

Great!! I already did some digging and I was wondering if the string node should be a Geometry node or instead a Function node (like the vector node) or a Shading node (like the value node).
Member

Since it's general (could theoretically be used in any node tree), implementing it as a function node would be preferred, just like the vector input node.

Since it's general (could theoretically be used in any node tree), implementing it as a function node would be preferred, just like the vector input node.

I'm on it. Thanks!

I'm on it. Thanks!

Hi guys!! I have it working now.
stringNode_screenshot_01.png
I wanted to ask you if is OK this new DNA struct to store the string property:

typedef struct NodeInputString {
  char string[1024];
} NodeInputString;

I saw the bNodeSocketValueString use char value[1024] but I think is Deprecated.

Hi guys!! I have it working now. ![stringNode_screenshot_01.png](https://archive.blender.org/developer/F9611528/stringNode_screenshot_01.png) I wanted to ask you if is OK this new DNA struct to store the string property: ``` typedef struct NodeInputString { char string[1024]; } NodeInputString; ``` I saw the `bNodeSocketValueString` use `char value[1024]` but I think is Deprecated.
Member

Nice!

Right, just like the NodeInputVector node. bNodeSocketValueString isn't deprecated, it's just used for sockets, and since this string isn't a socket but a node property, it can't be used here.

Nice! Right, just like the `NodeInputVector` node. `bNodeSocketValueString` isn't deprecated, it's just used for sockets, and since this string isn't a socket but a node property, it can't be used here.

Ok then.
I'll double check everything and I'll consult the developer intro on Best Practices and all that.
Thanks!

Ok then. I'll double check everything and I'll consult the developer intro on Best Practices and all that. Thanks!
Edgar Roman Cervantes self-assigned this 2021-02-04 03:59:24 +01:00

Added subscriber: @someuser

Added subscriber: @someuser

char string[1024];

but in this case, unicode characters are not supported. and we can't use this node as input for creating text mesh object 😢

P.S. also in houdini for example, text input filed also used in some nodes to create points/edges/faces/etc, from they text representation of array coordinates/id/etc, i mean lenght of 1024 maybe to short?

> char string[1024]; but in this case, unicode characters are not supported. and we can't use this node as input for creating text mesh object 😢 P.S. also in houdini for example, text input filed also used in some nodes to create points/edges/faces/etc, from they text representation of array coordinates/id/etc, i mean lenght of 1024 maybe to short?
Contributor

Added subscriber: @KenzieMac130

Added subscriber: @KenzieMac130
Contributor

In #84971#1106938, @someuser wrote:

char string[1024];

but in this case, unicode characters are not supported. and we can't use this node as input for creating text mesh object 😢

P.S. also in other software, text input filed also used in some nodes to create points/edges/faces/etc, from they text representation of array coordinates/id/etc, i mean lenght of 1024 maybe to short?

Utf8 should be supported by char arrays. 1024 does seem limiting if users would want to populate from coordinates, but it feels like if that's what you want to do then you should be using a text data block or some other solution that allows users to import data from heavy sources (CSVs, custom import formats, etc). Maybe a string size limit might be a problem in real production eventually though when generating text meshes like you said. But I think as an initial implementation 1024 should be fine for attribute name inputs.

> In #84971#1106938, @someuser wrote: >> char string[1024]; > > but in this case, unicode characters are not supported. and we can't use this node as input for creating text mesh object 😢 > > P.S. also in other software, text input filed also used in some nodes to create points/edges/faces/etc, from they text representation of array coordinates/id/etc, i mean lenght of 1024 maybe to short? Utf8 should be supported by char arrays. 1024 does seem limiting if users would want to populate from coordinates, but it feels like if that's what you want to do then you should be using a text data block or some other solution that allows users to import data from heavy sources (CSVs, custom import formats, etc). Maybe a string size limit might be a problem in real production eventually though when generating text meshes like you said. But I think as an initial implementation 1024 should be fine for attribute name inputs.

Here it is!
Let me know of anything that needs a fix or improvement.

Here it is! Let me know of anything that needs a fix or improvement.

This issue was referenced by a961a2189c

This issue was referenced by a961a2189cb38ffb368d6781aa57177bfefe0e36

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
10 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#84971
No description provided.