Itoo Software Forum

Author Topic: Scripts for Forest Pack  (Read 272606 times)

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 3049
Re: Scripts for Forest Pack
« Reply #15 on: September 07, 2016, 10:19:52 AM »
Hi!

If you just need a simple line you can use the following -

for i in selection do i.seed = random 1 999999


It will apply a different random seed to each selected Forest Pack object.

I hope that helps.

Cheers!

Paul
Paul Roberts
iToo Software

raistlin

  • Jr. Member
  • **
  • Posts: 60
    • My website
Re: Scripts for Forest Pack
« Reply #16 on: September 07, 2016, 03:20:54 PM »
Soooo, here my solution!
as you have help me a lot in many times, here is my little contribution...

rollout FFRandomSeed "FF-Random Seed" width:200 height:128
(
   button btn1 "Random Seed" pos:[24,72] width:152 height:32
   label titre "  - Forest Pack - Random Seed -" pos:[16,8] width:168 height:32
   groupBox grp1 "Select at least one FF-Object" pos:[8,40] width:184 height:80
   on btn1 pressed  do
      for i in selection do( i.seed = random 1 999999)
)
createdialog FFRandomSeed

Have a nice day!
La vie est une aventure dangereuse d'où personne n'est jamais sortie vivant.

Haider of Sweden

  • Newbie
  • *
  • Posts: 47
    • Portfolio
Re: Scripts for Forest Pack
« Reply #17 on: October 15, 2016, 01:14:18 AM »
Script wish:

Assign current camera to selected forest(s)
//Haider

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4539
    • iToo Software
Re: Scripts for Forest Pack
« Reply #18 on: October 15, 2016, 08:40:54 AM »
Script wish:

Assign current camera to selected forest(s)

If that helps, the "Copy" button in Camera rollout, copies current camera and properties to all FP objects.

Carlos Quintero
iToo Software

Haider of Sweden

  • Newbie
  • *
  • Posts: 47
    • Portfolio
Re: Scripts for Forest Pack
« Reply #19 on: October 29, 2016, 06:14:44 PM »
InstancesToForest


I hope it's useful for some people.

Many thanks!

Paul.

In your video, you're in the Geometry Rollout and press the None-button, and pick a mesh. Even though, the mesh is not visible in the FP object and under Tree Editor it says 0 Items.
In my case, when I press None and then pick a mesh, I immediately see a point cloud of that mesh.
- What am I doing different from you?

Later, you explain "change to Tree Editor mode"
- What does it mean? In the video, you simply enter the rollout, but you're not pressing any button or changing modes.

In my case, I wanted to turn one single object to an FP object. InstanceToForest didn't work for me. The only thing it did was to reset scale and rotation of the picked object. Under Tree Editor, there were 0 Items.
However, when I had multiple instances, it worked, except it skipped the "original mesh" which appears to be the first mesh created, not the one I pick as source.
In your video, you picked one item, and when you pressed Instances to Forest, it turned them all, including the object you picked, to point clouds.
//Haider

Haider of Sweden

  • Newbie
  • *
  • Posts: 47
    • Portfolio
Re: Scripts for Forest Pack
« Reply #20 on: October 29, 2016, 06:20:07 PM »
Script wish:

Assign current camera to selected forest(s)

If that helps, the "Copy" button in Camera rollout, copies current camera and properties to all FP objects.

Unfortunately, this was not what I was looking for.
I meant a better way to assign a camera instead of the current solution where you press the None-button and then pick a camera.
My trick so far is to press auto-assign to active view, then pan the scene and cancel with right click, and the camera gets assigned. Then I untick "auto assign".
This could be scripted and what the script does is assigning the current camera to the selected forest object.
//Haider

Kerezsi

  • Newbie
  • *
  • Posts: 7
Re: Scripts for Forest Pack
« Reply #21 on: January 12, 2017, 11:34:23 AM »
Script wish:

Assign current camera to selected forest(s)

If that helps, the "Copy" button in Camera rollout, copies current camera and properties to all FP objects.

Unfortunately, this was not what I was looking for.
I meant a better way to assign a camera instead of the current solution where you press the None-button and then pick a camera.
My trick so far is to press auto-assign to active view, then pan the scene and cancel with right click, and the camera gets assigned. Then I untick "auto assign".
This could be scripted and what the script does is assigning the current camera to the selected forest object.

run in maxscript listener, assigns the current viewport's camera to selected forest objects:

try for s in selection where classOf s == Forest_Pro do s.camera = getActiveCamera() catch()

Straightface Studios

  • Newbie
  • *
  • Posts: 15
    • Straightface Studios
Re: Scripts for Forest Pack
« Reply #22 on: March 28, 2017, 12:02:12 AM »
Here is a script which will take a Krakatoa PRT Loader or a Particle Flow source and places a tree for each particle at the particle's position.   Unfortunately there is a bug in ForestPack which limits the particle system limit to around 20k particles before it's impossibly slow so only use it for smaller particle systems.

#Note only reads position, not orientation or scale of particles.

raistlin

  • Jr. Member
  • **
  • Posts: 60
    • My website
Re: Scripts for Forest Pack
« Reply #23 on: July 13, 2017, 01:37:16 AM »
Hi itoo!

The defy of the day :
is there a way to clean forest  pack pro duplicate geometry in the list??

In a case we merge some scenes with Forest object, we have some duplicate source geometry, without the same name in the forest template layer, but the same Xref name and place...

Is there a script to automate the process of replacement and keep the surface?
It's a way to optimise our scene and clean the assets for renders.

I try to merge fpp object, but first, we lost the surface, and second : we lost our instance which are randomly replaced by the other...

Cheers :) ^^
La vie est une aventure dangereuse d'où personne n'est jamais sortie vivant.

Adam86

  • Jr. Member
  • **
  • Posts: 55
Re: Scripts for Forest Pack
« Reply #24 on: March 13, 2018, 03:30:24 PM »
Would love one that could add a forest colour map into selected mesh materials, i've got about 15 plant models each with 15 multisub object leaf ID's, going to have to manually add one to each slot!

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 2678
Re: Scripts for Forest Pack
« Reply #25 on: March 13, 2018, 04:27:43 PM »
Hi,

The Material > Optimize Materials feature allows you Apply Forest Color to a Selection or the Material Library (attaching screen-shot). Hope that helps.

Best regards,

Adam86

  • Jr. Member
  • **
  • Posts: 55
Re: Scripts for Forest Pack
« Reply #26 on: March 13, 2018, 04:37:43 PM »
Hi,

The Material > Optimize Materials feature allows you Apply Forest Color to a Selection or the Material Library (attaching screen-shot). Hope that helps.

Best regards,

Amazing!!! that was quick work :)

FlynnAD

  • Newbie
  • *
  • Posts: 10
Re: Scripts for Forest Pack
« Reply #27 on: May 13, 2018, 04:39:37 AM »
InstancesToForest

This script looks in the scene to find instances of the objects in Forest Pack's item list. When it finds them they're added to FP, matching the position, rotation and scale.

Paul.

Hi Paul,
Your script is fantastic. I've used it to convert old mental ray proxies into a format that I can now re-use in Vray, as well as grabbing hundreds of 3dsmax instances into one forest object.

However, I've noticed that the script WILL ALWAYS MISS ONE OBJECT. Just one, not two, not none. If you make an array of instances in 3dsmax, then make a forest object from these instances using your script, it's easy to pick out the single object that doesn't make the cut. Can you find the glitch in your script that causes one random item to be excluded?

Thanks,
Matt

Rokas

  • Hero Member
  • *****
  • Posts: 3324
Re: Scripts for Forest Pack
« Reply #28 on: May 14, 2018, 03:51:29 PM »
Hi Paul,
Your script is fantastic. I've used it to convert old mental ray proxies into a format that I can now re-use in Vray, as well as grabbing hundreds of 3dsmax instances into one forest object.

However, I've noticed that the script WILL ALWAYS MISS ONE OBJECT. Just one, not two, not none. If you make an array of instances in 3dsmax, then make a forest object from these instances using your script, it's easy to pick out the single object that doesn't make the cut. Can you find the glitch in your script that causes one random item to be excluded?

Thanks,
Matt

In 36th line remove "-1" so it look like this:
      for x = 1 to (instanceList.count) do
Rokas

Haider of Sweden

  • Newbie
  • *
  • Posts: 47
    • Portfolio
Re: Scripts for Forest Pack
« Reply #29 on: June 20, 2018, 12:54:23 PM »
A script that sets Display > Viewport to
* Mesh
* Proxy
* Points-cloud
//Haider