Conversation
|
Arrrr merge conflict, i knew this will happen, will fix |
simlu
left a comment
There was a problem hiding this comment.
I really like what you did so far!
(1) Export seems to be slow in general. I don't think it would be hard to parallelize. Thoughts?
(2) We should be able to set the image resolution and ratio and the camera angle in the exporter and position the camera so that the whole model is visible. You can use HackedFrameBuffer to set the size. Just need to figure out how to position the camera automatically.
(3) The bounding box should be disabled for the rendering.
That's it so far! Good work, but lots more to do :)
| } | ||
| // get the image rendered in container in high quality | ||
| public BufferedImage getImage() { | ||
| public BufferedImage getImage() throws Exception { |
There was a problem hiding this comment.
IOException while loading the font for the watermark
There was a problem hiding this comment.
Can you make the Exception that is thrown explicit then? I.e. IOException instead of Exception?
| } | ||
|
|
||
| // get camera position | ||
| public final float[] getCamPosition() { return this.camera.getCamPosition(); } |
There was a problem hiding this comment.
Don't write these as one line, write as
public final float[] getCamPosition() {
return this.camera.getCamPosition();
}
There was a problem hiding this comment.
Since it's a single line of code, i tends to write such methods like that (Another bad Habit) will change.
There was a problem hiding this comment.
Yeah, I don't like long lines very much. There is a reason swift > objective-c :)
| // get camera position | ||
| public final float[] getCamPosition() { return this.camera.getCamPosition(); } | ||
|
|
||
| public BufferedImage getImage(final Color bgColor, final boolean addWatermark) throws Exception { return container.getImage(bgColor, addWatermark); } |
There was a problem hiding this comment.
Why do the variables need to be final? I think you can remove the final keyword.
There was a problem hiding this comment.
just an agreement that i will never modify it, will change it if you don't like it
There was a problem hiding this comment.
Yeah I think final should only be used when there is a reason for it. That's how I'm usually handling it.
There was a problem hiding this comment.
Will change, but i will also love to know what your reasons are
There was a problem hiding this comment.
Mostly "Shorter is better and faster to read".
There was a problem hiding this comment.
The answer here is pretty good: http://stackoverflow.com/questions/154314/when-should-one-use-final-for-method-parameters-and-local-variables
| turnTableImageSeq.addComponent(new SeparatorModule("")); | ||
| turnTableImageSeq.addComponent(new CheckBoxModule("add_background_color", "Add Image background color", false)); | ||
| TextInputModule TISBackgroundColor = new TextInputModule("background_color", "Image Background Color: e.g #ffffff", "#000000", true); | ||
| TISBackgroundColor.setVisibleLookup("export_type=turntable_image_sequence&turntable_image_sequence.add_background_color=true"); |
There was a problem hiding this comment.
I don't think this should be hidden... (bad user experience)
There was a problem hiding this comment.
I didn't hide it at first but later i thought it will be easier to understand cause if there is no background color the image background will be transparent. And also other applications does that,but if you don't like it, i can change it.
There was a problem hiding this comment.
I had hiding components a lot initially and it was confusing as hell :)
| protected Object doInBackground() throws Exception { | ||
|
|
||
| // export color render (image) | ||
| progressDialog.setActivity("Processing turntable image sequence", true); |
There was a problem hiding this comment.
The progress bar should display the actual progress. Shouldn't be hard to do.
There was a problem hiding this comment.
Actual progress of entire export instead of each images?
There was a problem hiding this comment.
Yes. There are other places in the code where I do that. You need to have a counter and also provide the max value.
| // --------------- | ||
|
|
||
| // add "turntable animation" export | ||
| FieldSet turntableAnim = new FieldSet("turntable_animation", "Turntable Render (*.gif)"); |
There was a problem hiding this comment.
There should only be one "turnable" exporter with the option gif and separate images. The exporter options is already crowded enough!
There was a problem hiding this comment.
The two does the same thing in different ways. The animation (.gif) is mostly useful if you want to quickly showcase your model on social media but the image sequence will be helpful to those who want to use the render in third party application e.g video/image editor. Merging the two together will either create a mess, give user less options or just make the list longer. BTW here on linux i experience issues of not being able to scroll in the export dialog (colladae). Another option is to remove it from export dialog and include it in the toolbar/header bar like how QBCL does it.
There was a problem hiding this comment.
Mhmmm, I guess we have to consider what the use cases are. I think we should keep it in the export dialog but also have quick access buttons.
I definitely like the idea of merging it. And I disagree: I think we can achieve this without creating a mess giving users less options.
Can you create a bug report for that issue with screenshot please? Thanks!
|
|
||
| // =========== | ||
|
|
||
| // -- export turntable animation |
There was a problem hiding this comment.
The export logic should be separated out of this file.
There was a problem hiding this comment.
Should we make an export class(abstract)/interface.
There was a problem hiding this comment.
Yes. I'm thinking all the exporters will be separated out eventually. But for now just doing it with this one is fine. I really need to rework the MainMenuLogic class. It's a giant mess :)
|
Also I get interesting transparency issues. Somehow black is made transparent for some reason in the animated gif? |
|
|
About the transpareny issue, can you please explain more and tell me how to replicate it. |
|
Most issues can only be looked into when you are done with travis |
|
Regarding transparency issue: Here is a sample export http://i.imgur.com/locIHtR.gif |
|
(1) Animation even with the slowest setting it takes 30 seconds and this computer is FAST. If we allow to define the view port size that can be improved by setting it smaller default. It's pretty large currently. (2) I'm not sure I understand? They get the same freedom? With the improvement that they don't accidentally cut of the head. It's gonna be especially nice when we show the camera angles in the main view port. (3) I think it should be an option in the exporter then. |
|
I'm pretty much done with the heavy file changes for travis. You can branch off of the ci-prep branch and continue working! |
|
Another issue I just noticed: The file doesn't get closed after the export completes. This needs to be fixed! |
|
Unfortunately i can't view the video but i think i also experience a similar issue just now (all black are transparent) and i think the problem is coming from the fact that if no background color is set then black will be used as the transpareny color therefore all black pixels are rendered transparent by the gif encoder. There can be a workaround but am assuming it to be "dirty" or we just go with a semi transparent background (which won't be nice). |
|
Well Gif Doesnt Support Alpha Transparency. So The Workaround should Be Easy. Find Color Not In Image, set transparent Pixels To That and Use That for Transparency. Can You Set What The Gif Encoder uses? |
|
Ideally you should be able to tell it to use transparency... |
|
Gif supports transparency, that why i said it dirty, it will require me to go pixel by pixel to check which color is in the image |
|
Yeah i can set what color the gif encoder uses. |
|
How were you able to know the file is not getting close? |
|
Alpha transparency != transparency |
|
I couldn't delete it :) |
|
|
You mean Alpha transparency like png? Unfortunately gif doesn't support that, My mistake. |
|
No I don't think it does? Reference? |
|
Typo, i meant to type "doesn't" :D |
|
The Animation exporter needs improvement, the best things to avoid are are loops that will worsen performance. So i think we should remove gif transparency background support since it's not really alpha transparency and set black as the default background color instead. What did you think. |
|
How are things going here? It looks really promising, but needs more work. Need help? |
|
No, thanks. I will improve it. |
Please review and test and let me know what you think, so after that i can post a tutorial on Twitter and also improve the standard image render export to also include support for background color and watermark.