Page 1 of 1

Car brake lights for instances

Posted: Mon Jun 12, 2023 1:12 am
by coilbook
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!

Re: Car brake lights

Posted: Mon Jun 12, 2023 8:45 am
by paride4331
Hi coilbook,
May it help you?
https://forums.autodesk.com/t5/3ds-max- ... -p/7904331
Regards
Paride

Re: Car brake lights

Posted: Tue Jun 13, 2023 1:54 am
by coilbook
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.

Re: Car brake lights for instances

Posted: Tue Jun 13, 2023 2:04 am
by coilbook
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.

Re: Car brake lights for instances

Posted: Tue Jun 13, 2023 10:44 pm
by neonZorglub
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

Re: Car brake lights for instances

Posted: Wed Jun 14, 2023 1:58 am
by coilbook
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.

Re: Car brake lights for instances

Posted: Wed Jun 14, 2023 3:42 pm
by frankmci
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.

Re: Car brake lights for instances

Posted: Wed Jun 14, 2023 4:04 pm
by coilbook
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.