Notifications
Clear all

[Closed] different self Illum. value for each object, but all same material

I would like to achieve the effect of these glowing squares ind the meteor sony commerial.
www.piranhabar.ie
sorry, couldn’t link directly to the video.

I tought about for loop to meditmaterial[]…but as the material is the same for every object i don’t think that it will work. it will then change it for every object,right?
so do i have to create for each object a separate material with the same settings except the self illumination value?
is it possible to create any count of materials?

7 Replies

I would create 10 separate materials, and assign them self-illuminated values from 0 to 100 in increments of 10, then randomly apply a different material to each of the objects in the scene each keyframe, or better yet, have each of them fade down to the material with 0 self-illumination and loop like that.

Just some thoughts,
Colin

lol…yea, this makes more sense than doing tousends of materials

the one wirh the fading seems little to hard for me

thanx for your help, I’ll try randomly apply one of these mats to the each objects first

absolutely!
For the fading part have your script create the materials in the medit slots 1-10. Alternatively you could just create an array of materials instead of using the materialeditor slots.

I don’t think you can animate the materials changing, but you can animate the materialID for each object changing, so that’s what we’ll do


-- create a new multiSubMaterial to hold each of our self-illuminated materials
mSubMat = multiSubMaterial numsubs:11 name:"ArrayOfSelfIllumMaterials"

-- loop through each sub-Material and create a new Standard Material
for i = 1 to 11 do 
	mSubMat.materialList[i] = standardMaterial name:(i as string) selfIllumAmount:((i-1)*10)

-- put the multiSubMaterial in the first slot of your material editor so you can see what's going on
meditMaterials[1] = mSubMat

-- This code deletes any boxes we had previously created by running the code multiple times
if boxes != undefined then ( 
	for b in boxes do 
		if isValidNode b then delete b
)

-- Creates 10 new boxes, and assigns them the multiSubMaterial we created
boxes = for i = 1 to 10 collect box name:(i as string) pos:[i*35,0,0] material:mSubMat 

-- now we add the "Material" Modifier to each of the boxes, this is what we will key
for b in boxes do
	addModifier b (Materialmodifier ())

-- Turn on keyframing
with animate on (
	tStart = 0	-- start keyframing at this frame
	tEnd = 100	-- stop keyframing here
	changeInterval = 5	-- how often the boxes change keyframes

	for t in tStart to tEnd by changeInterval do (
		for b in boxes do (
			at time t b.modifiers[#Material].materialID = (random 1 mSubMat.numSubs) 
		)
	)
)

You can take it the step farther by checking to see what # sub is assigned the each object and then just assigning the #-1 and looping back!

Hope this was helpful,
Colin

nice!!
I did a little bit a different setup.

I did it first with the ten materials as you sugessted and animated the self illumination by script.I didnt find a way to write it as function, and run that function every frame.
as there were only 10 materials, it was some kind of wavy movement, because to many squares changed same.

now i applyed to every square a own mat, and copied to all of them the same diffuse map, and animated the self illumination per particle:

 oArray = $object* as array 

for o = 1 to oArray.count do
	 (
	 oArray[o].material = standard()
	 oArray[o].material.diffusemap = $box01.material.diffusemap
	 oArray[o].material.faceMap = true
	 ) 
animate on
	 for t in 0 to 200 by 10 do
		  at time t
			   for i = 1 to oArray.count do
					(
						 oArray[i].material.selfillumamount = random 5 100
					)

its ok, but there is still less controle.

the result:
www.megalomania.ch/capitanred/movies/led.wmv

there is still less controle ove the whole thing.
would be nice to add some lines going over the whole thing

Looks great!

Grats

I tried to do this in a less manual way, I made a grid of planes, assigned a single material (self illumination set to 100) to them, and then ran the following 3 line script on the selected planes.

for obj in selection do
(
	obj.Visibility = Noise_Float ()
	obj.Visibility.controller = Noise_Float seed:(random 0 64000) frequency:(random 0.09 0.05) fractal:false noise_strength:1.0 positive:true
)

It’s not perfect, but with tweaking could probably get you there.

This was a fun distraction

 rdg

just for completeness:

you could also add a script_controller that randomized a vertexcolor chanell based on grid faces and have material that reads this channel as selfillumin map.

blues decoupling from materials by using the visibility controller is cooler.

Georg