Object speed changes mix material value OR material ID

3D Studio Max Plugin (Export Script Plugins developed by [gk] and KilaD; Integrated Plugin developed by Karba)
Forum rules
Please post only in English in this subforum. For alternate language discussion please go here http://render.otoy.com/forum/viewforum.php?f=18
Post Reply
coilbook
Licensed Customer
Posts: 3032
Joined: Mon Mar 24, 2014 2:27 pm

I know it is a bit off topic but anyway to do a float script or use parameter dialog to control octane's mix material amount with actual car speed. If car stops/slows down mix amount go to 1. Car starts moving mix amount goes to 0. I appreciate any help.


Thank you!!!

P.S



They have this for path constraint with material ID change between 1(go) and 2(stop) but we cannot use it because we yuse city traffic to make cars stop and go
braking = .96

theCar = $MaroonSedan
PositionNext = at time (currentTime + 1) theCar.position.controller.percent
PositionCurrent = at time currentTime ( theCar.position.controller.percent )
PositionPrevious = at time (currentTime - 1) ( theCar.position.controller.percent )

travel = abs (PositionNext - PositionCurrent)
travelPrev = abs (PositionCurrent - PositionPrevious)

--ID = 1

if (travel <= 0.01) then (ID = 2 ) -- standing still
--else (

else if ((travel / travelPrev) < braking) then ( ID = 2 ) -- braking
else( ID = 1 ) -- coasting

--)

Thank you
Attachments
brakes on off with path contraint.zip
(81.7 KiB) Downloaded 126 times
car stop go brake lights.jpg
brake lights (2).zip
(35.67 KiB) Downloaded 138 times
coilbook
Licensed Customer
Posts: 3032
Joined: Mon Mar 24, 2014 2:27 pm

it looks like this float script work with changing material ID 1-2 when car stops and goes If anyone know how to change mix material amount instead of ID 1-2 will be great


braking = .96

theCar = $RC3
PositionNext = at time (currentTime + 1) theCar.position
PositionCurrent = at time currentTime ( theCar.position )
PositionPrevious = at time (currentTime - 1) ( theCar.position )

travel = length (PositionNext - PositionCurrent)
travelPrev = length (PositionCurrent - PositionPrevious)

--ID = 1

if (travel <=0.1 ) then (ID = 2 ) -- standing still
--else (

else if ((travel / travelPrev) < braking) then ( ID = 2 ) -- braking
else( ID = 1 ) -- coasting

--)
Attachments
octane mix material.jpg
Post Reply

Return to “Autodesk 3Ds Max”