[Bf-committers] New feature: Console output space type (requestfor input).

Jacques Beaurain jacques.beaurain at gmail.com
Fri Apr 21 12:58:26 CEST 2006


Hi again,

All this talk gave me a couple of ideas. First of I finished working
candidate for both Windows and Linux a.t.m (I assume Mac and others
should just work because I am using normal POSIX calls to do the
redirection if the WIN32 defines are not set). Currently the following
is implemented:

1. Command line option -c to disable the redirection and print
everything to the console as before.
2. When -b is used the -c is implied. This should keep the existing
programs that rely on this flag working as normal.
3. On Windows a console will be shown when -c is used, otherwise the
console will be released (if you are already in a console it regains
user input, otherwise a console flashes briefly and then goes away).

Question; I suppose the window space will need to become completely
hidden in this case, that may not be trivial. Although if I manage to
make the output go both to the console and this window and implement
some of the stuff I'll discuss below this window may still have
use....

Now for the ideas I had. If we decide on a simple XML syntax message
format we could use this enhance this system considerably. We can
either continue to use printf calls or make a new Blender API call to
do this. I would propose we continue to use the printf's; for one it
save having to update a lot of code and it ports easier into different
areas (libraries that use  blender or libraries that gets used by
blender may send messages in this way). Here is a some examples:

1. Python output gets encapsulated by <python>text goes here</python>
before it gets sent to the window. This is trivial as I already
capture the writes completely from python in internal functions.
2. stderr messages will be encapsulated by <error>text goes
here</error>. So messages like this may result from Python scripts:
<error><python>text goes here</error></python>
2. Debug messages gets encapsulated in <debug>text goes here</debug>.
3. Existing code that has not been updated with tags will be assumed
as <info>text goes here</info>
4. We can make N other tags like these.
5. Using the XML syntax it may be possible to encapsulate data into
the strings too in the future and serialize/deserialize it easily.
6. The Console Output (Is this a good name?) window is then able to
parse and filter these in interesting ways to give rich output to the
user.

Hope this makes sense, what do you think?

I will try and get some builds and an updated patch up for download,
but may not get a chance until tomorrow.

Cheers,
Jacques


More information about the Bf-committers mailing list