Itoo Software Forum

Author Topic: Scattering Groups  (Read 3467 times)

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2403
    • iToo
Scattering Groups
« on: April 16, 2018, 01:31:33 PM »
Sometimes ForestPack users wants to scatter groups (instead of collapsed mesh) and wants randomization which does not "explode" their composed geometry.
Lets see how can we do just that by creating floating lanterns on the river scene.

Step 1
Starting with basic geometry items. Total of 4 pieces: Frame, Candle, Candle Flame, and Paper:


Step 2
Let`s move every item to its intended position.
We should prepare Geometry, so all of the items have the same pivot location.

First picture shows pivots in different positions. Second- in the same position, just as we need.

If You have a lot of objects, You can use script to set pivots for all the objects at once:
Code: [Select]
for obj in selection do obj.pivot = [Selection.center[1],Selection.center[2],0]
Step 3
Easy one- Group Objects.

Step 4
Now the fun part. Let`s add ForestPack object to the scene.


Step 5
Choose "Custom Object": and select None to initiate object picking...

Step 6
This where it is tricky. Instead of direct clicking your grouped composition, press "h" to open max "Select From Scene" dialog.
Double click Your group name.
This how to add a group instead of only one object if You directly clicked.

*Tip. If group were opened, You could click group's bounding box. It would be the same.


This is what we have right now:


Step 7
Randomization.
Too bad default randomization messes up("explodes") whole composition.


Thankfully we can make randomization the same for all grouped objects, by sampling a map.
And since we made pivots in the same location, all composition items will get the same randomization.
Hooray.

Lets create a simple noise map:

... and instance it in all "Transformation" roll-out Map slots:


Result haven't changed, as we need to enable that map:
Check all "Map" Check-boxes and Uncheck "Probability Map"


I disabled rotation along X and Y axis by putting values to 0.


Result start to look like good:


Step 8. Lights.

Easy way to make candles emit light is to apply light material to the sphere we created.
I use vray, so I chose VRayLightMaterial and added Forest Color for randomization:
3 maps to variate flame color and
Tint Override -black and white gray-scale map with multiply blending mode to variate light intensity:


My final scene looks like this:



Bonus
There is another way to distribute real lights instead of object with light-material.
Caveat: Lights will not be dynamically linked. So do it as the last step.

What we done so far is good, and only few steps are needed:
Step 1
Detach Flame object from the group.

Step 2
Geometry wont refresh automatically, so refresh it by adding the same group the same way.
This time there will be no flame:


Step 3.
Lets copy (not instance) ForestPack object and replace Composition object with our flame object:

We got flames back as separate ForestPack object. Yey..!

Step 4.
Replacing ForestPack with real light:

There is script to do just that. Realy easy, user friendly. Download it from forum  here.
Create Light You want to distribute.

Run the script.


Choose "Pick object to instance" Select Light object.
Select Your ForestPack Flame Object, and press "Instances to Forest" and press "Del" to delete ForestPack object.
Variable light intensity and color can be achieved using other scripts, like this one
That is it!


Final scene with scatter lights:


P.S.
Should You want to randomize a Transform->Translation You need to make sure that Bounding Box of each object in the group is the same. It is possible to add empty vertices:



Hope You find techniques described here useful.
Now You should understand how to add groups to scatter. What are their limitations. And how to work around them.
How to scatter real lights with ForestPack Pro and this method drawback.
Let me know if all the steps were clear to understand. I attach my max file for You to check any details.
« Last Edit: May 04, 2019, 07:47:52 PM by Rokas »
Rokas
iToo Software

sarfrazsaifi

  • Newbie
  • *
  • Posts: 7
Re: Scattering Groups
« Reply #1 on: July 22, 2019, 03:49:00 AM »
Useful indeed...thankyou. One thing i need to ask.. This works if we use some distribution maps. As soon as we do custom edits to forest objects, like i needed to change positions of some objects.. then i tried adding flame geometry group(that i want to replace with vray lights), all flame objects were not showing. Rather one for each object was created. Can't we add lights to custom edited/positioned objects?

Hope i am clear in putting my question/problem...

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2403
    • iToo
Re: Scattering Groups
« Reply #2 on: July 22, 2019, 08:51:23 AM »
Everything seems to work as expected:


Which step gives You trouble?
Rokas
iToo Software

sarfrazsaifi

  • Newbie
  • *
  • Posts: 7
Re: Scattering Groups
« Reply #3 on: July 22, 2019, 01:48:46 PM »
No this step is working fine... But steps after that creating problem..After custom editing objects.. I did :-

1. Copy forest object and renamed.
2. Remove geometry.
3. Add vray lights dummy geometry group by selecting from selection list.

Problem is that not all group is added but just a part of it is added....

If you want i can attach screenshots step by step

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2403
    • iToo
Re: Scattering Groups
« Reply #4 on: July 22, 2019, 01:51:54 PM »
Please add. and maybe max file as well?
Rokas
iToo Software

sarfrazsaifi

  • Newbie
  • *
  • Posts: 7
Re: Scattering Groups
« Reply #5 on: July 22, 2019, 02:09:52 PM »
ok then i am sending max file. contains chandelier, 1 vray sphere light, dummy spheres group to be replaced with vray sphere lights in scattering..
Chandelier and dummy spheres have same pivot.
Please give it a try.. i tried with same steps you told but failed....

file download link:-
https://wetransfer.com/downloads/fb678e2eb858d90fedf4ce2d550f966920190722120828/c12cd6589fbc128cb8ffdbd60025df3320190722120828/66809e

sarfrazsaifi

  • Newbie
  • *
  • Posts: 7
Re: Scattering Groups
« Reply #6 on: July 22, 2019, 02:13:00 PM »
P.S .. it is working... lights scatter on dummy spheres... if we don't do custom editing... Please first custom edit chandeliers and move them from their positions .. then try scattering vray sphere lights on them...

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2403
    • iToo
Re: Scattering Groups
« Reply #7 on: July 22, 2019, 02:15:43 PM »
Oh ok. Now I understand. We will check the problem. Thanks.
Rokas
iToo Software

sarfrazsaifi

  • Newbie
  • *
  • Posts: 7
Re: Scattering Groups
« Reply #8 on: July 22, 2019, 02:40:02 PM »
Problem solved after all trying probable things.... Actually i skipped that flame detachment step... Thankyou anyways :) 

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2403
    • iToo
Re: Scattering Groups
« Reply #9 on: July 22, 2019, 02:41:24 PM »
Yes. That is what I was replying already. I see no problem with Custom Edit workflow.
Rokas
iToo Software

sarfrazsaifi

  • Newbie
  • *
  • Posts: 7
Re: Scattering Groups
« Reply #10 on: July 22, 2019, 02:46:40 PM »
yeah i was doing a step wrong....

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2403
    • iToo
Re: Scattering Groups
« Reply #11 on: July 22, 2019, 02:48:13 PM »
No problem. I am happy to hear it is working for You now.
Rokas
iToo Software

gabu

  • Newbie
  • *
  • Posts: 1
Re: Scattering Groups
« Reply #12 on: March 06, 2020, 02:13:27 PM »
Hi, would this be possible with lights? I' would like to scatter for example a group that contains corona lights as well. The group scatters fine but the lights don't.

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2403
    • iToo
Re: Scattering Groups
« Reply #13 on: March 06, 2020, 02:31:00 PM »
Hi, would this be possible with lights? I' would like to scatter for example a group that contains corona lights as well. The group scatters fine but the lights don't.

Hi, unfortunately not.
Rokas
iToo Software