Notifications
Clear all

[Closed] getPropNames

yeah, it’s was tested in max 2010 and box objects don’t have iparamblock2 so don’t support
iparamblock2* Animatable::GetParamBlock(int i)

I certainly don’t remember how many paramblocks the box object has in 2010, but I think more than one. Doesn’t a paramblock in 2010 have a getparamblock method by index?

it’s a simpleobject with just one

class SimpleObject : public GeomObject {
	public:
		IParamBlock *pblock;

Solved one of the quanderies… the conversion to #name throws up some interesting results. illustrated by…

"ABC" as name
"mapCoords" as name 

if the name is already in the hash table it uses that existing value hence the decapitalization on only some of the properties when using getpropnames on objects using IParamBlock2

I decided on a hard coded lookup map initialized by some xml for any primitives not IParamBlock2 enabled

I never had any problems with IParamBlock2… but you’ve asked about IParamBlock

it’s not an issue with IParamBlock2 per se…

p = plane()
getpropnames p

produces the out put

#(...... #renderScale, #mapcoords, .....)

but the actual names are…
“renderScale” and “mapCoords”

it’s the conversion from string to name throwing up a few oddities

this is why I do lowercase comparing for all names

I think the conversion to name does the same when it searches the hashtable to see if the name is already registered hence it throwing up the lower case version

It throws not a low case but the first put in hashtable.
Using hashed names instead of string helps to save maxscript memory. Similar hashtable also is used for global, function and structure names…

Technically you could go in there and fix your favorite name to your preferred spelling, like “mApcOOrds”

it quite interesting that getpropnames (get & set properties) goes through ClassDesc (via DllDir) not the node (other than providing the class id’s) when dealing with pb2 based objects.

I decided going via names was too much of a ball ache when just using id’s was much less painful

Page 2 / 2