some questions on the logic properties thing

Basicly I want to know everything there is to know about properties feature in the game logic panel. Unfortuneity im having troble finding information on it.

As I understand it, their variables that can be assigned to an object.

a few of the things im specificly wondering about:

  1. Can an object be exported with its properties so another program or script could read these variables? or are they just for blenders inturnal game engine?

  2. Are there limits to the string variable? (like lenth?, or can I put a whole text file in there?)

Thats all I can think of right now, but any information you can give me on this would be greatly appreciated.

  1. You can save properties using python.

  2. The string property in python is class based and meant to prevent buffer overflows, so you really can’t go over with it, python will just keep allotting memory for the larger size. It might slow down your program if you use a novel for string variable. Hmm, thinking further, the game engine is c++. Hopefully they used the string class.

Im sure I could do it in code, but i just wondering about this thing:
http://tinypic.com/27xjjac.jpg

That’s what fireside was talking about… in a roundabout way.

  1. I don’t know. I’ve never tried to export anything. I know special exporters like CrystalBlend have been developed in the past that probably have this functionality.

  2. I believe fireside was right with the first guess. I don’t know if you can enter a super long variable in the little box there, though, and I guess that’s what you want to know. The only solution I can offer is trial and error. I don’t know what you would do with a really long variable, though. There are limitations to the text display capabilities in Blender, and no wordwrap is one of them. You need a separate object for each line of text, which means a separate variable for each line.

Yeah, that property box is the same thing as an object string property if you get into the python controller. It should act in the same way. It would just be very hard to read a long string of text in that little box. There could be uses for using a long string property if you were only going to print a portion at a time. But python has much more convenient ways of breaking things up called lists. In fact, if your interested in strings in the least bit you should start looking at python tutorials if you don’t know it already. Python has all kinds of ways of manipulating string variables, and the scripts are a much better place to hold and view the strings if they are long. If they’re short, then the property boxes are great.

I was thinking of playing around with python, I guess I got another reason to now. As for the string thing, its no big deal, I was just wondering if it was limited to just 255 chareters or somthing like that.

Maybe I should give some insight on what im doing:

I’m working on a little proof of concept thing; what I intend to do is create several object files, each one containing the 3d data, animation data, material data, etc., but also variables and string data (which could simply be put in a txt file and somehow packaged with the object) that would contain various bits of information on the object (description, attributes, etc…).

The (hopefully) end result would be an encapsulated file that can be called upon by an external program.
For example:

[pseudo code]

Display ObjectSpamAndEggs/mesh/frame01

$string = ObjectSpamAndEggs/Attributes/line04 (if using a txt file)

Print $string

[/pseudo code]

The output (assuming your using something that can render 3d objects) would be the frame 1 of a lovely plate of spam and eggs and whatever txt is on line 4 of the txt file.

I was just sort of wondering if I used the properties thing I could have all the Attributes already intagrated with the object file.

Well, python would be a great help there. It can save object properties in binary format by what they call pickling. You can get an objects property list with dir(), at least I think that’s it. If mesh is listed in it, it could save that. There might be a problem with actually creating the object, though. That’s what it would be like. add object really doesn’t do that, it just adds a copy of an object from another layer. I don’t think there’s actually a function for creating an object in a scene. You might could leave a bunch of empties on another layer and use change mesh, but I don’t think it works well if there are armatures involved.

Does someone know about dir(). Did I just imagine that? I know I’ve heard people talking about it, but I can’t find any information on it.

edit: Oh, it’s python. It gives available functions and properties, so it might not be all that useful.

Python got the List and dictionary thing, that would probley work. I wonder if it fill the dictionary entries form a text file?

anyway thanks for the info