Attribute Map node #103457

Closed
opened 2022-12-24 20:19:16 +01:00 by Iliya Katushenock · 24 comments

Node for associative indexing of values by an arbitrary number of incoming integer set and lookup keys.

This node must accept the input of a geometry, a random type value, and a set of keys.
The node has evaluation domain parameters.
For the search, a lot of integer keys are introduced. They already belong to the context of the evaluator.
Now, the result is a value whose keys fully match the element of the evaluated geometry.

Text representation of the functionality:

{
  {{0, 1, 55} : A},
  {{0, 2, -0} : B},
  ...
}[{0, 1, 55}] == A

Key intersections:

  • Value may be outputed that there was an intersection, but give the first value.
  • Value may be outputted that there was no valid, and return 0.
  • Mean additional int input to index identical keys (or allow +1 key to search in multi-input)
  • Ignore the problem by simply returning the first instance

If the keys had no intersection, a validity value may be outputed

Implementation:
Allow field handling for multi-input sockets.
Follow the first working instance of the node, without solving the intersection problem, in order to get feedback from users.

Technical question:
Based on a few experiments {D16256}, it became clear that the best option would be to build maps for each array of keys [Key]{index}
After that, a parallel search in all maps and checking the equality of the found indices for all keys.
There may be more productive solutions, open to suggestions.

Node for associative indexing of values by an arbitrary number of incoming integer set and lookup keys. This node must accept the input of a geometry, a random type value, and a set of keys. The node has evaluation domain parameters. For the search, a lot of integer keys are introduced. They already belong to the context of the evaluator. Now, the result is a value whose keys fully match the element of the evaluated geometry. Text representation of the functionality: ```lang=c++ { {{0, 1, 55} : A}, {{0, 2, -0} : B}, ... }[{0, 1, 55}] == A ``` Key intersections: - Value may be outputed that there was an intersection, but give the first value. - Value may be outputted that there was no valid, and return 0. - Mean additional int input to index identical keys (or allow +1 key to search in multi-input) - Ignore the problem by simply returning the first instance If the keys had no intersection, a validity value may be outputed Implementation: Allow field handling for multi-input sockets. Follow the first working instance of the node, without solving the intersection problem, in order to get feedback from users. Technical question: Based on a few experiments {D16256}, it became clear that the best option would be to build maps for each array of keys `[Key]{index}` After that, a parallel search in all maps and checking the equality of the found indices for all keys. There may be more productive solutions, open to suggestions.
Author
Member

Added subscriber: @mod_moder

Added subscriber: @mod_moder

Added subscriber: @shmuel

Added subscriber: @shmuel

I propose an "Is Valid" boolean output and an additional drop down menu for the key value type [float, integer, vector] (I don't think a boolean key will be useful).
,so you'd have 3 drop downs 1 - domain type, 2 - sampled value type, and 3 - the key type.

Another idea to think about would be an option to have interpretation with keys in-between float and vector values [weighted based on what value they are closest to].

I propose an "Is Valid" boolean output and an additional drop down menu for the key value type [float, integer, vector] (I don't think a boolean key will be useful). ,so you'd have 3 drop downs 1 - domain type, 2 - sampled value type, and 3 - the key type. Another idea to think about would be an option to have interpretation with keys in-between float and vector values [weighted based on what value they are closest to].
Author
Member

No, keys of different types do not make sense. If you really think about it, you can always use a hash node to turn vectors into ints.
Yes, the issue of how to compare vectors and floats without epsilon is important, so it just doesn't make sense.

No, keys of different types do not make sense. If you really think about it, you can always use a hash node to turn vectors into ints. Yes, the issue of how to compare vectors and floats without epsilon is important, so it just doesn't make sense.

In #103457#1465583, @mod_moder wrote:
No, keys of different types do not make sense. If you really think about it, you can always use a hash node to turn vectors into ints.
Yes, the issue of how to compare vectors and floats without epsilon is important, so it just doesn't make sense.

what is a hash node?

> In #103457#1465583, @mod_moder wrote: > No, keys of different types do not make sense. If you really think about it, you can always use a hash node to turn vectors into ints. > Yes, the issue of how to compare vectors and floats without epsilon is important, so it just doesn't make sense. what is a hash node?
Author
Member
[D15835: Function Node: Hash Value](https://archive.blender.org/developer/D15835)

In #103457#1465583, @mod_moder wrote:
No, keys of different types do not make sense. If you really think about it, you can always use a hash node to turn vectors into ints.
Yes, the issue of how to compare vectors and floats without epsilon is important, so it just doesn't make sense.

I still think it's a good idea to have an option for interpretation which would only work (or work better) with floats and vectors

> In #103457#1465583, @mod_moder wrote: > No, keys of different types do not make sense. If you really think about it, you can always use a hash node to turn vectors into ints. > Yes, the issue of how to compare vectors and floats without epsilon is important, so it just doesn't make sense. I still think it's a good idea to have an option for interpretation which would only work (or work better) with floats and vectors
Author
Member

The nearest values have a geometric meaning. Finding them is best delegated to various kinds of methods for finding the nearest values.

The nearest values have a geometric meaning. Finding them is best delegated to various kinds of methods for finding the nearest values.
Iliya Katushenock added this to the Nodes & Physics project 2023-02-12 13:15:57 +01:00
Iliya Katushenock removed the
Module
Nodes & Physics
label 2023-04-22 14:25:09 +02:00
Iliya Katushenock removed the
Status
Needs Triage
label 2023-04-24 18:49:19 +02:00

what's the status on this? I don't mean to push, I'm just curious; I've recently had to do some associative transferring (I used the sample nearest method). I remembered this was up for a while and I'm wondering what's up.

what's the status on this? I don't mean to push, I'm just curious; I've recently had to do some associative transferring (I used the sample nearest method). I remembered this was up for a while and I'm wondering what's up.
Author
Member

Low priority task now..

Low priority task now..

how to up priority? is there a vote thing, get more participants... or is it entirely up to the developers?

how to up priority? is there a vote thing, get more participants... or is it entirely up to the developers?
Author
Member

Application examples, community interest
And I should probably do a couple of implementation updates..

Application examples, community interest And I should probably do a couple of implementation updates..

by application examples do you mean use cases or implementation on your part? because I have a lot of use cases.

by application examples do you mean use cases or implementation on your part? because I have a lot of use cases.
Author
Member

Right, it would be much helpful

Right, it would be much helpful

where should I share them?

where should I share them?
Author
Member

But this is difficult)
First of all, this can not be done here, because in theory, this is only for discussion of design.
Then, this can't be done on the forum, as it's also discussion-only.
Maybe twitter (although I will have difficulty with that). So first of all, it would be better to do it in the form of videos / screenshots of examples of work in various social networks (YouTube, ...). But for this, I first need to update the node, it has long been outdated, a lot of things in the code have changed in half a year...

But this is difficult) First of all, this can not be done here, because in theory, this is only for discussion of design. Then, this can't be done on the forum, as it's also discussion-only. Maybe twitter (although I will have difficulty with that). So first of all, it would be better to do it in the form of videos / screenshots of examples of work in various social networks (YouTube, ...). But for this, I first need to update the node, it has long been outdated, a lot of things in the code have changed in half a year...

D15835: Function Node: Hash Value

btw what happened to this?

> [D15835: Function Node: Hash Value](https://archive.blender.org/developer/D15835) btw what happened to this?
Author
Member
@shmuel https://blender.chat/channel/nodes-physics-module?msg=STRmwN5vaFwkJ5pDS

Looks very promising! I agree with the int key value. Doesn't make much sense to me for floats or vectors, especially if there was a hash node.
Going to be very useful in replacing the current method of set position to field, sample nearest. I assume also much faster.

Looks very promising! I agree with the int key value. Doesn't make much sense to me for floats or vectors, especially if there was a hash node. Going to be very useful in replacing the current method of set position to field, sample nearest. I assume also much faster.

may I recommend having two versions of this node like the sample index and evaluate at index, we should have an attribute map node with a geometry input and an attribute map node without a geometry input; maybe call in "evaluate at key" or something.

may I recommend having two versions of this node like the *sample index* and *evaluate at index*, we should have an *attribute map* node **with** a geometry input and an *attribute map* node **without** a geometry input; maybe call in "evaluate at key" or something.

design question: should we output the index of the element from this node (/nodes) to be used in sample index (/evaluate at index), or sample the value directly in this node?

performance is very important, so if sampling it directly is faster by any significant margin, then we should go with that, otherwise we can go with a similar idea to the sample nearest - where we output the index.

now thinking about it, an index output sounds like it could be a better idea, especially when sampling multi values...

design question: should we output the index of the element from this node (/nodes) to be used in sample index (/evaluate at index), or sample the value directly in this node? performance is very important, so if sampling it directly is faster by any significant margin, then we should go with that, otherwise we can go with a similar idea to the sample nearest - where we output the index. now thinking about it, an index output sounds like it could be a better idea, especially when sampling multi values...
Author
Member

@shmuel No, if we are not interpolating values, then we should only work with the index.

@shmuel No, if we are not interpolating values, then we should only work with the index.

@mod_moder that's what I said 👍 (kinda. just asking)

@mod_moder that's what I said 👍 (kinda. just asking)
Author
Member
https://projects.blender.org/blender/blender/issues/114278
Blender Bot added the
Status
Archived
label 2023-10-30 17:51:38 +01:00
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 Assignees
3 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#103457
No description provided.