Jump to content
ParticleSkull

Image Sequence / Multiple Objects (stylesheet?)

Recommended Posts

Hey guys,

Any idea on how can I apply an image sequence on multiple objects?

I have this set of grids and a sequence of textures to apply on it but it can't be randomly. My first thought is through stylesheets (like on crowds) but i'm not sure if this is the best approach. (the original setup doesn't have a copysop though, so I can't use stamps)

rbkhbao.png

this is the jpg sequence i have:

G3q9jKK.png

Scene file is a attached

Thx

RnD_Texture.Sequence_v100.rar

Edited by ParticleSkull

Share this post


Link to post
Share on other sites

not sure if I understand: do you want one of the texture per primitive?

Share this post


Link to post
Share on other sites

Yeap, and it should be in the right order. 1st primitive have the 1st image, 2nd have the second one and so on..

I can't do it one by one because the original project have hundreds of images (it's something like a real life flipbook animation)

 

bzzTs9G.png

Edited by ParticleSkull

Share this post


Link to post
Share on other sites

Thx Konstantin. This setup based on luminance looks pretty incredible!

The shader thing would work fine. In this situation you have 4 textures applied by hand. Do you think is there a way to do it procedurally? I have hundreds (maybe thousends) of images to apply.

I can't use a stamp btw, the original setup doesn't have a copysop.

 

Thx,
Alvaro

Share this post


Link to post
Share on other sites

Thx Dominik! This is exactly what I need.

edit: It's working fine, it was my mistake

For some reason it's missing the number 8. Do you know what it could be?

Also, I'm putting the path on the string like this:
s@takeimg = sprintf("E:/textures/numbers/num_%05d.jpg", @primnum+1);
it's fine to use it like this, right?


GPszasR.png

Edited by ParticleSkull

Share this post


Link to post
Share on other sites
3 minutes ago, ParticleSkull said:

Thx Dominik! This is exactly what I need.

For some reason it's missing the number 8. Do you know what it could be?

Also, I'm putting the path on the string like this:
s@takeimg = sprintf("E:/textures/numbers/num_%05d.jpg", @primnum+1);
it's fine to use it like this, right?
 

number 8 (visually) is missing because there's no texture with it :D

yeah sure that's fine

  • Haha 1

Share this post


Link to post
Share on other sites

Dominik, one more thing. Do you think it can work with the uv quick shade sop? I'm not sure how to link the path in there. 

Share this post


Link to post
Share on other sites

Set a primitive attribute to all texture paths:

string path = chs('path');
string name = chs('name');
string ending = chs('ending');
string num = sprintf('%05d', @primnum);
s@texture_path = path + name + num + ending;

Bind them to a texture node within a material shader:

mat_sshot.thumb.jpg.299b066234be47eee38758f8d116ca94.jpg

Combine all textures in a COP snippet before displaying them in the viewport:

int fields = int( ceil( sqrt(count) ) );                              // Number of rows and columns based on total primitive number
int field_curr = int( floor(X * fields) ) + int( floor(Y * fields) );  // Current tile number
vector2 pos = set( (X * fields) % 1, (Y * fields) % 1 );              // Position within the tile

// Grabbing pixels from all textures
string num = sprintf('%05d', field_curr);
string texture_path = path + name + num + ending;
vector color = colormap(texture_path, pos.x, pos.y);                  

// Assigning colors
R = color.r;
G = color.g;
B = color.b;

Corrcted version below! Including HIP-file.

Edited by konstantin magnus
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for testing ; ) My daggers were not too useful for debugging it seems..

The orientation is probably due to texture mapping. Try setting UV texture node correctly.

For the COP snippet multiply by fields one more time (second line):

int fields = int( ceil( sqrt(count) ) );
int field_curr = int( floor(X * fields) ) + int( floor(Y * fields) ) * fields;
vector2 pos = set( (X * fields) % 1, (Y * fields) % 1 );

string num = sprintf('%05d', field_curr);
string texture_path = path + name + num + ending;
vector color = colormap(texture_path, pos.x, pos.y);

R = color.r;
G = color.g;
B = color.b;

This is what the corrected version should look like (image sequence starts at 0 in my case!):

viewport_sshot_corr.jpg.d4abf8d119973f374e109662150ed799.jpg

tex_per_prim.hip

Edited by konstantin magnus
  • Thanks 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×