<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Brake lights on when car stops/ off when moves in 3ds Max Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908296#M45155</link>
    <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Apr 2018 16:38:33 GMT</pubDate>
    <dc:creator>coilbookmedia</dc:creator>
    <dc:date>2018-04-04T16:38:33Z</dc:date>
    <item>
      <title>Brake lights on when car stops/ off when moves</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7904331#M45152</link>
      <description>&lt;P&gt;Hi anyway to create a wiring parameter for blend texture where if object moves brake lights are off when slows down or stops blend material value changes to 100 making lights on.&lt;/P&gt;&lt;P&gt;We will have a lot of cars in the scene that will randomly stop and go&amp;nbsp; and animating brake lights for each one is impossible,&amp;nbsp;&lt;/P&gt;&lt;P&gt;The scene is attached.&amp;nbsp; Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 14:05:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7904331#M45152</guid>
      <dc:creator>coilbookmedia</dc:creator>
      <dc:date>2018-04-03T14:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Brake lights on when car stops/ off when moves</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7904558#M45153</link>
      <description>&lt;P&gt;i found this example where car follows the path and if it stops material id changes. Anyway to have if car changes position at all it will change material id&amp;nbsp; not just percentage path constraint?&amp;nbsp; We will be using city traffic plugin and there is not follow path just movement of mesh.&amp;nbsp; &amp;nbsp;Thank you&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway t ochange&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current Script Controller&amp;nbsp;&lt;SPAN&gt;position.controller.percent&amp;nbsp; to actual mesh movement in space XYZ&amp;nbsp; to trigger lights off and on&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;braking = .96&lt;BR /&gt;&lt;BR /&gt;theCar = $MaroonSedan&lt;BR /&gt;PositionNext = at time (currentTime + 1) theCar.position.controller.percent&lt;BR /&gt;PositionCurrent = at time currentTime ( theCar.position.controller.percent )&lt;BR /&gt;PositionPrevious = at time (currentTime - 1) ( theCar.position.controller.percent )&lt;BR /&gt;&lt;BR /&gt;travel = abs (PositionNext - PositionCurrent)&lt;BR /&gt;travelPrev = abs (PositionCurrent - PositionPrevious)&lt;BR /&gt;&lt;BR /&gt;--ID = 1&lt;BR /&gt;&lt;BR /&gt;if (travel &amp;lt;= 0.01) then (ID = 2 ) -- standing still&lt;BR /&gt;--else (&lt;BR /&gt;&lt;BR /&gt;else if ((travel / travelPrev) &amp;lt; braking) then ( ID = 2 ) -- braking&lt;BR /&gt;else( ID = 1 ) -- coasting&lt;/P&gt;&lt;P&gt;--)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Apr 2018 15:17:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7904558#M45153</guid>
      <dc:creator>coilbookmedia</dc:creator>
      <dc:date>2018-04-03T15:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Brake lights on when car stops/ off when moves</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908131#M45154</link>
      <description>&lt;P&gt;I created a Max file with a box that moves along at a constant speed and then slows down.&amp;nbsp; The file also contains a point object and a light.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following script assigned to the point's y position will move it to 1 in Y if boxA is slowing down and 0.0 if is not.&amp;nbsp; I had hoped to use this as the switch to turn the light on/off.&amp;nbsp; I tried assigned the variable bLight to the intensity of the light object but it did not change when tested.&amp;nbsp; I also tried wiring the intensity of the light to the position of the point but that had no effect either.&amp;nbsp; I am at a loss as to how to associate the light's intensity or multiplier to a script variable.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;braking = 0.96
car = $BoxA
posNow = at time (currentTime) car.position
posNext = at time (currentTime + 1) car.position
posBefore = at time (currentTime - 1) car.position

dPre=length(posNow-posBefore)
dNext=length(posNow-posNext)

if(abs(dPre-dNext) &amp;lt;= 0.01) then 
 (bLight = 0.0
  0.0
  ) -- standing still
else if ((dNext/dPre) &amp;lt; braking) then 
(bLight = 1
1.0
)
else 0.0

&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Apr 2018 15:47:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908131#M45154</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2018-04-04T15:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Brake lights on when car stops/ off when moves</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908296#M45155</link>
      <description>&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 16:38:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908296#M45155</guid>
      <dc:creator>coilbookmedia</dc:creator>
      <dc:date>2018-04-04T16:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Brake lights on when car stops/ off when moves</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908323#M45156</link>
      <description>&lt;P&gt;By the way is there any way to apply this to multiple cars automatically? or have lights work with the car they linked to? instead of&amp;nbsp; changing this for each light&amp;nbsp; and car&amp;nbsp; since we will have hundreds of cars.&amp;nbsp; &amp;nbsp;car=$BoxA&amp;nbsp; &amp;nbsp;something like&amp;nbsp; car = the one where lights linked to?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our best goal is to actually use octane mix texture instead of material id change&amp;nbsp; but not sure how this can be done&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 16:46:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908323#M45156</guid>
      <dc:creator>coilbookmedia</dc:creator>
      <dc:date>2018-04-04T16:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Brake lights on when car stops/ off when moves</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908807#M45157</link>
      <description>&lt;P&gt;I'm fairly new to Max scripts so it might be better to post your question on the Programming forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think one approach you could take to cycle through all you cars and their brake light is via a object naming convention.&amp;nbsp; For example, CarV01, CarV02, .. would be the names for the vehicle while CarB01, CarB02,... would be the names for the corresponding brakelights. A script could cycle through all the objects that start with "CarV" and determine if it is braking or not.&amp;nbsp; The script would then look for the object "CarB" concatenated with the number of the current car.&amp;nbsp; I am not sure if you can do this with a Max script. Alternatively, there may be a way to look for linked objects once the car is found.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 19:19:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7908807#M45157</guid>
      <dc:creator>leeminardi</dc:creator>
      <dc:date>2018-04-04T19:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Brake lights on when car stops/ off when moves</title>
      <link>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7911937#M45158</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3524470"&gt;@coilbookmedia&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for posting! I would agree with&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/822616"&gt;@leeminardi&lt;/a&gt;&amp;nbsp;you should post in the &lt;A href="https://forums.autodesk.com/t5/3ds-max-programming/bd-p/area-b35" target="_blank"&gt;3ds Max Programming forum&lt;/A&gt;. The folks there are very knowledgeable and should be able to help you out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 18:17:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-forum/brake-lights-on-when-car-stops-off-when-moves/m-p/7911937#M45158</guid>
      <dc:creator>faline.custodio.da.silva</dc:creator>
      <dc:date>2018-04-05T18:17:21Z</dc:date>
    </item>
  </channel>
</rss>

