[Closed] (Rhetorical question) is it possible to define structure inside structure
Yes, you can.
struct info_struct
(
struct obj_info(obj_name, obj_transform)
new_var = "Variable"
fn get_info obj =
(
obj_data = obj_info obj.name obj.transform
)
)
-- get the info on an object in the scene named "box01"
object_info = main_struct.get_info $box01
I don’t think it will work. Also nested structures is not what max would support accoring to me…
Can you make some structs via dot net when making a class library and pass data from max to the structs?
I have not used .NET much…
slow down… stop idolize .net
we are talking about maxscript.
do we always have to trust what Autodesk says?
Umm…I think we should sometimes when we get errors…
Probably you can refer to making nested structs in c++, which I do generally.
http://www.cplusplus.com/doc/tutorial/structures/
Is there any other solution?
I tried making structs and passing them to other structs, but the data type in struct is just a data.
if i do this:
global inner_Struct
struct inner_Struct (param1, param2)
struct outerStruct(inner_Struct, age, sex, location)
even if inner_Struct is a global variable, max takes it to be another parameter not a struct!!!
I don’t have max at home – but I would think this should work…
-- struct def'ntions
struct a ( aVar = "someinfo" )
struct b ( bVar = undefined )
-- instantiate struct a
aStruct = a()
-- instantiate struct b with struct a as a parameter.
bStruct = b aStruct
print (bStruct.aStruct.aVar)
this is not a definition. it’s the same as create a structure outside. the right definition is when all members of structure A can see and use structure C.