ParticleSkull Posted November 13, 2018 Share Posted November 13, 2018 (edited) 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) this is the jpg sequence i have: Scene file is a attached Thx RnD_Texture.Sequence_v100.rar Edited November 13, 2018 by ParticleSkull Quote Link to comment Share on other sites More sharing options...
3dome Posted November 13, 2018 Share Posted November 13, 2018 not sure if I understand: do you want one of the texture per primitive? Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 (edited) 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) Edited November 13, 2018 by ParticleSkull Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 13, 2018 Share Posted November 13, 2018 How about applying the pictures inside the shader like so? 1 Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 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 Quote Link to comment Share on other sites More sharing options...
3dome Posted November 13, 2018 Share Posted November 13, 2018 (edited) does this help? you'll have to adjust the path and of course renaming the texture files properly will help RnD_Texture.Sequence_v101.hipnc Edited November 13, 2018 by 3dome 1 Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 (edited) 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? Edited November 13, 2018 by ParticleSkull Quote Link to comment Share on other sites More sharing options...
3dome Posted November 13, 2018 Share Posted November 13, 2018 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 yeah sure that's fine 1 Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 Thx I'll try make it work with redshift now to speed up the previews. Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 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. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 13, 2018 Share Posted November 13, 2018 (edited) 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: 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 November 13, 2018 by konstantin magnus 1 Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 You're a genius. I'll give it a try right now, thx! Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 It's not getting the right sequence, do you know what it could be? :/ Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted November 13, 2018 Share Posted November 13, 2018 (edited) 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!): tex_per_prim.hip Edited November 13, 2018 by konstantin magnus 1 Quote Link to comment Share on other sites More sharing options...
ParticleSkull Posted November 13, 2018 Author Share Posted November 13, 2018 yeah, now it looks perfect! I'll give a try on the original scene now. Thank you very much, Konstantin! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.