Closed BigRoy closed 1 year ago
Just cross-referencing the comment from another issue. Should be fixed in 0.8.2 beta.
Fixed in 0.8.2 beta.
Note a huge issue but I do believe it's new behavior - whenever the command you run does not end with an empty new line the return value gets printed in the top report view on the same line. Like this:
Note how the returned list appears directly after the image.ocioIcsList()
.
It would be nicer if it'd appear like this:
In this case I just added a #
line since that was the only thing that worked to get the return value onto a new line.
Would be great if the output could always report "\n".join([command, result])
especially because you seem to already perform a command.strip()
or alike on the input since any empty new lines already appear removed.
I have fixed that and updated the beta of v0.8.2 on all platforms and put it on sourceforge, on the beta folder (that way it is easier for people to find it instead of looking through the mrv2 issues). Anyway, look for it in:
https://sourceforge.net/projects/mrv2/files/beta/
These are full releases not nightly builds, so they are compatible with RH 8.1 and have USD support on Windows.
Can confirm it's fixed in latest beta of v0.8.2
Actually there seems to be another issue. It fails to close brackets over multiple lines in some cases, e.g. this fails:
import mrv2
from mrv2 import annotations, cmd, math, image, io, media
from mrv2 import playlist, timeline, usd, settings
image_options = image.ImageOptions(
videoLevels=image.InputVideoLevels.FromFile,
alphaBlend=image.AlphaBlend.None,
imageFilters=image.ImageFilters(
minify=image.ImageFilter.Linear,
magnify=image.ImageFilter.Linear
)
)
With the simplest reproducable of the issue being:
image_options = image.ImageOptions(
)
Whereas this works:
image_options = image.ImageOptions()
What error do you get (and what Input does it print in the Python Display Window)? Also, what happens if you select the section from the beginning of the assignment to the end of the parenthesis?
It seems to strip off the end )
bracket:
SyntaxError: '(' was never closed (<string>, line 7)
Note the code that it runs:
This does work:
import mrv2
from mrv2 import annotations, cmd, math, image, io, media
from mrv2 import playlist, timeline, usd, settings
image_options = image.ImageOptions(
#
)
Or if I add a statement after it also works:
import mrv2
from mrv2 import annotations, cmd, math, image, io, media
from mrv2 import playlist, timeline, usd, settings
image_options = image.ImageOptions(
)
print("A")
This one I'll leave it to investigate it tomorrow.
Latest beta still produces this error for me:
I uploaded a new beta that should fix the issues. Grab it from sourceforge.net mrv2 beta directory.
There's still an issue left. If you do:
cmd.ImageOptions( keyword = var )
without a variable at the beginning like:
o = cmd.imageOptions( keyword = var )
You will still get a syntax error.
I fixed that final issue too. Latest beta on sourceforge.
Unfortunately the new line issue still exists. In Python this should technically work:
image.ImageFilters(minify=image.ImageFilter.Nearest
)
But it fails in latest beta. This is what it shows in the report:
import mrv2
from mrv2 import annotations, cmd, math, image, io, media
from mrv2 import playlist, timeline, usd, session, settings
image.ImageFilters(minify=image.ImageFilter.Nearest)
image.ImageFilters(minify
SyntaxError: '(' was never closed (<string>, line 2)
It seems to duplicate the last line, including a split off one?
This fails the same way:
import mrv2
from mrv2 import annotations, cmd, math, image, io, media
from mrv2 import playlist, timeline, usd, session, settings
image.ImageFilters(
minify=image.ImageFilter.Nearest,
magnify=image.ImageFilter.Nearest
)
But this works:
import mrv2
from mrv2 import annotations, cmd, math, image, io, media
from mrv2 import playlist, timeline, usd, session, settings
image.ImageFilters(
minify=image.ImageFilter.Nearest,
magnify=image.ImageFilter.Nearest)
New beta on sourceforge. I am betting that this time it will all work. I cleaned up the code and documented the algorithm.
That does seem to work now - the only thing I can't seem to get to work is to set the video levels in this call:
image_options = image.ImageOptions(
videoLevels=image.InputVideoLevels.FromFile,
alphaBlend=image.AlphaBlend.kNone,
imageFilters=image.ImageFilters(
minify=image.ImageFilter.Linear,
magnify=image.ImageFilter.Linear
)
)
Results in:
TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
1. mrv2.image.ImageOptions()
2. mrv2.image.ImageOptions(videoLevels: mrv2.image.InputVideoLevels, alphaBlend: mrv2.image.AlphaBlend, imageFilter: mrv2.image.ImageFilters)
Invoked with: kwargs: videoLevels=<InputVideoLevels.FromFile: 0>, alphaBlend=<AlphaBlend.kNone: 0>, imageFilters=<mrv2.image.ImageFilters minify=Linear magnify=Linear>
At:
<string>(10): <module>
This works though:
video_levels = image.InputVideoLevels(0)
image_options = image.ImageOptions(
videoLevels=video_levels,
alphaBlend=image.AlphaBlend.kNone,
imageFilters=image.ImageFilters(
minify=image.ImageFilter.Linear,
magnify=image.ImageFilter.Linear
)
)
But the constructor for InputVideoLevels still seems off. It also feels weird it needs it own constructor since it only takes one value?
This also does not work:
video_levels = image.InputVideoLevels(image.InputVideoLevels.FromFile)
It requires an integer.
Try this. It is imageFilter not imageFilters. This works for me:
image_options = image.ImageOptions( videoLevels=image.InputVideoLevels.FromFile, alphaBlend=image.AlphaBlend.kNone, imageFilter=image.ImageFilters( minify=image.ImageFilter.Linear, magnify=image.ImageFilter.Linear ) )
Oh. Wait. It was a typo on my part in the constructor parameters. I'll fix it.
I was just about to post this:
I must've been blind staring at that snippet thinking it was video levels giving the issue. Thanks - my bad.
This does indeed work:
image_options = image.ImageOptions( videoLevels=image.InputVideoLevels.FromFile, alphaBlend=image.AlphaBlend.kNone, imageFilter=image.ImageFilters( minify=image.ImageFilter.Linear, magnify=image.ImageFilter.Linear ) )
All seems solved.
But apparently it is a typo still?
Yes, it is a typo on my part. I'll have a fix in 30 mins the beta sourceforge site.
Can I close this issue?
Issue
This is likely a Windows issue - but testing 0.8.1 I noticed that the Python panel often gave syntax errors:
My entry in the script field:
Would execute as:
Giving:
It seems that the Enter key maybe does not generate the new lines as it expects (maybe
\r
instead of\n
?)My keyboard locale settings on Windows 10 are set to: