Povray export

Hi,

First, congrats Marcus for the vastly improved povray export.

A few observations:

  1. the default filename for me was /home/.png. First, I’d suggest
    replacing “.png” by “example.png” or something like that; Second, it
    doesn’t really make sense to default to /home, I’d suggest $HOME
    instead.
  2. I selected mistakenly /home/a.png, of course I don’t have write
    access to /home, so the file couldn’t be created. Avogadro didn’t
    catch that error, instead the povray run failed silently, the console
    output showed that it couldn’t find the input file.
  3. The first time I ran pov-ray export, the “Command” field was left
    blank. It was only filled the second time after I selected a valid path.

Cheers,
Benoit


This message was sent using IMP, the Internet Messaging Program.

On Sunday 23 November 2008 11:40:57 jacob@math.jussieu.fr wrote:

Hi,

First, congrats Marcus for the vastly improved povray export.

A few observations:

  1. the default filename for me was /home/.png. First, I’d suggest
    replacing “.png” by “example.png” or something like that; Second, it
    doesn’t really make sense to default to /home, I’d suggest $HOME
    instead.

The default is actually taken from the molecule filename. I should try and set
up a reasonable default for the molecule filename and that will then propagate
through to everything else. I will take a look through the Qt documentation to
see if there is a sane way of finding the home directory - I am sure there
must be.

This is a really new feature that feeds through into several other things.

  1. I selected mistakenly /home/a.png, of course I don’t have write
    access to /home, so the file couldn’t be created. Avogadro didn’t
    catch that error, instead the povray run failed silently, the console
    output showed that it couldn’t find the input file.

I am having trouble here trapping any of the output from POV-Ray and so cannot
do any error detection. Most other command line programs I get output from,
but POV-Ray seems to do a great job of sending it elsewhere.

  1. The first time I ran pov-ray export, the “Command” field was left
    blank. It was only filled the second time after I selected a valid path.

Yeah - I need to connect up several other signals to an update slot… It is
on my list of things to finish off. I have been concentrating on getting the
meshes working and testing out various orbitals.

I hope that this dialog will make the POV-Ray export much more accessible. I
would really like to trap errors from POV-Ray in an intelligent way if there
is a way to do that. Also need to search through to path to check that POV-Ray
is in it - it will fail silently right now.

Is there a way to grab progress information too? I would love to have a
progress bar for the render.

Hi,

On Sun, Nov 23, 2008 at 7:15 PM, Marcus D. Hanwell marcus@cryos.org wrote:

On Sunday 23 November 2008 11:40:57 jacob@math.jussieu.fr wrote:

Hi,

First, congrats Marcus for the vastly improved povray export.

A few observations:

  1. the default filename for me was /home/.png. First, I’d suggest
    replacing “.png” by “example.png” or something like that; Second, it
    doesn’t really make sense to default to /home, I’d suggest $HOME
    instead.

Can’t we just use untitled.png if the title is empty?

The default is actually taken from the molecule filename. I should try and set
up a reasonable default for the molecule filename and that will then propagate
through to everything else. I will take a look through the Qt documentation to
see if there is a sane way of finding the home directory - I am sure there
must be.

See QDir::home() and QDir::homePath()

This is a really new feature that feeds through into several other things.

  1. I selected mistakenly /home/a.png, of course I don’t have write
    access to /home, so the file couldn’t be created. Avogadro didn’t
    catch that error, instead the povray run failed silently, the console
    output showed that it couldn’t find the input file.

I am having trouble here trapping any of the output from POV-Ray and so cannot
do any error detection. Most other command line programs I get output from,
but POV-Ray seems to do a great job of sending it elsewhere.

I think this is what you are looking for:

// QByteArray result = m_process->readAll();
QByteArray result = m_process->readAllStandardError();

  1. The first time I ran pov-ray export, the “Command” field was left
    blank. It was only filled the second time after I selected a valid path.

Yeah - I need to connect up several other signals to an update slot… It is
on my list of things to finish off. I have been concentrating on getting the
meshes working and testing out various orbitals.

I hope that this dialog will make the POV-Ray export much more accessible. I
would really like to trap errors from POV-Ray in an intelligent way if there
is a way to do that. Also need to search through to path to check that POV-Ray
is in it - it will fail silently right now.

Is there a way to grab progress information too? I would love to have a
progress bar for the render.

Here, povray 3.6 updates a line like :

0:00:02 Rendering line 474 of 768, 7863 supersamples

Not sure how easy it will be to extract this information, I know you
can overwrite a line in a terminal by using the backspace character.
However, I don’t know if this makes it harder…

Cheers,
Tim

On Sunday 23 November 2008 13:56:44 Tim Vandermeersch wrote:

Hi,

On Sun, Nov 23, 2008 at 7:15 PM, Marcus D. Hanwell marcus@cryos.org wrote:

On Sunday 23 November 2008 11:40:57 jacob@math.jussieu.fr wrote:

Hi,

First, congrats Marcus for the vastly improved povray export.

A few observations:

  1. the default filename for me was /home/.png. First, I’d suggest
    replacing “.png” by “example.png” or something like that; Second, it
    doesn’t really make sense to default to /home, I’d suggest $HOME
    instead.

Can’t we just use untitled.png if the title is empty?

That was my thought but I just hadn’t gotten that far yet… I have added it
locally and it looks good. Working on some other changes too. Will hopefully
have a commit or two ready soon.

The default is actually taken from the molecule filename. I should try
and set up a reasonable default for the molecule filename and that will
then propagate through to everything else. I will take a look through the
Qt documentation to see if there is a sane way of finding the home
directory - I am sure there must be.

See QDir::home() and QDir::homePath()

I was sure it must exist :wink:

This is a really new feature that feeds through into several other
things.

  1. I selected mistakenly /home/a.png, of course I don’t have write
    access to /home, so the file couldn’t be created. Avogadro didn’t
    catch that error, instead the povray run failed silently, the console
    output showed that it couldn’t find the input file.

I am having trouble here trapping any of the output from POV-Ray and so
cannot do any error detection. Most other command line programs I get
output from, but POV-Ray seems to do a great job of sending it elsewhere.

I think this is what you are looking for:

// QByteArray result = m_process->readAll();
QByteArray result = m_process->readAllStandardError();

I had honestly not thought of them sending everything to the error stream! I
also thought readAll was supposed to get everything. Tests with other programs
seemed to look fine with readAll(). Thanks for pointing this out as I had left
it alone for now.

  1. The first time I ran pov-ray export, the “Command” field was left
    blank. It was only filled the second time after I selected a valid path.

Yeah - I need to connect up several other signals to an update slot… It
is on my list of things to finish off. I have been concentrating on
getting the meshes working and testing out various orbitals.

I hope that this dialog will make the POV-Ray export much more
accessible. I would really like to trap errors from POV-Ray in an
intelligent way if there is a way to do that. Also need to search through
to path to check that POV-Ray is in it - it will fail silently right now.

Is there a way to grab progress information too? I would love to have a
progress bar for the render.

Here, povray 3.6 updates a line like :

0:00:02 Rendering line 474 of 768, 7863 supersamples

Not sure how easy it will be to extract this information, I know you
can overwrite a line in a terminal by using the backspace character.
However, I don’t know if this makes it harder…

I have seen that line myself, but cannot see an easy way to extract that
information in a sane way. I was going to see if I could spot whether other
programs had handled it. It is more of a nice thing to add polish anyway, and
seeing the preview may be more than enough for most.

Thanks,

Marcus

Not sure I completely understand the problem so forgive me if this isn’t the problem…

Concerning the progrss bar, If it is outputing a line that looks like it is updating, its just writing a \r character. You could look for that on the stdout/stderr stream and update the progressbar accordingly.

I would guess that its running in it’s own thread and with a qtimer, etc it would be easy to track.

PS: good work on the new primitive stuff!


Donald

-----Original Message-----
From: “Marcus D. Hanwell” marcus@cryos.org

Date: Sun, 23 Nov 2008 15:08:03
To: avogadro-devel@lists.sourceforge.net
Subject: Re: [Avogadro-devel] povray export

On Sunday 23 November 2008 13:56:44 Tim Vandermeersch wrote:

Hi,

On Sun, Nov 23, 2008 at 7:15 PM, Marcus D. Hanwell marcus@cryos.org wrote:

On Sunday 23 November 2008 11:40:57 jacob@math.jussieu.fr wrote:

Hi,

First, congrats Marcus for the vastly improved povray export.

A few observations:

  1. the default filename for me was /home/.png. First, I’d suggest
    replacing “.png” by “example.png” or something like that; Second, it
    doesn’t really make sense to default to /home, I’d suggest $HOME
    instead.

Can’t we just use untitled.png if the title is empty?

That was my thought but I just hadn’t gotten that far yet… I have added it
locally and it looks good. Working on some other changes too. Will hopefully
have a commit or two ready soon.

The default is actually taken from the molecule filename. I should try
and set up a reasonable default for the molecule filename and that will
then propagate through to everything else. I will take a look through the
Qt documentation to see if there is a sane way of finding the home
directory - I am sure there must be.

See QDir::home() and QDir::homePath()

I was sure it must exist :wink:

This is a really new feature that feeds through into several other
things.

  1. I selected mistakenly /home/a.png, of course I don’t have write
    access to /home, so the file couldn’t be created. Avogadro didn’t
    catch that error, instead the povray run failed silently, the console
    output showed that it couldn’t find the input file.

I am having trouble here trapping any of the output from POV-Ray and so
cannot do any error detection. Most other command line programs I get
output from, but POV-Ray seems to do a great job of sending it elsewhere.

I think this is what you are looking for:

// QByteArray result = m_process->readAll();
QByteArray result = m_process->readAllStandardError();

I had honestly not thought of them sending everything to the error stream! I
also thought readAll was supposed to get everything. Tests with other programs
seemed to look fine with readAll(). Thanks for pointing this out as I had left
it alone for now.

  1. The first time I ran pov-ray export, the “Command” field was left
    blank. It was only filled the second time after I selected a valid path.

Yeah - I need to connect up several other signals to an update slot… It
is on my list of things to finish off. I have been concentrating on
getting the meshes working and testing out various orbitals.

I hope that this dialog will make the POV-Ray export much more
accessible. I would really like to trap errors from POV-Ray in an
intelligent way if there is a way to do that. Also need to search through
to path to check that POV-Ray is in it - it will fail silently right now.

Is there a way to grab progress information too? I would love to have a
progress bar for the render.

Here, povray 3.6 updates a line like :

0:00:02 Rendering line 474 of 768, 7863 supersamples

Not sure how easy it will be to extract this information, I know you
can overwrite a line in a terminal by using the backspace character.
However, I don’t know if this makes it harder…

I have seen that line myself, but cannot see an easy way to extract that
information in a sane way. I was going to see if I could spot whether other
programs had handled it. It is more of a nice thing to add polish anyway, and
seeing the preview may be more than enough for most.

Thanks,

Marcus


This SF.Net email is sponsored by the Moblin Your Move Developer’s challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net

On Sunday 23 November 2008 15:23:30 Donald Ephraim Curtis wrote:

Not sure I completely understand the problem so forgive me if this isn’t
the problem…

Concerning the progrss bar, If it is outputing a line that looks like it is
updating, its just writing a \r character. You could look for that on the
stdout/stderr stream and update the progressbar accordingly.

That is what it looks like. I will see if I can detect it.

I would guess that its running in it’s own thread and with a qtimer, etc it
would be easy to track.

It is just using QProcess and splitting off right now. It informs the
extension when it is done. I will see if I can get this working soon.

PS: good work on the new primitive stuff!

Thanks, hopefully they are mainly positive changes! Still not done but we are
getting there. Hope you are doing well - it has been a while since we chatted.

Thanks,

Marcus


Donald

-----Original Message-----
From: “Marcus D. Hanwell” marcus@cryos.org

Date: Sun, 23 Nov 2008 15:08:03
To: avogadro-devel@lists.sourceforge.net
Subject: Re: [Avogadro-devel] povray export

On Sunday 23 November 2008 13:56:44 Tim Vandermeersch wrote:

Hi,

On Sun, Nov 23, 2008 at 7:15 PM, Marcus D. Hanwell marcus@cryos.org
wrote:

On Sunday 23 November 2008 11:40:57 jacob@math.jussieu.fr wrote:

Hi,

First, congrats Marcus for the vastly improved povray export.

A few observations:

  1. the default filename for me was /home/.png. First, I’d suggest
    replacing “.png” by “example.png” or something like that; Second, it
    doesn’t really make sense to default to /home, I’d suggest $HOME
    instead.

Can’t we just use untitled.png if the title is empty?

That was my thought but I just hadn’t gotten that far yet… I have added
it locally and it looks good. Working on some other changes too. Will
hopefully have a commit or two ready soon.

The default is actually taken from the molecule filename. I should try
and set up a reasonable default for the molecule filename and that will
then propagate through to everything else. I will take a look through
the Qt documentation to see if there is a sane way of finding the home
directory - I am sure there must be.

See QDir::home() and QDir::homePath()

I was sure it must exist :wink:

This is a really new feature that feeds through into several other
things.

  1. I selected mistakenly /home/a.png, of course I don’t have write
    access to /home, so the file couldn’t be created. Avogadro didn’t
    catch that error, instead the povray run failed silently, the console
    output showed that it couldn’t find the input file.

I am having trouble here trapping any of the output from POV-Ray and so
cannot do any error detection. Most other command line programs I get
output from, but POV-Ray seems to do a great job of sending it
elsewhere.

I think this is what you are looking for:

// QByteArray result = m_process->readAll();
QByteArray result = m_process->readAllStandardError();

I had honestly not thought of them sending everything to the error stream!
I also thought readAll was supposed to get everything. Tests with other
programs seemed to look fine with readAll(). Thanks for pointing this out
as I had left it alone for now.

  1. The first time I ran pov-ray export, the “Command” field was left
    blank. It was only filled the second time after I selected a valid
    path.

Yeah - I need to connect up several other signals to an update slot…
It is on my list of things to finish off. I have been concentrating on
getting the meshes working and testing out various orbitals.

I hope that this dialog will make the POV-Ray export much more
accessible. I would really like to trap errors from POV-Ray in an
intelligent way if there is a way to do that. Also need to search
through to path to check that POV-Ray is in it - it will fail silently
right now.

Is there a way to grab progress information too? I would love to have a
progress bar for the render.

Here, povray 3.6 updates a line like :

0:00:02 Rendering line 474 of 768, 7863 supersamples

Not sure how easy it will be to extract this information, I know you
can overwrite a line in a terminal by using the backspace character.
However, I don’t know if this makes it harder…

I have seen that line myself, but cannot see an easy way to extract that
information in a sane way. I was going to see if I could spot whether other
programs had handled it. It is more of a nice thing to add polish anyway,
and seeing the preview may be more than enough for most.

Thanks,

Marcus


This SF.Net email is sponsored by the Moblin Your Move Developer’s
challenge Build the coolest Linux based applications with Moblin SDK & win
great prizes Grand prize is a trip for two to an Open Source event anywhere
in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
avogadro-devel List Signup and Options

This SF.Net email is sponsored by the Moblin Your Move Developer’s
challenge Build the coolest Linux based applications with Moblin SDK & win
great prizes Grand prize is a trip for two to an Open Source event anywhere
in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/


Avogadro-devel mailing list
Avogadro-devel@lists.sourceforge.net
avogadro-devel List Signup and Options