Itoo Software Forum

Author Topic: Material ID remapping  (Read 426 times)

ITCodies

  • Newbie
  • *
  • Posts: 6
Material ID remapping
« on: June 24, 2022, 02:33:01 PM »
Hi

I'm in need of reordering a few material id's from some shared assets used in the segment inputs of Railcone and I'm using the material node.

If the incoming Id's were for example 01,02,03 I can remap them easily as below:

01 -> 11
02 -> 12
03 -> 13

However the problem comes if I want to swap some ID's with each other. For example:

If I wanted to remap as follows

01 -> 02
02 -> 03
03 -> 01

To do this I can easily set up some nodes to move them to a safe space first

Stage 1
 
01 -> 11
02 -> 12
03 -> 13

then Stage 2

11 -> 02
12 -> 03
13 -> 01

This in theory should work. However stage 2 does not appear to work as I guess it doesn't 'bake' the geo with stage one fixed to allow stage 2 to act on it. It sort of runs the maths for the whole chain to the end. I've tried running stage 1 before a generator and then stage 2 after that generator and into a 2nd generator to finish but it has no affect.

Is there anyway to tell the graph that stage 1 is a separate pass to stage 2? So that it does stage 1 and makes the geo. Then passes that geo in to do stage 2?

I've also encountered similar problems with the random nodes when using clipping splines. I'll post separate for that.

Mat ID remap files attached

Thanks for any help or advice

Jus

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2991
Re: Material ID remapping
« Reply #1 on: June 24, 2022, 02:53:34 PM »
If I wanted to remap as follows

01 -> 02
02 -> 03
03 -> 01


Thanks for the question. Because each material operator refers only to the original material IDs on the spline and not the remapped ones, it shouldn't be necessary to move them to a safe space first. Please see the attached file which uses 3 Material nodes to create the remapping described above.



Thanks,

Paul
Paul Roberts
iToo Software

ITCodies

  • Newbie
  • *
  • Posts: 6
Re: Material ID remapping
« Reply #2 on: July 12, 2022, 04:25:19 PM »
Thanks for this. I think I was overthinking it because of the 'Clipping with random sequences problems' thread I was also experiencing at the time. I also made a Macro array of 100 in the end. Which is a handy way of reordering messy mat libraries/id's on meshes with up to 100 ID's.

Jus