Object speed changes mix material value OR material ID

Forums: 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 viewforum.php?f=18

Object speed changes mix material value OR material ID

Postby coilbook » Tue Apr 03, 2018 7:38 pm

coilbook Tue Apr 03, 2018 7:38 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 115 times
car stop go brake lights.jpg
brake lights (2).zip
(35.67 KiB) Downloaded 123 times
coilbook
Licensed Customer
Licensed Customer
 
Posts: 2985
Joined: Mon Mar 24, 2014 2:27 pm

Re: Object speed changes mix material value OR material ID

Postby coilbook » Tue Apr 03, 2018 8:05 pm

coilbook Tue Apr 03, 2018 8:05 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
coilbook
Licensed Customer
Licensed Customer
 
Posts: 2985
Joined: Mon Mar 24, 2014 2:27 pm

Return to Autodesk 3Ds Max


Who is online

Users browsing this forum: No registered users and 22 guests

Wed Apr 24, 2024 7:21 pm [ UTC ]