Itoo Software Forum

Author Topic: Calculate UVW Coordinates - get X Mapping Size from Spline length  (Read 1620 times)

suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Hi!

I'm using one railclone object using two Array2S Generators to create two window variations ( high and small ). The heights are parametric inputs and are assigned via Spline Mat-IDs ( 1=high, 2 =small ). So far so good.

Now i'm trying to create a third object -> a simple Array2S Generator with only a default plane, which should work as a "backgroundplate" for each window. And each plate should have a UVW Mapping Size matching to it's width and height:

  • The UVW Y Mapping Size is easy -> i'm using the parametric input for the window heights as it's value.
  • But i'm lost trying to get the X Mapping Size -> this size should be the length of every single spline used in the base object

Is there a way to get the length of each spline used in the base object path ? Guess that expressions could solve it - found X Spline Length, X SplineSection Length, X Spline MatID etc. but no glue how to use em

Hope you'll understand what i'm trying to say  8)
« Last Edit: March 21, 2020, 02:52:38 PM by suppenhuhn »
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6

suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Re: Calculate UVW Coordinates - get X Mapping Size from Spline length
« Reply #1 on: March 22, 2020, 04:32:46 PM »
I've tried with expressions but i can't get running  :-\

When plug this arithmetic expression into the X Mapping Size then the UVW Mapping isn't correct...hmmm


P.S. Is there a way to check what value a expression is returning - just like  log, echo or print commands in other programming languages?
« Last Edit: March 22, 2020, 04:49:43 PM by suppenhuhn »
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Re: Calculate UVW Coordinates - get X Mapping Size from Spline length
« Reply #2 on: March 23, 2020, 10:05:46 AM »
Hi,

I am attaching my solution to the described issue.


To understand what expressions are returning, sometimes helps to create new helper generator with segments variable Z size for example. There are no text output evaluation.

Hope this helps.
Rokas

suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Re: Calculate UVW Coordinates - get X Mapping Size from Spline length
« Reply #3 on: March 23, 2020, 11:34:11 AM »
Awesome - works perfect. Thank you! A real "pro-approach" with no need to mess with UVs !! :-)
But one question: I'm using spline vertecies to create X Evenly window-elements. When adding a vertex into spline ID 2 - railclone will create 2 "background segments".
Is there a way to check if a spline has more segments and ignore them ? My segments always have the same ID, i don't mix IDs within the spline.
« Last Edit: March 23, 2020, 11:42:31 AM by suppenhuhn »
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Re: Calculate UVW Coordinates - get X Mapping Size from Spline length
« Reply #4 on: March 23, 2020, 12:12:51 PM »
Then set Background generator Bevel Mode to None:

Rokas

suppenhuhn

  • Full Member
  • ***
  • Posts: 125
Re: Calculate UVW Coordinates - get X Mapping Size from Spline length
« Reply #5 on: March 23, 2020, 12:54:44 PM »
Thank you so much !  8)
iToo has probably the best support & community i know !!

I'm using it with Max 2019 & Vray 6