Car brake lights for instances

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

Car brake lights for instances

Postby coilbook » Mon Jun 12, 2023 1:12 am

coilbook Mon Jun 12, 2023 1:12 am
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 53 times
car llights.jpg
Last edited by coilbook on Tue Jun 13, 2023 2:00 am, edited 2 times in total.
coilbook
Licensed Customer
Licensed Customer
 
Posts: 2985
Joined: Mon Mar 24, 2014 2:27 pm

Re: Car brake lights

Postby paride4331 » Mon Jun 12, 2023 8:45 am

paride4331 Mon Jun 12, 2023 8:45 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
User avatar
paride4331
Octane Guru
Octane Guru
 
Posts: 3689
Joined: Fri Sep 18, 2015 7:19 am

Re: Car brake lights

Postby coilbook » Tue Jun 13, 2023 1:54 am

coilbook Tue Jun 13, 2023 1:54 am
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
Licensed Customer
 
Posts: 2985
Joined: Mon Mar 24, 2014 2:27 pm

Re: Car brake lights for instances

Postby coilbook » Tue Jun 13, 2023 2:04 am

coilbook Tue Jun 13, 2023 2:04 am
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.
coilbook
Licensed Customer
Licensed Customer
 
Posts: 2985
Joined: Mon Mar 24, 2014 2:27 pm

Re: Car brake lights for instances

Postby neonZorglub » Tue Jun 13, 2023 10:44 pm

neonZorglub Tue Jun 13, 2023 10:44 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 48 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
neonZorglub
OctaneRender Team
OctaneRender Team
 
Posts: 899
Joined: Sun Jul 31, 2016 10:08 pm

Re: Car brake lights for instances

Postby coilbook » Wed Jun 14, 2023 1:58 am

coilbook Wed Jun 14, 2023 1:58 am
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.
coilbook
Licensed Customer
Licensed Customer
 
Posts: 2985
Joined: Mon Mar 24, 2014 2:27 pm

Re: Car brake lights for instances

Postby frankmci » Wed Jun 14, 2023 3:42 pm

frankmci Wed Jun 14, 2023 3:42 pm
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.
Technical Director - C4D, Maya, AE, - Washington DC
frankmci
Licensed Customer
Licensed Customer
 
Posts: 827
Joined: Fri May 26, 2017 2:00 pm

Re: Car brake lights for instances

Postby coilbook » Wed Jun 14, 2023 4:04 pm

coilbook Wed Jun 14, 2023 4:04 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.
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 16 guests

Sat Apr 27, 2024 10:30 pm [ UTC ]