Can soembody point out to me the difference between -attributeType and -dataType? When do we use either of them? For example, float2 and float3 is found in both dataType and attributeType list, but float can only be found in attributeType list. Furthermore, what is the difference between a vector and float3? It seems that they are the same, so why 2 names?
In the documentation, why is the types for attributeType listed undet setAttr and dataType under setAttr?
and attribute type can be compound, list or whatever, then the data type is the type of data contained in that data structure. like compound is a parent attribute, and then a bunch of children - but the children can be floats, or strings, or whatever...
Yeh, my memory's a little fuzzy too, but here goes:
float2 and float3 represent precision... the "2" and "3" I "believe" have some relationship to the number of places after the decmal it counts precision too. Note that floats are single numbers. I could be off here. Ask your local programmer, they usually know : )
Vectors are a collection of three floats. Similar to an array of three floats, but Maya likes to deal with vectors in special ways, so they gave them a special name. It's a little silly to me to split them up like that though.
Hi Warpcat, according to my understanding, float2 and float3 just means 2 and 3 float values respectively, and nothing got to do with precision.
But I am still trying to understand the list of attributes present/not present in the addAttr command entry in the MEL command Reference of the Online Documentation.
I tried to add a new attribute in Attribute Editor using Attributes > Add Attributes... :
In the UI, these are my options=> Attribute Name: test Data Type: Vector Attribute Type: Scalar
And this is what I got in the script editor: addAttr -ln test -at double3 |obj; addAttr -ln testX -at double -p test |obj; addAttr -ln testY -at double -p test ||obj; addAttr -ln testZ -at double -p test |obj;
Furthermore, in the Online Documentation, under MEL Command Reference. In the page for addAttr, there is no dataType/attributeType "vector". But there is double3.
So can I conclude that vector IS double3?
Next, I tried adding a "data type: float" IN THE UI, and in the script editor, a "-attributeType double" is displayed.
So any "float" value in the UI is a "double" value in MEL? What's the difference between double and float?
Looking at the attribute list under the addAttr command entry, there are some types that are either -dataType or -attributeType or both. I guess what I can do now is to take it as it is. But an explanation for the need to separate between an attributeType and a dataType is most definitely appreciated.
ool rite this is my swat at the thing, double3 is a vector for all purposes of the word. The only difference is that for nodes you need three inputs to represent the vector so you use 3 double containers to expose the vector to the user. Also its not called directly a vector because it can be used to describe arbitrary date that has nothing to do with vectors (such as color, sure you could use vector ops on them but ists still not realy a vector), and its just to signify that its just three compound containers. You vcould make different kinds of compound things too, suca a a double double and int, if you like. So since they have decided that theres only teh base types and compound types they choose to caal a vector container a double3 to say that yes now we have 3 things that are marked as compound and it has theese containers.
Why double instead of float, now mind you they are the same thing as a mel float wich is a double precicion float. But we are talking of slightly different things here, the node structure inst mel, its reflects how the nodes work. I guess they wanted to accentuate that we are indeed talking of double precicion floating point numbers here.
Since tehcnicaly one could make a node that uses single precision floats, alotough i do believe it is not possible to elemantary do so trough the api even. Because the containers themselves are owned by maya.
To conclude a vector stored inside a node uses a double3 type atribute, or in other words a compound atribute that has 3 doubles in it. And yes its a vector for most part but as said it can be anything realy, its just a container.
BUt that concludes the trip into semantics it doesent realy matter at all. Stop confusing yourself.