Itoo Software Forum

Author Topic: Rig for Traffic Cars  (Read 1899 times)

UP1808

  • Newbie
  • *
  • Posts: 31
Rig for Traffic Cars
« on: March 03, 2014, 09:32:22 AM »
Hi!
I've some trouble to understand if and how to set RailClone for car traffic.
Input:
-Spline long 3km (not flat)
-30 cars (each car is a VrayProxy with its own MultiSubObject material)

Target:
-Randomly distribute no more then 30-40 objects along the spline, aligned with it, some of them rotate of 180degrees respect the others, and randomly traslated of a fix value outer respect the middle of the spline to simulate a road with two lanes.

My doubts regard:
1) If all the tasks above can be solved about distribution
2) If material can be managed easily.. I mean: each proxy has been created from a single geometry composed by different sub-object elements with different id, so each proxy has its own MultiSubObject Material, and in the rig once the proxy is scattered along the spline should mantein its material

Do you think RailClone can be used for that?
Thank you very much for your advice.


Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1582
Re: Rig for Traffic Cars
« Reply #1 on: March 03, 2014, 10:43:54 AM »
Hi, Thanks for the interesting questions.
Quote
1) If all the tasks above can be solved about distribution

The distribution should be pretty straightforward to solve - the node tree could look something like this:



In this case I've used a Random operate to select the cars, two generators (one for each lane) and transform and mirror nodes to control the spacing and direction of the vehicles. I've attached the file for you to have a look at. Excuse the car models  :)

Quote
If material can be managed easily.. I mean: each proxy has been created from a single geometry composed by different sub-object elements with different id, so each proxy has its own MultiSubObject Material, and in the rig once the proxy is scattered along the spline should mantein its material

This is a little trickier, RailClone does not automatically consolidate materials and ids so it would be necessary to create a single msub material for all the cars and re-assign the material IDs. I'm sure I've seen a script somewhere that can help automate this process, if I can find it I'll post a link here. Otherwise going through a process attaching all the cars into a single edit poly object and using the match IDs feature to create a new msub before detaching and realigning the pivots again might be the easiest way. It's not ideal but it would work.

Hope that helps,

Thanks,

Paul

Paul Roberts
iToo Software

UP1808

  • Newbie
  • *
  • Posts: 31
Re: Rig for Traffic Cars
« Reply #2 on: March 03, 2014, 02:29:57 PM »
Thank you very much Paul for your fast and clear answer. I'm happy when someone like me consider interesting this kind of tasks.. it means to not do what the software offers, but to do what you really need to do.

About distribution the trick was simply under "Random" + "Padding", even if easy, I didn't thought... Software 1 - Me 0
It works good.

About material.. well.. as you said if RailClone accept in input just one multisubobject material, the only solution as you said is to have one multisubobject material with a lot of sub-material, it means all the geometries need an unique ID. To do that the "attach" tool in 3ds max does it, but.. unfortunatley car models (like tree models) I use are not so light in terms of polygons... after attaching just 4-5 models.. the system starts to be heavy... considering also that I don't work directly with meshes, but with VrayProxy, the workflow needs another step in which I re-import the mesh from VrayProxy.

In this case I can simply use the "Align Spacing" tool, randomly delete e percentage of them and substitute the rest with vrayproxies (soulburn script).

Anyway (I speak like a 3d artist with some years of experiece) RailClone is a really really powerful plugin, consider that Revit too hasn't a so advance tool to manage railings.. stairs and so on. And what usually happens when a tool is good is that it is required even more :)
With the ability to manage RailClone through a node-based system you have opened to a moltitude of possibility. I suppose the ability to manage material independently from RailClone object is a good feature, useful for situation in which there are a consistent number of segments, and each segments has sub-elemets; traffic cars could be an example, but it is not the only one. Maybe a park with bench, trash, kiosk... or like a recent job I did: an interior palace with a lot of rooms with common objects like pictures on the walls, and so on.
I hope this "sub-task" to could be taken into account for future release

Thank you very much for your attention and support.



RobH2

  • Newbie
  • *
  • Posts: 28
  • Who is staring at the sea is already sailing.
    • NVision4D
Re: Rig for Traffic Cars
« Reply #3 on: May 01, 2015, 07:26:38 PM »
I'm following this thread closely because I have the same needs. I need to place 100's of VrayProxy cars in parking lots. In the past, I've literally placed 100's one-at-a-time manually. RC is prefect for this except for the material problem.

This may be what Paul is suggesting and I haven't tried it yet (as I have a 2000 frame render going and can't interrupt it) but here is what I think he's saying and maybe Paul can confirm my thinking. Normally I have 5 different cars in 5 colors each. That's 25 cars but for simplicity lets say I have 4 cars. I have a red and yellow Camaro and I have a blue and black Tundra. Ok, so, I would take the 4 car meshes (polys, not proxies) and attach them. I then pull the material from them and I have my MulitSub material with a few hundred material ID's.  I then detach my cars and reset the transforms. Now I write out my proxys (and label them so I know they share the monster MultiSub).

Now, when I use my proxy cars in RC, I just assign that one monster MultiSub to the Style and everything should work. I think.

For the resource issue with a lot of high poly cars I thought I might have an answer but I don't think it will work. I was thinking you could take all of the high poly cars and use ProOptimizer on them to make them about 10% of their original polycount. Then attach, grab the new MulitSub and then detach. But, the problem is, I believe that the ProOptimizer will be baked out of each mesh that you detach, leaving you with the lo-poly mesh to make proxys from. That won't work because we need to make the proxys from the hi-poly versions. I'm not sure how to solve this problem. I have 32GB of ram and I bet I won't be able to attach 25 hi-poly cars before Max crashes.

I'll keep watching here. Maybe we can solve it.

 

3ds Max Design (3D Studio thru Max 2018), ForestPack Pro 5.4.0, RailClone 3.0.7, ASUS P9X79 Motherboard, Intel i7-3960x, Hydro H80 CPU Chiller, 64GB DDR3 Ram, Quadro K5200 Display Adapter

RM4498

  • Newbie
  • *
  • Posts: 1
Re: Rig for Traffic Cars
« Reply #4 on: May 04, 2015, 12:20:40 AM »
HI...

Im not sure if this will slove your problem with the materials, but it kind of works for me...
I use a script called HCG Browser free on scriptspot, its a max visual browser, awesome.
If you enable the merge to a vrayproxy function, the script will automatically attach all objects in the max file for you, and create a Multisub Material for you...
Voila a VrayProxy and a Multisub all created in one double click of your car model image in the browser.
hope that helps.

Jens Andersen

  • Newbie
  • *
  • Posts: 11
    • Ikonoform
Re: Rig for Traffic Cars
« Reply #5 on: March 25, 2016, 04:58:28 PM »
Hi Paul

I've finally gotten the materials to work as one big multi sub map, but how do I control the corners better?

I've tried disabling "bend" under each car segment, but that results in a bit weird placement on the road/spline and sometimes they will overlap eachother. Also tried playing with padding, empty corner segment etc. Not getting a satisfying result either way. This also happens in your old scene file.

As a bonus question: Using Corona render I have to disable instancing on the style object for the mapping to work. What would be the best way to optimize large scenes with non-vray renders?

« Last Edit: March 25, 2016, 05:00:09 PM by TG2532 »

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1582
Re: Rig for Traffic Cars
« Reply #6 on: March 29, 2016, 11:49:48 AM »
Hi!

Please see the attached file for a revised approach that improves corners. I've made a few changes as follows.
- Set the Generator's corner bevel mode to None
- Turned off Bend and Slice for all segments.
- Added a Numeric node to the Generator's Bevel Radius parameter to help automatically round of sharp bends.
- Changed the way spaces between cars are created. Instead of adding random padding to the cars themselves, I've added it to a separate Null segment and added this plus the cars to a Sequence operator to create a pattern of Car ->empty space ->car etc. This helps the cars to more accurately track the spline's path.
- Turned on Reverse for the second generator to create traffic on the other side of the road (the previous version used mirror operators)

I hope this approach helps to solve some of the corner issues you've been having. For your second questions, to randomise Colours with Corona I'd recommend trying the following:

- In your materials use Corona Multi Tex maps for your colour variations. Set the mode to Instance.

- Create your style as normal but you don't need to add a Material map, as you mentioned this doesn't work with the instancing mode turned on when rendering with Corona.
- Leave the instancing engine On and use RailClone Tools to convert the RailClone object to instances.
- Render. Each instance will take a randomised colour or texture from the list in the Corona Multi Tex map.


As an alternative you could also use RailClone to lay down markers that are then used by Forest Pack to place cars. This has the advantage of allowing you to use Forest Colour to create randomisations. You can see more details about this technique in our Cars tutorial

I hope that helps, please let me know if you have any further questions.

Many thanks!

Paul.
« Last Edit: March 29, 2016, 12:08:07 PM by Paul Roberts »
Paul Roberts
iToo Software