Car brake lights for instances

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

Hi Paride,

Do you have any idea how to do this?

We have a lot of cars copied as INSTANCE all using the same texture. For the brake lights it is a mix texture for ON and OFF brake lights.

Is there any way for the Amount to use some kind of trick or script when the mesh (car) moves it's brake lights switch to OFF when stops turn to ON. The problem is all cars must be instance and one texture so the system must apply OFF to only moving cars. And on to stationary.
I attached a small scene


PS I know there is a script that changes material ID from 1 to 2 depending if car moves or not. But we cannot sue it with city traffic 2

Thank you!
Attachments
car brake lights.zip
(71.78 KiB) Downloaded 85 times
car llights.jpg
Last edited by coilbook on Tue Jun 13, 2023 2:00 am, edited 2 times in total.
User avatar
paride4331
Octane Guru
Posts: 3813
Joined: Fri Sep 18, 2015 7:19 am

Hi coilbook,
May it help you?
https://forums.autodesk.com/t5/3ds-max- ... -p/7904331
Regards
Paride
2 x Evga Titan X Hybrid / 3 x Evga RTX 2070 super Hybrid
coilbook
Licensed Customer
Posts: 3032
Joined: Mon Mar 24, 2014 2:27 pm

paride4331 wrote:Hi coilbook,
May it help you?
https://forums.autodesk.com/t5/3ds-max- ... -p/7904331
Regards
Paride
Thanks Paride.

That was actually our post. That script changes material id from 1 to 2 if mesh moves (it is good for one car but not for the whole city full of cars).
I wondered if this can be done on a texture level and as an instance since octane can do random texture on instances. I guess there is no way.
coilbook
Licensed Customer
Posts: 3032
Joined: Mon Mar 24, 2014 2:27 pm

I wonder if wire parameter dialog can be used. I tried with connect position and amount change but it changes lights on all instances and not to just moving ones.
neonZorglub
OctaneRender Team
Posts: 1017
Joined: Sun Jul 31, 2016 10:08 pm

coilbook wrote:I wonder if wire parameter dialog can be used. I tried with connect position and amount change but it changes lights on all instances and not to just moving ones.
Hi coilbook,

You can use the Instance ID, that is set individually for each node.
Use an 'Instance range' texture, to have black or white color depending of Instance ID = 0 or 1
(set 'Maximum ID' to 1)
Then, you can use this Instance range in the Amount of a Mix material

Here is your sample updated this way:
car brake lights_instID02.zip
(73.2 KiB) Downloaded 82 times
Using Octane Object properties, select Box002, and set the Instance ID to 1 to use the light ON material, and 0 for light OFF

There is currently an issue with the update, so you need a work around to force a geometry update:
-rebuild the scene after changing several IDs
or
-disable Movable proxy, and enable it again.


Using maxScript, you can do the same:

setUserProp $Box002 "octane_instance_ID" "1"
or
setUserProp $Box002 "octane_instance_ID" "0"

then
actionMan.executeAction 982383860 "6551" -- Octane: Rebuild Scene

( the workaround of changing the movable proxy doesn't work with maxscript . eg setUserProp $Box002 "octane_movable_proxy" False, then True)

I hope it helps.
I'll try to fix the instance ID update issue for the next release.

Thanks
coilbook
Licensed Customer
Posts: 3032
Joined: Mon Mar 24, 2014 2:27 pm

neonZorglub wrote:
coilbook wrote:I wonder if wire parameter dialog can be used. I tried with connect position and amount change but it changes lights on all instances and not to just moving ones.
Hi coilbook,

You can use the Instance ID, that is set individually for each node.
Use an 'Instance range' texture, to have black or white color depending of Instance ID = 0 or 1
(set 'Maximum ID' to 1)
Then, you can use this Instance range in the Amount of a Mix material

Here is your sample updated this way:
car brake lights_instID02.zip
Using Octane Object properties, select Box002, and set the Instance ID to 1 to use the light ON material, and 0 for light OFF

There is currently an issue with the update, so you need a work around to force a geometry update:
-rebuild the scene after changing several IDs
or
-disable Movable proxy, and enable it again.


Using maxScript, you can do the same:

setUserProp $Box002 "octane_instance_ID" "1"
or
setUserProp $Box002 "octane_instance_ID" "0"

then
actionMan.executeAction 982383860 "6551" -- Octane: Rebuild Scene

( the workaround of changing the movable proxy doesn't work with maxscript . eg setUserProp $Box002 "octane_movable_proxy" False, then True)

I hope it helps.
I'll try to fix the instance ID update issue for the next release.

Thanks
Thank you! Unfortunately I checked your scene and all lights are always off even after refreshing etc. In my case these cars randomly go and randomly stop so I cannot make a certain car as "Using Octane Object properties, select Box002, and set the Instance ID to 1 to use the light ON material, and 0 for light OFF" because later in another simulation it might go instead of being stationary.
frankmci
Licensed Customer
Posts: 917
Joined: Fri May 26, 2017 2:00 pm
Location: Washington DC

coilbook wrote: Thank you! Unfortunately I checked your scene and all lights are always off even after refreshing etc. In my case these cars randomly go and randomly stop so I cannot make a certain car as "Using Octane Object properties, select Box002, and set the Instance ID to 1 to use the light ON material, and 0 for light OFF" because later in another simulation it might go instead of being stationary.
This is only a half formed idea off the top of my head, but what if the lights on the cars are actually a separate particle system that uses motion info to drive visibility/texture state? The cars themselves are still instances, so you get all the render benefits from that, but each light or set of lights has a unique particle ID and can behave independently. I'm not a 3DS Max user, so exactly how you get the light particles to coordinate their translation and orientation relative to the vehicle instances is outside my experience.
Animation Technical Director - Washington DC
coilbook
Licensed Customer
Posts: 3032
Joined: Mon Mar 24, 2014 2:27 pm

frankmci wrote:
coilbook wrote: Thank you! Unfortunately I checked your scene and all lights are always off even after refreshing etc. In my case these cars randomly go and randomly stop so I cannot make a certain car as "Using Octane Object properties, select Box002, and set the Instance ID to 1 to use the light ON material, and 0 for light OFF" because later in another simulation it might go instead of being stationary.
This is only a half formed idea off the top of my head, but what if the lights on the cars are actually a separate particle system that uses motion info to drive visibility/texture state? The cars themselves are still instances, so you get all the render benefits from that, but each light or set of lights has a unique particle ID and can behave independently. I'm not a 3DS Max user, so exactly how you get the light particles to coordinate their translation and orientation relative to the vehicle instances is outside my experience.
Thank you! That is a great idea. i will try tyflow. When using city traffic 2 plug in you can only have 5 objects: car body and 4 wheels. So i will try to attach particles to a certain material ID.
Post Reply

Return to “Autodesk 3Ds Max”