Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: arch3d on November 12, 2022, 04:41:10 PM

Title: Last segment of chain
Post by: arch3d on November 12, 2022, 04:41:10 PM
Maybe simple but i don know how to do it :)
I have simple chain. And i want to change last element of array depending on number of default segments
Best
Michal
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 05:02:01 PM
I'm on the phone so can't give you full solution, but you could use segment counter and mod operation do determinate is the current number even or odd.
Return
Mod(sxegmencounter,2)+1;
Title: Re: Last segment of chain
Post by: arch3d on November 12, 2022, 05:17:15 PM
Thx for idea,
Now ill play with it but at first look doesnt work, so probably i am doing sth wrong:)

return mod(SegmentXCounter,2)+1;
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 05:42:59 PM
Ah, yes...
The counter is separated for start/end, default, evenly...
So, I guess you should do everything in default pipeline.

For your workflow:
The easiest way should be to go with dividing spline length with segment length (export x size attribute after transform scale) to determinate final number of segments and then use this in mod operation.
Title: Re: Last segment of chain
Post by: arch3d on November 12, 2022, 05:58:02 PM
ok ill try
Title: Re: Last segment of chain
Post by: arch3d on November 12, 2022, 07:02:11 PM
like this?
never use mod before :)

works ni tile mode not every time in adaptive mode what is obvious
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 07:10:47 PM
Yes
Arithmetic expression:
Return
Mod(round(input1),2))+1;


Mod 2 should return either 0 or 1 and +1 is for selector input start hrom 1
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 07:13:42 PM
This more or less issues could be solved by rounding/flooring division result
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 07:15:19 PM
You could also try evenly workflow. Evenly now has an option for odd, even results
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 07:21:38 PM
You could also use division result with some expression to force odd or even and  use it in the count mode for default rule.

Another way using conditional operator multiple by 2 mode...

Could be solved on many ways...
Title: Re: Last segment of chain
Post by: arch3d on November 12, 2022, 07:43:33 PM
True, now i see
Thanks!
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 07:45:46 PM
Glad to help 😏👍
Title: Re: Last segment of chain
Post by: arch3d on November 12, 2022, 07:47:47 PM
I think best is count mode with round modifier :)
Title: Re: Last segment of chain
Post by: arch3d on November 12, 2022, 07:52:53 PM
btw i saw your style with wParallax files
I made it before and i can advise you one thing - copy mutimat and apply *.jpg instead of *.exr.
Keep material with .exr on segments and thick use segment material for style.
You will have preview in viewport and exr as render :)

simple but works
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 08:04:00 PM
 ;D ;D ;D
I did that yesterday!!!
Art from wParallax supported me with all bundles few days ago and I have made new style that has embedded planes with 1k, 3k and jpg for preview. Since many users requested option without curtains I need some time to remap everything. Didn't find any sutable script to copy material and remaping.
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 08:06:58 PM
I have some family staff during this weekend so i guess I'll release macros in few days.
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 08:12:06 PM
What you will suggest about using 1k vs 3k materials.
Should I keep all in one macro with check box 1k/2k or should I do it in two different RC objects?
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 08:17:23 PM
btw i saw your style with wParallax files
I made it before and i can advise you one thing - copy mutimat and apply *.jpg instead of *.exr.
Keep material with .exr on segments and thick use segment material for style.
You will have preview in viewport and exr as render :)

simple but works

Hi Michal,
I still have issues displaying OSL maps in the viewport.
Did you recreate all materials to MultiSub because I can`t get results with original multitexture maps?
I`m getting a full OSL preview even with *.exr when using the show realistic material option when using single material or multisub.
tnx


 
Title: Re: Last segment of chain
Post by: arch3d on November 12, 2022, 08:33:34 PM
Pixamoon Bitmap/Track resize
Title: Re: Last segment of chain
Post by: Dragan on November 12, 2022, 08:45:13 PM
I'll check it. Thank you.
Title: Re: Last segment of chain
Post by: arch3d on November 13, 2022, 10:52:56 AM
What you will suggest about using 1k vs 3k materials.
Should I keep all in one macro with check box 1k/2k or should I do it in two different RC objects?

Two will be better or you dont care about RAM:)
Title: Re: Last segment of chain
Post by: arch3d on November 13, 2022, 10:55:19 AM
Quote
I did this with two separate set off planes  and selector for preview vs render mode.
How did you solve this? Any better way?

No need to create two sets.
1.Apply multimat with jgs on RC Generator
2.Apply multimat with exr on segments
3.Thick use segment material

So you got preview in viewport and exr in render time (segment material) - Generator use jggs in viewport, and you force renderer to use exr
Title: Re: Last segment of chain
Post by: arch3d on November 13, 2022, 10:56:24 AM
btw i made version on markers -  prefer that pipeline
Title: Re: Last segment of chain
Post by: Dragan on November 13, 2022, 11:05:33 AM
Quote
I did this with two separate set off planes  and selector for preview vs render mode.
How did you solve this? Any better way?

No need to create two sets.
1.Apply multimat with jgs on RC Generator
2.Apply multimat with exr on segments
3.Thick use segment material

So you got preview in viewport and exr in render time (segment material)
Ah, good trick. I'll try that for sure. I'm not so good with material management 🙂.
Title: Re: Last segment of chain
Post by: Dragan on November 13, 2022, 11:17:06 AM
btw i made version on markers -  prefer that pipeline

Yes, markers are so powerful. Not sure why people don't use them more. I always add an option to override some parameters by markers. I have some nice helpers macros including easy override node. I need to share those too but don't have time to create video to explain how everything works.  8) ;)
Title: Re: Last segment of chain
Post by: Dragan on November 13, 2022, 11:37:10 AM
Michal, just crossed my mind.
Since you are advanced user you will not have a problem understanding how each marker works. In some of my styles (like this for wParallax) you can find some macros like mentioned for overriding with markers, taking values from X/Y Master Spline...
All those are working with nested generators as long you named main generator as "Master".
This is my main workflow. As I put the generator in the style I rename it as "Master" so I can use my predefined help macros.
Title: Re: Last segment of chain
Post by: arch3d on November 13, 2022, 04:03:44 PM
My worklow is working on simple spline in plan view:)
Btw second tip:
Sometimes i make additional generator called "helpers". For wParallax i got simple triangles pointing face orientation:)

I almost always work in wireframe mode