| View previous topic :: View next topic |
| Author |
Message |
Ladyquestio
Joined: 28 Oct 2007 Posts: 398 Location: USA - FL
|
Posted: Sat Mar 10, 2012 1:03 pm Post subject: trigger a change in color in a mesh |
|
|
I have seen meshes that by use to triggers can change colors.. I would like to know how to do it.
here is basically what I am trying to do
Trigger from this
trigger (yellow#) changes to yellow
trigger (red#) changes to red
now how do I do it?
trigger (Blue#) changes to blue
trigger (green#) changes to green
 _________________
  |
|
| Back to top |
|
 |
Pharmacist
Joined: 20 Oct 2007 Posts: 652 Location: USA
|
Posted: Sat Mar 10, 2012 3:17 pm Post subject: |
|
|
I want to know about it as well. I understand it can be done by either morph or skeletal animation. Morph will cause a bigger file size. I tried the skeletal a while ago but I could not get the result I want.
I tried on simple thing like a hair bow. I wish someone could explain it more. _________________
 |
|
| Back to top |
|
 |
nerseus
Joined: 27 Mar 2007 Posts: 1649 Location: USA - AZ
|
Posted: Sat Mar 10, 2012 9:46 pm Post subject: |
|
|
The only things that control color in a mesh are: the bitmap texture, vertex lighting, any room or furniture lights.
As far as I know, you can't animate textures on a trigger at all. If you just wanted an area that changes color at regular intervals, you might get by with an animated texture (cycling). But as for a trigger based change? I don't think it's possible.
Vertex lighting is similar, but worse. It's baked into a mesh and can affect the overall color when combined with a texture - but you can't animate this in any way, that I know of.
A room's lights can be animated as-of a few months ago. It would be possible, it seems, to add two lights that would swap places at a regular interval or by trigger word. But a light would affect all nearby polygons - not just those along a strip as shown in the example.
That leaves creative ideas, which WILL work, but will increase the size of your mesh/animations. The easiest method is to just "swap out" a mesh during an animation (an idle animation or one by trigger). The idea is to have duplicate polygons and two nodes in your skeleton. One of the copies is weighted to node1 while the other copy is weighted to node2. One copy is in the right spot while the other mesh and node is WAY out of view (I use Z-coordinate of 999999). Create two, 2 frame animations - one that leaves node1 in view and node2 WAY out of view, and a 2nd animation with node1 WAY out of view and node2 in view. As each animation plays, it will jump one mesh way off screen and leave the other one in its place. Assuming you assign separate textures to each mesh, you can effectively change the color. You could conceivably have 3, 4, or even 10 different colors - but each additional color means a copy of the mesh, more animations for swapping things out and additional textures in the final product. I made the "PhotoDOCtor" thingy using this concept. It allows for a lot of textures on varying backgrounds and frames and other simple planes - the effect works perfectly, making it seem like you're swapping out textures. But the filesize... it can add up fast!
-ner |
|
| Back to top |
|
 |
Pharmacist
Joined: 20 Oct 2007 Posts: 652 Location: USA
|
Posted: Sun Mar 11, 2012 12:24 am Post subject: |
|
|
| nerseus wrote: | | The easiest method is to just "swap out" a mesh during an animation (an idle animation or one by trigger). The idea is to have duplicate polygons and two nodes in your skeleton. One of the copies is weighted to node1 while the other copy is weighted to node2. One copy is in the right spot while the other mesh and node is WAY out of view (I use Z-coordinate of 999999). Create two, 2 frame animations - one that leaves node1 in view and node2 WAY out of view, and a 2nd animation with node1 WAY out of view and node2 in view. As each animation plays, it will jump one mesh way off screen and leave the other one in its place. Assuming you assign separate textures to each mesh, you can effectively change the color. You could conceivably have 3, 4, or even 10 different colors - but each additional color means a copy of the mesh, more animations for swapping things out and additional textures in the final product. |
This is what I tried to do. But it did not work. May be I got confused in the middle because I wanted 10 different colors to be added. I will give it another try some time.
Thanks! _________________
 |
|
| Back to top |
|
 |
twistednanny 
Joined: 29 Sep 2007 Posts: 2690
|
Posted: Sun Mar 11, 2012 9:40 am Post subject: |
|
|
Yes, you can make meshes with triggers that will change color of it by morph animation ~ here you actually have as many number of identical mesh/morph targets of how many colors you want it to change to, each having different material ID and texture as needed.
There was a thread that some one asked about hot to have multiple morph targets, and when triggered it reset and put on another one I don't remember where it is now. The key to it is 'Zero Morph' (it's a term I came up with). When you do a 2 color swop it is a simple and straight forward thing ~ have parent mesh in one color, morph target in different color, then it is a simple 2 frames animation turning morph target to 100% and to 0% to reset (hence Zero Morph). It gets a bit complicated when you want to make the mesh with more than 2 color transformation but it can be done in 2 ways; one the straight forward way which results in huge file sizes if you want so many colors to be changed to; and 2 with minimal file size in KB if you know how to hand rig an XMF file, and XPF file.
Edited to add:
I just looked at OP's question in more details and so if you only want to change the 'trims' of a wall into different color you can do them in like 'flip box' thing and animate them with rotating node, it serves the purpose but not as neat as morphing though. _________________
 |
|
| Back to top |
|
 |
Keef 
Joined: 22 May 2005 Posts: 6603 Location: USA - CA
|
Posted: Sun Mar 11, 2012 7:26 pm Post subject: |
|
|
For trigger color changes I do the swapping out of mesh parts using node animations. . I fly the unused bits out of camera range. _________________ Showroom Public Room! Click Banner for Tutorials!
 |
|
| Back to top |
|
 |
Ladyquestio
Joined: 28 Oct 2007 Posts: 398 Location: USA - FL
|
Posted: Mon Mar 12, 2012 11:53 am Post subject: |
|
|
Ok here is the big problem.. I am using Sketchup.. and the animator that Hellstrong made while it will move a mesh does not provide for multiple meshes to go 2 different directions at the same time.
his version 1 which still work, allows 1 per mesh
so now what.. I don't have max,, and never really learned blender.. _________________
  |
|
| Back to top |
|
 |
jazzKat
Joined: 20 Sep 2005 Posts: 1589 Location: United Kingdom
|
Posted: Mon Mar 12, 2012 1:35 pm Post subject: |
|
|
When you start getting into this complex stuff you're really only left with the options to use Max because of general compatibility issues; using Blender wouldn't help in this instance. _________________
 |
|
| Back to top |
|
 |
EbonyBlake 
Joined: 18 Aug 2010 Posts: 112 Location: Germany
|
Posted: Tue Mar 13, 2012 4:30 am Post subject: |
|
|
It is relative easy to produce such effect with a morphing animation using Sketchup and the MACE tool.
You have to make a separate mesh for the color changing element and not just one but 2 for any color. Why 2? One for the "normal" position of this element and another one for the "hidden" position - moved away and probably downsized so that it is not being shown while another colored element takes it's place.
From each pair of meshes using the same color - normal and hidden one - you have to create a morph mesh with MACE tool using .Exclusive morphs. For example RedShown.Exclusive and RedHidden.Exclusive.
And now the mean part:
You have to write an animation file MANUALLY - combined one for several morph meshes.
You have to perform the Show animation for the desired color and in the same time - the Hide animations for all another colors.
Such Animation script you have to write for any color.
In CM you load your main mesh without color changing element and all morph meshes for colored part and arrange animations for them. _________________
 |
|
| Back to top |
|
 |
nerseus
Joined: 27 Mar 2007 Posts: 1649 Location: USA - AZ
|
Posted: Tue Mar 13, 2012 8:15 am Post subject: |
|
|
You can edit the XAF (node/skeleton) animations by hand as well. Actually... one of my first meshes was a set of simple planes that would swap out - a "background switcher" - and all went well in Max. I then tried making it with 4 backgrounds, each swapping out... but couldn't get it working in Max; it was just beyond what I knew at the time. But - modifying the XAF files completely by hand in Notepad was easy breezy lemon squeezy and much less error prone and more efficient than trying to set everything up right in max and then exporting.
-ner |
|
| Back to top |
|
 |
Ladyquestio
Joined: 28 Oct 2007 Posts: 398 Location: USA - FL
|
Posted: Tue Mar 13, 2012 10:38 am Post subject: |
|
|
| ErikaBlake wrote: | It is relative easy to produce such effect with a morphing animation using Sketchup and the MACE tool.
You have to make a separate mesh for the color changing element and not just one but 2 for any color. Why 2? One for the "normal" position of this element and another one for the "hidden" position - moved away and probably downsized so that it is not being shown while another colored element takes it's place.
From each pair of meshes using the same color - normal and hidden one - you have to create a morph mesh with MACE tool using .Exclusive morphs. For example RedShown.Exclusive and RedHidden.Exclusive.
|
OK where might I find this tool?
modifying an XAf is not all that hard.. just knowing start and finish locations and time to it .. but morphing is something I have never tried.
XAF example like this example is 1 second long going from 0 0 0 to 44.450000 -116.976367 3034.377130
<HEADER MAGIC="XAF" VERSION="919" />
<ANIMATION NUMTRACKS="1" DURATION="1">
<TRACK BONEID="1" TRANSLATIONREQUIRED="1" TRANSLATIONISDYNAMIC="0" HIGHRANGEREQUIRED="1" NUMKEYFRAMES="2">
<KEYFRAME TIME="0">
<TRANSLATION>-0.000000 -0.000000 -0.000000</TRANSLATION>
<ROTATION>0.000000 0.000000 0.000000 -1.000000</ROTATION>
</KEYFRAME>
<KEYFRAME TIME="1">
<TRANSLATION>44.450000 -116.976367 3034.377130</TRANSLATION>
<ROTATION>0.000000 0.000000 0.000000 -1.000000</ROTATION>
</KEYFRAME>
</TRACK>
</ANIMATION> _________________
  |
|
| Back to top |
|
 |
EbonyBlake 
Joined: 18 Aug 2010 Posts: 112 Location: Germany
|
Posted: Wed Mar 14, 2012 1:33 am Post subject: |
|
|
M.A.C.E. - tool is a one of wonderfull Flash-tools, written by Deliverance.
It let you to merge 2 or more static meshes into one morph mesh.
Since it is not a sceletal but a morhing animation you have to edit not a XAF but a XPF file. It is really easy. The main idea is to combine stances from more then one morph mesh into one XPF file.
For example, here you may see an XPF file to perform an open animation for a curtain.
As you see, there are meshes for left and rignt half of curtain, a separate mesh for each half, are being controlled with just one animation script:
<HEADER MAGIC="XPF" VERSION="919" />
<ANIMATION NUMTRACKS="2" DURATION="3">
<TRACK NUMKEYFRAMES="2" MORPHNAME="Curtain-L-2.Exclusive">
<KEYFRAME TIME="0">
<WEIGHT>0</WEIGHT>
</KEYFRAME>
<KEYFRAME TIME="3">
<WEIGHT>1</WEIGHT>
</KEYFRAME>
</TRACK>
<TRACK NUMKEYFRAMES="2" MORPHNAME="Curtain-R-2.Exclusive">
<KEYFRAME TIME="0">
<WEIGHT>0</WEIGHT>
</KEYFRAME>
<KEYFRAME TIME="3">
<WEIGHT>1</WEIGHT>
</KEYFRAME>
</TRACK>
</ANIMATION> _________________
 |
|
| Back to top |
|
 |
xJonnx
Joined: 07 Feb 2007 Posts: 1578 Location: USA - PA
|
Posted: Wed Mar 14, 2012 5:50 am Post subject: |
|
|
The MACE tool is great! I have used it several times. One thing to know about it, and I have talked to Deliverance about it. Using existing exporters for Blender and SketchUp, they do not always export vertices in exactly the same order. If that happens, MACE will not work. You just need to keep exporting your 2 meshes until you get lucky and they match up. Remember, probably 98% of the time they do export correctly, but do not blame the tool if it does not always work. _________________
 |
|
| Back to top |
|
 |
Ladyquestio
Joined: 28 Oct 2007 Posts: 398 Location: USA - FL
|
Posted: Wed Mar 14, 2012 11:14 am Post subject: |
|
|
so I make mesh01 but blank texture mesh02 with texture offset and possibly reduced in size mix in mace and edit there to get the animation files needed correct? and do this for all the textures I need to switch out. _________________
  |
|
| Back to top |
|
 |
EbonyBlake 
Joined: 18 Aug 2010 Posts: 112 Location: Germany
|
Posted: Wed Mar 14, 2012 11:38 am Post subject: |
|
|
Yep, somewhere in this direction. _________________
 |
|
| Back to top |
|
 |
|