Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: grue on April 23, 2021, 06:01:45 PM

Title: mapping texture to brick wall tutorial
Post by: grue on April 23, 2021, 06:01:45 PM
hello, i'm trying to follow along with this tutorial on mapping a brick material to a brick wall: https://www.itoosoft.com/tutorials/uvw-xform

i'm running into  an issue where when i type in the # of bricks from the texture map, 18 bricks wide by 54 bricks high, i get what looks like 5.5 bricks wide mapping on each brick (see attached image)

i do use real-world scale in 3ds  max 2020, but i have real world mapping turned off on this material and real world mapping turned off on the original brick object.

thanks!
Title: Re: mapping texture to brick wall tutorial
Post by: grue on April 23, 2021, 06:02:24 PM
here are the attachments
Title: Re: mapping texture to brick wall tutorial
Post by: Dragan on April 23, 2021, 07:04:01 PM
Hi.
I`m not good with mapping in Max and I`m not sure this will work but try to select the brick model and apply UVM Map modifier>>Box>>Uncheck Real-World Map Size>>Fit

Title: Re: mapping texture to brick wall tutorial
Post by: grue on April 23, 2021, 08:09:38 PM
that did it.  nice.  i didn't think the  uvw  map on the brick model would affect  the railclone, not sure why i thought that. but it does and it fits great now.  thanks for the idea!
Title: Re: mapping texture to brick wall tutorial
Post by: grue on April 23, 2021, 08:53:40 PM
ugh.  so now it looks like i'm stuck at another phase of that tutorial :(

i'm by-passing the  option to have controls for offset and scale because i want the grout of the brick to be included from the texture map.

i've entered in two expressions: "Input1/2" and "Input1*2"

however each of those expressions are giving me an error about something expected after the 2. 

PS - added a new zip file of the scene

thanks
Title: Re: mapping texture to brick wall tutorial
Post by: Dragan on April 23, 2021, 09:45:50 PM
I don't have Max at the moment but since those tutorials are done in some previous RC versions you are probably missing "Return":

https://docs.itoosoft.com/railclone/style-editor/operators#:~:text=RailClone%203%20included%20a%20new%20expressions%20engine.%20Be%20aware%20that%20there%20are%20a%20couple%20of%20key%20changes%20to%20remember.

To send a value to the arithmetic node's output you must add a return command, for example:

return degToRad(90);

The new version uses a double == for conditional tests
The way you write numbers is now important, for example in RailClone 3:

1 = an integer
1.0 = a float

This means that in RailClone 3 the expressions:

return 1/2;
Will result in 0, because both values are integers.

To return a float value you would use:
Return 1.0/2.0;
Title: Re: mapping texture to brick wall tutorial
Post by: grue on April 26, 2021, 02:08:22 PM
thanks. i looked at it and tried a few different ; and such but still getting the error. the value that goes into it is an integer. there's a DVIDE U and DIVIDE V.  they both have a constant set as FLOAT.  the DIVIDE U and DIVIDE V have "# of Tiles on V" and "# of Tiles on U" which are both Integers.  if i change those to Floats, i still get the same error.

see attached
Title: Re: mapping texture to brick wall tutorial
Post by: Rokas on April 26, 2021, 02:41:55 PM
Hi. You need return keyword in the start.

Test expression "-1*(Input/4)" in v2 should be written in v3 and v4 like this:
return -1*(Input/4);
Basically all expressions should have "return" in start of "expression" and You should end them with ";"

Feel free to check documentation  (https://docs.itoosoft.com/railclone/style-editor/operators#Operators-ExpressionsSyntax)for more examples and explanations. Or just ask here and we will try to help out.
Title: Re: mapping texture to brick wall tutorial
Post by: grue on April 26, 2021, 03:54:55 PM
oh i see. ha. ok thanks.
Title: Re: mapping texture to brick wall tutorial
Post by: grue on April 26, 2021, 04:06:10 PM
ok wow. so my expression is now: return (Input1/2); and it says there's an error, however it displays no further information and it appears to work just fine! so maybe i've got something else glitchy and it throws the error but still works. and by working, i mean the UVW changes to match the object.  in my case the offset of the bricks and bricks in the map.
Title: Re: mapping texture to brick wall tutorial
Post by: Dragan on April 26, 2021, 07:02:37 PM
If arithmetic node output is not connected you will get an error message. Don`t worry about that  ;)