Trying to map multiple images on Attribute from Map

   1286   8   2
User Avatar
Member
6 posts
Joined: May 2019
Offline
Guys , I have probably a very simple question.

I have a sequence of images who will used and stack on multiple grids driven by a copy to points (using points)
I created a classic "variant" integer attribute (i@variant = int(@ptnum) and I turn Piece attribute on

On the side of the attributefrommap I used the following syntax: sprintf("$HIP/tex/teste/teste_%03d.png", @map_id)

I got a list of images who i want pile up using this sequence of images but unfortunately i got a weird response. First the images are not loaded (besides i got no errors from attributefrommap node) and all the primitives "collapsed into one piece.

The path of image is corrected as I use one image as test and work. the number of points are LESS than number of images . But there's something on my procedure with is not working ... I tried to find a solution but I didn't manage to find... Previously , the copy stamp works but now with 20.5 the node is outdated. Any ideas? thanks a lot!

cadu

Attachments:
Capture_001.PNG (2.1 MB)

User Avatar
Member
547 posts
Joined: Nov. 2016
Offline
That workflow needs to have the same variant attribute on the primitives copied as on points they're copied onto. I would duplicate my grid by the amount of variants you have, assign their prims the corresponding variant id, then use the attribute from map in a for each loop using that same variant id as name, and in the filename as well.
User Avatar
Member
6 posts
Joined: May 2019
Offline
Thank you Tanto , but in this particular case , will be nearly impossible because I dealing with multiple slices of images with will be used as layers to reconstruct one 3d structure. Could be one or could be 100 images. My approach is trying to be more flexible to have a system who I could change just matching the number of points of corresponding images. I know the method using names for example but in this case I need to call the images based on number of points. I will use this system in different numbers of images.
But thank you anyway!
User Avatar
Member
547 posts
Joined: Nov. 2016
Offline
Just set the number of copies of the grid to be equal to the number of points through an expression. In the Copy and Transform sop, activate the copy number attribute and set its name to "variant".
User Avatar
Member
6 posts
Joined: May 2019
Offline
Tanto
Just set the number of copies of the grid to be equal to the number of points through an expression. In the Copy and Transform sop, activate the copy number attribute and set its name to "variant".
Thank you again Tanto , unfortunately my program skills doesn't allow me to realize how to do so...sorry... Any suggestions? Should I use a Attribute Wrangler somewhere? And also I have no idea how to code such thing...If is not asking too much can you give me a tip how to create copies based on code?

Thank you again!

Cadu
User Avatar
Member
6 posts
Joined: May 2019
Offline
ooo , I think i got it! (sorry I forced to use GPT ... sorry guys) . I got a way to do use the python node ... looks amazing! Now I just need to link each one to the attribute...

I will work on code and add the updated version asap and share here

thx for the idea of the path!

All the best
User Avatar
Member
726 posts
Joined: Sept. 2013
Online
Hi Cadu,

point wrangle after a copy node with copynum activated:

string path = chs('path');
string name = chs('name');
string end = chs('ending');

int number = prim(0, 'copynum', i@primnum);
string n = sprintf('%04d', number);

string file = path + name + n + end;
vector uvw = vertex(0, 'uv', i@vtxnum);
vector clr = colormap(file, uvw);

v@Cd = clr;


Example parameters:

Path: https://www.aircraftinternational.com/gallery/marek_szufa/extra2/images/
Name: img_
Ending: .jpg
Edited by Konstantin Magnus - April 4, 2025 08:34:20

Attachments:
image_sequence.png (432.3 KB)
map_image_sequence.hip (114.5 KB)

https://procegen.konstantinmagnus.de/ [procegen.konstantinmagnus.de]
User Avatar
Member
6 posts
Joined: May 2019
Offline
Konstantin Magnus
Hi Cadu,
Image Not Found

point wrangle after a copy node with copynum activated:

string path = chs('path');
string name = chs('name');
string end = chs('ending');

int number = prim(0, 'copynum', i@primnum);
string n = sprintf('%04d', number);

string file = path + name + n + end;
vector uvw = vertex(0, 'uv', i@vtxnum);
vector clr = colormap(file, uvw);

v@Cd = clr;


Example parameters:

Path: https://www.aircraftinternational.com/gallery/marek_szufa/extra2/images/
Name: img_
Ending: .jpg



Beautiful...works like a charm!!!


Now i just need to convert the bitmap image on UV to attribute point!

Thank you Kostantin , it's look even more elegant than my messy code

All the best,
Edited by cadudatoro - April 4, 2025 09:04:15
User Avatar
Member
6 posts
Joined: May 2019
Offline
Final update , I added a attribute wrangler with slides and finally got groups by RGB values with adjustments.

Works!

Thx a lot!

Cadu

Attachments:
Capture_002.PNG (2.2 MB)

  • Quick Links