Jump to content

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
Link to comment
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
Link to comment
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

Link to comment
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
Link to comment
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
Link to comment
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
Link to comment
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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...