LDView Simplified boxes


Simplified boxes
#1
I have been using LDBoxer to reduce the polycount of my models.

https://github.com/Jeremy1980/LDBoxer

Can anyone explain why framerate is not improved when using them in for instance LDView? Thanks.
Reply
RE: Simplified boxes
#2
(2021-06-12, 3:09)Michael Horvath Wrote: I have been using LDBoxer to reduce the polycount of my models.

https://github.com/Jeremy1980/LDBoxer

Can anyone explain why framerate is not improved when using them in for instance LDView? Thanks.

When I run the Python version of LDBoxer, it always says that it has boxed 0 parts. Are you sure it is actually doing anything?
Reply
RE: Simplified boxes
#3
(2021-06-12, 4:51)Travis Cobbs Wrote: When I run the Python version of LDBoxer, it always says that it has boxed 0 parts. Are you sure it is actually doing anything?

The EXE version reports 0 parts boxed for all the models I've tried it on also.
Reply
RE: Simplified boxes
#4
(2021-06-12, 4:51)Travis Cobbs Wrote: When I run the Python version of LDBoxer, it always says that it has boxed 0 parts. Are you sure it is actually doing anything?

I didn't fully read the instructions. I don't have the boxed parts. I'll grab those and see what happens.
Reply
RE: Simplified boxes
#5
(2021-06-12, 4:51)Travis Cobbs Wrote: When I run the Python version of LDBoxer, it always says that it has boxed 0 parts. Are you sure it is actually doing anything?

The Python version isn't working for me (in macOS). The EXE version seems to work after installing the box files. However, when run on LDView's m6459.ldr sample model, it doesn't replace very many parts. I think I see a slight improvement in performance in some models.

In the case of LDView, I'm not sure if LDView is detecting the boxed parts as being parts. If that is the case, it is likely responsible for sabotaging most of any performance gain that is gotten by having them be boxed. They are in the LDraw parts directory, but in a sub-directory. I can't remember off-hand if that will be detected as being parts by LDView. They don't appear to have a meta-command indicating that they are parts, so if LDView doesn't consider them as such due to being in a subdirectory, then the meta-command is necessary.

I would suggest adding the following line to the header of all the boxed parts:

0 unofficial part
Reply
RE: Simplified boxes
#6
I tested, and it does appear that LDView is detecting the boxes as parts. So, my guess is that LDView spends more time traversing the parts in the model than it does drawing the geometry for each part.
Reply
RE: Simplified boxes
#8
(2021-06-12, 5:34)Travis Cobbs Wrote: I tested, and it does appear that LDView is detecting the boxes as parts. So, my guess is that LDView spends more time traversing the parts in the model than it does drawing the geometry for each part.

I have also "inlined" my town MPD model to the "library level" using MPDCenter. This should have reduced the number of branches on the model tree to 1. I assumed this would produce a big performance boost, but it hasn't. Oh well. Kind of defeats the whole purpose of taking these steps and creating LDBoxer. Sad
Reply
RE: Simplified boxes
#7
(2021-06-12, 5:23)Travis Cobbs Wrote: The Python version isn't working for me (in macOS). The EXE version seems to work after installing the box files. However, when run on LDView's m6459.ldr sample model, it doesn't replace very many parts. I think I see a slight improvement in performance in some models.

Are there errors? I forgot to mention in the readme that I updated the script for Python 3. (Fixed now.) Thus the source code syntax is considerably different. Further, I use PyPy3 to run the script. That may potentially make a difference.
Reply
RE: Simplified boxes
#9
(2021-06-12, 20:29)Michael Horvath Wrote: Are there errors? I forgot to mention in the readme that I updated the script for Python 3. Thus the source code syntax is considerably different. Further, I use PyPy3 to run the script. That may make a difference.

There are no errors. And the Python in current macOS Big Sur is 2.7.16. When I ran it on my m6459.ldr, it said it replaced 14 of 74 parts. However, while the boxed version of the file had the boxed summary comments at the bottom indicating how many parts of each type and total parts had been replaced, there were in fact no replacements.
Reply
RE: Simplified boxes
#10
(2021-06-12, 20:40)Travis Cobbs Wrote: There are no errors. And the Python in current macOS Big Sur is 2.7.16. When I ran it on my m6459.ldr, it said it replaced 14 of 74 parts. However, while the boxed version of the file had the boxed summary comments at the bottom indicating how many parts of each type and total parts had been replaced, there were in fact no replacements.

Python 3.x is not backwards-compatible with Python 2.x. They're *not* designed to work together. That being said, I'm surprised there were no errors. Can you attach the model to your next post so I can figure out what is going on?
Reply
RE: Simplified boxes
#11
(2021-06-12, 23:58)Michael Horvath Wrote: Python 3.x is not backwards-compatible with Python 2.x. They're *not* designed to work together. That being said, I'm surprised there were no errors. Can you attach the model to your next post so I can figure out what is going on?

There's no real need. The only difference between the boxed model and the original was the addition of the boxing summary:

Code:
0 // Boxed 3 parts (b\t).
0 // Boxed 6 parts (b\b).
0 // Boxed 5 parts (b\a).
0 // Boxed Total 14/74 (18.9%) parts by LDBoxer v2018g.
0 // Elapsed time: 00:00:00.
0

Everything else remained the same.
Reply
RE: Simplified boxes
#12
(2021-06-13, 0:52)Travis Cobbs Wrote: There's no real need. The only difference between the boxed model and the original was the addition of the boxing summary:

Code:
0 // Boxed 3 parts (b\t).
0 // Boxed 6 parts (b\b).
0 // Boxed 5 parts (b\a).
0 // Boxed Total 14/74 (18.9%) parts by LDBoxer v2018g.
0 // Elapsed time: 00:00:00.
0

Everything else remained the same.

I know, but could you please post the model anyway?

[ed]

Sorry, I was unclear. I mean the original source model, not the processed model. Obviously, the incorrectly processed model is completely useless to anyone.
Reply
RE: Simplified boxes
#13
(2021-06-13, 1:23)Michael Horvath Wrote: I know, but could you please post the model anyway?

[ed]

Sorry, I was unclear. I mean the original source model, not the processed model. Obviously, the incorrectly processed model is completely useless to anyone.

As I mentioned, it's the sample model from LDView. I guess I didn't mention which one, though: m6459.ldr.
Reply
RE: Simplified boxes
#14
(2021-06-13, 2:42)Travis Cobbs Wrote: As I mentioned, it's the sample model from LDView. I guess I didn't mention which one, though: m6459.ldr.

Oops! My mistake. I will test it.

[ed]

Try downloading and running the tool again. I made some changes. Seems to be working fine for me. Make sure you have Python 3.9 installed not 2.7.
Reply
RE: Simplified boxes
#15
(2021-06-13, 15:43)Michael Horvath Wrote: Oops! My mistake. I will test it.

[ed]

Try downloading and running the tool again. I made some changes. Seems to be working fine for me. Make sure you have Python 3.9 installed not 2.7.

I installed the latest Python 3 (3.9.5), then did a git pull on LDBoxer, then ran it with the newly install Python 3, and it still behaves the same.
Reply
RE: Simplified boxes
#16
If you have lines like this:

Code:
1 14 0 -8 -110 -1 0 0 0 1 0 0 0 -1 b\a3023.DAT

with a "b\a" or "b\b" or "b\t" before the part name, then it is working. The file name should be prefixed with "boxed_" as well. Other than that, I have no idea. I don't know what might be the problem, or how to test or reproduce it. If anyone has any suggestions, that would be great.

I have attached the version of the file I get when I run the tool.


Attached Files
.ldr   boxed_m6459.ldr (Size: 4.2 KB / Downloads: 1)
Reply
RE: Simplified boxes
#17
(2021-06-14, 21:58)Michael Horvath Wrote: If you have lines like this:

Code:
1 14 0 -8 -110 -1 0 0 0 1 0 0 0 -1 b\a3023.DAT

with a "b\a" or "b\b" or "b\t" before the part name, then it is working. The file name should be prefixed with "boxed_" as well. Other than that, I have no idea. I don't know what might be the problem, or how to test or reproduce it. If anyone has any suggestions, that would be great.

I have attached the version of the file I get when I run the tool.

I don't. In my earlier post, I stated that the only changes to my file were the summary comments added to the end. When I re-ran with your update and Python 3, I got the same result. I didn't feel the need to re-state anything because I got the same thing.
Reply
RE: Simplified boxes
#18
(2021-06-14, 22:09)Travis Cobbs Wrote: I don't. In my earlier post, I stated that the only changes to my file were the summary comments added to the end. When I re-ran with your update and Python 3, I got the same result. I didn't feel the need to re-state anything because I got the same thing.

I suspect I figured out what is going on. But could you please first get the latest version of the tool and try processing the model again? I added some additional debugging steps.
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)