Itoo Software Forum

Author Topic: Effects tools... trying to understand it and tweak existing codes...  (Read 617 times)

CQ4380

  • Newbie
  • *
  • Posts: 25
Hey
I'm trying to understand effects tool but I'm hitting a wall left and right.  I'm trying to edit http://docs.itoosoft.com/display/FORESTPACK/Bend+by+Object so that I can take multiple objects... normally I would start with something like

a = [object,object1,object2]

Or a better way to select multiple objects at 1 maybe something like:

a = selection as array

then I would run the loop to do something like:

for obj in a:
    do stuff xxx

But loops don't work ? I mean I tried python/maxscript/ we don't have loops ?

How can I add multiple objects to forest pack pro system and use them to control rotation of instances within custom area of object. The Bend by object kinda does it but it changes rotation to face towards the object instead of mirroring the rotation but I think that's rather easy fix just needs some math :- )

I'm trying to create something similar to Xgen in maya where we can spawn X amount of objects and then using them we can control scale/rotation of instances surrounding it...

Right now it looks like I will have to implement 7 lines of code per object + 4 control parameters... meaning that if I want to add 10 objects I need 70 lines of code + 40 parameters... not very effective. :- (

Regards
Dariusz

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1490
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #1 on: October 11, 2016, 01:38:50 PM »
Hi Dariusz,

Currently loops aren't supported (we would like to implement this and other improvements in the future) and Forest's Effects feature is more similar to 3ds max's Expression Techniques than a programming language. For more detailed info please check the Effects Syntax site.

As using multiple objects would be complicated in this case, what about using the Exclude Area(s) instead? Attaching a sample scene showing such possible set-up. Hope you'll find it useful.

Best regards,

CQ4380

  • Newbie
  • *
  • Posts: 25
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #2 on: October 12, 2016, 02:46:36 PM »
Hey

mmm yeah I guess I will just have to hard code all controls in by hand...

Here is a video of what I would like to get - keep in mind this is just a work around of this feature that I would love to get that I posted about over here > http://forum.itoosoft.com/index.php?topic=4055.0

https://www.youtube.com/watch?v=oRYAXfamD2E&feature=youtu.be

The above system allows to add control points and then use their rotation+scale to control instances. That could be quite great place holder tool for precise grass sculpturing that I would love to see in (hope) short future... (next week... :- ))) )

« Last Edit: October 12, 2016, 02:49:14 PM by CQ4380 »

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1490
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #3 on: October 13, 2016, 10:26:13 AM »
Hi,

Currently the only available attribute of Object Parameter inside of Forest's Effects is the position of object relative to Forest (vector). Other transform info isn't available yet. We'll see what can be done to implement it in future releases.

Best regards,

CQ4380

  • Newbie
  • *
  • Posts: 25
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #4 on: October 13, 2016, 11:11:58 AM »
Hi,

Currently the only available attribute of Object Parameter inside of Forest's Effects is the position of object relative to Forest (vector). Other transform info isn't available yet. We'll see what can be done to implement it in future releases.

Best regards,

Haven't had time to break through the coding part but I was hoping I can do something like this + a parameter that affects distance :

fpItem.rotation.x = object1.rotation.x   >  +/-/*// by distance value or something?
fpItem.rotation.y = object1.rotation.y   >  +/-/*// by distance value or something?

fpItem.rotation.x = object2.rotation.x   >  +/-/*// by distance value or something?
fpItem.rotation.y = object2.rotation.y   >  +/-/*// by distance value or something?

fpItem.rotation.x = object3.rotation.x   >  +/-/*// by distance value or something?
fpItem.rotation.y = object3.rotation.y   >  +/-/*// by distance value or something?

Are you telling me that we can't do it ? :- (



Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1490
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #5 on: October 13, 2016, 11:54:24 AM »
Hi,

That's not possible in Effects yet (as mentioned above, just the object's position can be accessed). An option would be to use the Custom Edit mode (in which is possible to modify the sub-objects of a Forest object) and access those values by maxscript. There is an interface named "trees" for using it provided by maxscript. You can see all the functions included with "showInterfaces($Forest001)".

Best regards,

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1490
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #6 on: October 13, 2016, 01:53:22 PM »
Hi,

Let me add, that though just the position info can be used from object(s) directly, it's possible to use controllers as Controller parameters. Attaching an example using the fpItem.rotation.z = zRotController; expression to control the rotation. Hope you'll find it useful.

To assign a Controller parameter:

(1) Open the Effects rollout.
(2) Select a Controller parameter from the list.
(3) Click on Pick
(4) The Track View Pick dialogue will open showing the scenes objects and their controllers. Controllers that are compatible with the parameter's type are selectable, incompatible tracks are greyed out.

Best regards,

OJ3358

  • Newbie
  • *
  • Posts: 10
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #7 on: October 20, 2016, 05:08:53 PM »
Hello guys.

I am also starting to understand it (and it is quite difficult for someone who never code) but I was wondering if it is possible to use the Bend modifier itself in a code ?

I was trying the "Lean_Out_Value" by a real bending value but it doesn't work.

Michal Karmazín

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1490
Re: Effects tools... trying to understand it and tweak existing codes...
« Reply #8 on: October 20, 2016, 05:44:40 PM »
Hi,
Quote
"... it is possible to use the Bend modifier itself in a code?"
Well, Forest isn't meant for modifying the source geometry (like with the Bend modifier) and just pre-defined variables of Forest object - Attributes can be changed by the Effects feature. It's possible to read the Bend modifier value(s) like Angle or Direction by using a Controller Parameter(s), but I guess, that's not you're looking for. Please feel free to check the Effects Syntax documentation for mode details.

Best regards,