Question about Generic Properties
Moderators: jesterKing, stiv
Question about Generic Properties
Does anyone know would generic properties be implemented for all types? As I can see they are imlemented in current CVS only for MaterialType and TextureType...
I have played a bit with properties on materials but IMO coders are making things more complicated then it should be 
I don't understand why properties isn't a plain dict instead of struct. Please, don't catch on my mistakes in naming things, I will show you what I mean in eg.
This is current workflow:
There's nothing wrong with this workflow except that is not flexible, when you create 'some_name' property with a string in it, you cant assign any other type to 'some_name' except a string.
I think that this way could be much more flexible, that is if properties would be a plain dict:
And joining of two objects that are having the same 'some_name' property could create a new property, for instance called 'some_name-joined_object_name'.

I don't understand why properties isn't a plain dict instead of struct. Please, don't catch on my mistakes in naming things, I will show you what I mean in eg.
This is current workflow:
Code: Select all
ob = Blender.Object.GetSelected()[0] # Get object
ob.properties['some_name'] = 'this_is_a_string' # Create ID Property
print ob.properties['some_name'].data # Print 'some_name' property
this_is_a_string
I think that this way could be much more flexible, that is if properties would be a plain dict:
Code: Select all
ob = Blender.Object.GetSelected()[0] # Get object
ob.properties['some_name'] = 'this_is_a_string' # Create Property
print ob.properties # Print all properties
{'some_name':'this_is_a_string'}
print ob.properties['some_name'] # Print only 'some_name' property
this_is_a_string