Ali Torabi

Digital Architecture & Technology

Parametric brick wall. »« Rotating panels along the surface

Circular pattern response to an attractor object

Attractor 

Level: Advanced
In This Video:

  • Use script controller to access objects properties outside of the array.
  • control the radius of cylinders in array according to their distance from a specific object.
  • How to use setTarget command Addressing properties of other objects from script controller.
  • Using getItem command the get the value of specific property of the current item.
  • Note1: setTarget function can return the value of the any propety of any object outside the array.
    setTarget object:object name prop:property name
    Note2: if you dont mention the index argument in getItem function it returns the value
    of the property for the current item in the array.
    getItem prop:property name

    , , , , , , ,
    April 22, 2010 at 4:55 pm
    25 comments »
    • December 19, 2011 at 9:35 amalex

      hi,
      is it possible to inverse the effect, so when the attractor approaches, the cylinders disappear?
      grtz
      alex

    • October 11, 2011 at 11:28 pmadmin

      why don’t you use PARA 2 , drag magnet controller to the property and hit the animate button!.
      check out the video in this post:http://www.torabiarchitect.com/blog/?p=295

    • October 6, 2011 at 2:40 pmTarcise

      Hello,

      Thank you for your excellent plug.
      I try the tutorial from your video and it works perfectly.
      But i want to test something else and it doesn’t work.
      Excuse my bad english i’m french.
      I want to create an animation with cubes who turns in y axis when the attractor approach.
      If i use the script sentence from the video above, nothing happens.
      The number of turns depends of the distance of the attractor.
      Could you help me please?

      Thank you very much.

      Best regards.
      Tarcise.

    • December 30, 2010 at 1:47 ambas

      wow thanx :-)

      gonna try now

      cheerz!

    • December 21, 2010 at 8:35 pmAli

      Hi just a few syntax error. !
      check this out

      a = setTarget object:$Sphere01 prop:position
      b = getItem index:[index1,index2,1] prop:position
      d = (distance a b)/30
      if d>90 then 90 else d

    • December 15, 2010 at 5:20 ambas

      hi ali

      i tried to limit a value to 90

      i used this script, composed from info above.
      but im doing something wrong :-(

      script:

      a = setTarget object:$Sphere01 prop:position
      b = getItem index:[index1,index2,1] prop:position
      d = (distance a b /30)
      result=case of (
      (d>90)=90
      )
      result

      and i dont realy know what the index part is doing :-)

      i hope u can help

      thanx!

    • November 25, 2010 at 6:51 pmmarchoud

      Received, Thanks a lot!!!

    • November 25, 2010 at 4:39 pmAli

      Hi Marchoud,
      I sent you the files.
      Thanks for your comments

    • November 25, 2010 at 4:23 pmmarchoud

      It seems you forget me,
      I’m waiting please your answer regarding
      the script controller…
      Thanks for your response!!

    • November 19, 2010 at 4:45 pmmarchoud

      Thanks a lot for your reactivity!!
      All advices and informations given quickly and efficiency!
      Great web site and script and professionnal admin!!
      I’m waiting for your mail when you back home, thanks again!!!
      Good trip and Keep it up!!

    • November 19, 2010 at 6:58 amadmin

      Sorry, it didn’t work, since I’m travelling now and using internet of hotel it’s hard to download files from the server, I’ll send it to you once I get back home.

    • November 19, 2010 at 6:56 amadmin

      yes , I just sent it to your email.

    • November 19, 2010 at 6:55 amadmin

      The Right click maz not work if the Macro file has been not executed by 3ds max automaticaly. Please run this file from utility bar before you start working with Parray.
      To create an object from the array you need to first click on Kill All button in parametric array setting diaqlog box, then select all nodes of array using selecNodeX ,Y and Z form right click menu. After that isolate the selecteed objects (Alt+q) and pick one , convert it to editable poly or mesh and attach the rest to it.(using attach multi buttom from modify panel)

      Regarding several operation I didn’t get what you are exactly looking for. But I’m working on array works on array in next version which allow you to array on another array with different setting.

    • November 19, 2010 at 1:44 ammarchoud

      And another thing please,
      have you a ready made file with all the expressions we can used inside the script controller?
      Or can you send me some examples of expressions i can use through the script, caus it is necessary to know the language to enter inside the script and whole things efficiently.
      Thanks!!!

    • November 19, 2010 at 1:39 ammarchoud

      Thanks a lot for the quick answer,
      it works!
      I have another question please, when i right clic
      i can’t choose a node like in the tutorials,
      when i want to select a node, it don’t work.
      when i finished the object how can i used it and transform it
      in editable poly, i erase the array point and then i can
      used it or something else?
      Can i make more than one operation on a surface or can i make
      several operations through the parametric array to obtain the object.
      For example i try to build a hand rail of a spiral stair and i want to apply to
      the surface i have from the stair, the spline designing the path,several effect like the louvers in your tutorial + other operations… is it possible??
      Thanks again for your answers and for your great work!!!

    • November 18, 2010 at 7:02 amadmin

      Hi,
      I think you missed the blank space between p1 and p2. Just to make sure, copy whatever you placed in script and send it to me I’ll check it out. For more information about distance command also check the maxscript help.
      Thank you

    • November 18, 2010 at 6:43 ammarchoud

      Hello Ali,
      Awesome script, amazing possibilities but like
      si, above, this operation not work for me, i have a message error
      concerning distance p1p2…
      Thanks for your great tutorials and for your work!!
      Keep it up!
      Thanks for your answer!!

    • November 12, 2010 at 11:21 pmadmin

      Hi Ivy, Yes!You just need to put same code for the rotation amount. Don’t forget that unit for any rotation parameter is degree so you may need to multiply the result value by some scale factor to get proper amount of twist effect.

    • November 12, 2010 at 9:48 pmivy

      hello,
      i was wondering if it can helps to control louvers width :(

    • October 19, 2010 at 3:57 pmsi

      Hai Ali,

      I was testing this tutorial, unfortunately i keep getting this error message at the end when i press Apply. Max is telling me this :Maxscript controller exception; Type error:Call needs function or class, got: undefined? The result of the script wouldn’t show at all. Thanks for helping.

    • October 13, 2010 at 9:51 amadmin

      definitely yes, If you familiar with parameter editor in MAX you can make your own attributes for custom made objects. those properties will be listed in parametric array just like the max default properties.

    • October 13, 2010 at 12:14 amDan

      Can you use this method for objects other than cylinders, for non-primitive, custom made objects?

    • July 1, 2010 at 11:51 amGiacomo

      Thanks a lot Ali,
      I’ll work it out asap…
      ciao

      Giacomo

    • June 24, 2010 at 4:50 pmAli

      Hi Giacomo,
      Thanks for the comment , you made a good point!
      What you are asking is exactly what The “CASE OF” statement dose in max-script. I made a short example, hope you find it helpful.
      ——————————————
      a = setTarget object:$Dummy01 prop:position
      b = getItem index:[index1,index2,1] prop:position
      d = distance a b
      Case Of
      ——————————

      as you can see the result is depend on what condition you may put for different cases. in example above I have set up three different scenario. First is when the distance is less than 5 , in this case the result will be 100%. second situation occurs when distance is something between 5 and 20 and the result will be 50%. and in last scenario we consider the amount of 20% for any distance larger than 20. you should mention RESULT as last expression in the script after you close the case statement.

    • June 21, 2010 at 12:57 pmGiacomo

      Dear Ali,
      I’m trying to improve this tutorial.
      what if you want to set up a limit for the scale? scaling an object within a range (between a minimun and a maximum value) depending on the distance to the target?
      or dividing the scaling in different ranges (a.e.: target distance=5 => scale object=50%; target distance=2 => scale object=100%; target distance=1 => scale object=200%)?
      I hope it’s all clear.

      thanks a lot

      Giacomo

    Leave a Reply or trackback

    You must be logged in to post a comment.