Community
InfraWorks Forum
Welcome to Autodesk’s InfraWorks Forums. Share your knowledge, ask questions, and explore popular InfraWorks topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tree Style Rules - Random rotation and scaling

1 REPLY 1
SOLVED
Reply
Message 1 of 2
sduffin
322 Views, 1 Reply

Tree Style Rules - Random rotation and scaling

sduffin
Advocate
Advocate

I exported blocks from our landscaping plans to a SDF file and imported them into my model using the style rules assigning 10 or so tree/veg types by block name to the various default 3d tree/veg models (see attached).  Questions:

  • Is there a way to randomize the rotation and vary the sizes by just a bit to make them look more realistic?
  • Is there a way to indivually scale a class of trees to be more appropriate to the landscaping design since we are using generic blocks?  For example, we may want to adjust the spruce height, but since everything was brought in through a single SDF and style rules applied, I am not sure how to adjust the scale of the spruce trees given the 10 different style rules.  I thought I could use the Table and alter the Z scale, but it adjusts all the trees/veg in the style rule.

Thanks in advance for you help.  The attached snippets will be helpful.

0 Likes

Tree Style Rules - Random rotation and scaling

I exported blocks from our landscaping plans to a SDF file and imported them into my model using the style rules assigning 10 or so tree/veg types by block name to the various default 3d tree/veg models (see attached).  Questions:

  • Is there a way to randomize the rotation and vary the sizes by just a bit to make them look more realistic?
  • Is there a way to indivually scale a class of trees to be more appropriate to the landscaping design since we are using generic blocks?  For example, we may want to adjust the spruce height, but since everything was brought in through a single SDF and style rules applied, I am not sure how to adjust the scale of the spruce trees given the 10 different style rules.  I thought I could use the Table and alter the Z scale, but it adjusts all the trees/veg in the style rule.

Thanks in advance for you help.  The attached snippets will be helpful.

1 REPLY 1
Message 2 of 2
sduffin
in reply to: sduffin

sduffin
Advocate
Advocate
Accepted solution

OK I just became a script expert - I didn't know I had it in me!  To randomize heights and rotation use this script:

 

function Process(SOURCE, TREES) {

TREES.DESCRIPTION = SOURCE["ZSCALE"];

TREES.EXTERNAL_ID = SOURCE["FeatId"];

TREES.MODEL_ROTATE_Z = Math.random() * (360);

TREES.MODEL_SCALE_Z = Math.random() * (1.2-0.8) + 0.8;

TREES.NAME = SOURCE["BLOCKNAME"];

 

return true;

}

 

This will scale the blocks between 0.8 and 1.2 of the original size and will randomly rotate 0-360 degrees.

 

I did a source filtering by tree/veg type to give more control over sizing by the specific 3D model.

0 Likes

OK I just became a script expert - I didn't know I had it in me!  To randomize heights and rotation use this script:

 

function Process(SOURCE, TREES) {

TREES.DESCRIPTION = SOURCE["ZSCALE"];

TREES.EXTERNAL_ID = SOURCE["FeatId"];

TREES.MODEL_ROTATE_Z = Math.random() * (360);

TREES.MODEL_SCALE_Z = Math.random() * (1.2-0.8) + 0.8;

TREES.NAME = SOURCE["BLOCKNAME"];

 

return true;

}

 

This will scale the blocks between 0.8 and 1.2 of the original size and will randomly rotate 0-360 degrees.

 

I did a source filtering by tree/veg type to give more control over sizing by the specific 3D model.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report