johnatm / itween

Automatically exported from code.google.com/p/itween
1 stars 2 forks source link

using iTween ColorTo on an object without color will yield to *error* #130

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. apply iTween.ColorTo on an object without a property color

What is the expected output? What do you see instead?
It gives an error. Using iTween on many on the fly loaded objects, this can 
easily happen. So I would expect it to not lock my whole application just for 
this - so just a warning would be appropriate enough.

What version of the product are you using? On what operating system?
2.0.46 on Windows 7 / Mac OS X Lion.

Original issue reported on code.google.com by caue.rego on 13 Aug 2013 at 9:35

GoogleCodeExporter commented 8 years ago
This is how I've solved it...

Replace lines 3338 and 3339 for this whole chunk:
                if (renderer.materials[i].HasProperty("_Color")) {
                    colors[i,0]=renderer.materials[i].GetColor(namedcolorvalue.ToString());
                    colors[i,1]=renderer.materials[i].GetColor(namedcolorvalue.ToString());
                } else {
                    Debug.LogWarning("iTween Warning: At least one material has no property _Color.");
                }

Original comment by caue.rego on 13 Aug 2013 at 9:36

GoogleCodeExporter commented 8 years ago
Just for the record, the replaced lines (3338 and 3339) were these:
                colors[i,0]=renderer.materials[i].GetColor(namedcolorvalue.ToString());
                colors[i,1]=renderer.materials[i].GetColor(namedcolorvalue.ToString());

Original comment by caue.rego on 13 Aug 2013 at 9:38