Advanced Add-on for Blender
Scrubs started this discussion in Model Export and Render
Avatar of Scrubs
Administrator

Check the Advanced Add-on description page for more information.

More…
616 replies · Page 22 of 31

@NGCHunter2
I've been going through the blender files, and I've finally found a simple (but very tedious!!) way to remove the duplicated mesh data.

First, remap the duplicated materials as you said. An easier way is to use Outliner->Blender File->Materials. Right click on each material with a number after it, remap and select the non-numbered version. e.g. mb😒olid:24.001 remaps to mb😒olid:24. The .001 version of material does not disappear until the file is closed and reopened (or you can clear it immediately by deleting it from Outliner->Orphaned Data->Materials, where it is shown with zero users)

Then, the mesh data can be cleaned of duplicates. Say for example you have a zmbx file containing one brick, 3070, and import this twice. This creates four copies of 3070. "3070" is a mesh with no material, it's orphaned data and will automatically delete when the file is closed. "3070.001" is an independent copy of the mesh with a material (e.g. mb😒olid:21). "3070.002" is a duplicate of "3070" from the second import. "3070.003" is a copy of the mesh with an assigned material. If 3070.001 and 3070.003 have different materials, then .003 cannot be remapped to .001 or it will change colour. If they have the same materials (which is why remapping the material names has to be done first 😃 ) then you can remap mesh .003 to .001, and .003 is deleted.

I'm not sure if there would be any rendering performance benefits to reducing the numbers of materials and meshes in the file. The only effect I have noticed so far is that file size reduces by 20-50kb for each mesh or material removed. I don't really know where to start writing a python script for blender, do you think it would it be worth trying to make one?

@NathanR2015
Nice find! To be honest, I have no insight into the Advanced Add-On whatsoever, for Scrubs did it by himself. I only tried to find a simple solution to a not-so-hard problem (as I guessed).
I don't actually know how much of an impact non-duplicates have on build-time, RAM/VRAM consumption and render time, but I'd say it's better to have less non-instances geometry if possible; probably dependent on the total amount of parts that have non-instances (especially which parts) plus the complexity of the shaders. For I'm not a (Python) coder either, I can't estimate whether the work/performance ratio is worth it; but I guess a "look for color.xyz and replace by color.xxx" and "look for part.xyz with color.xxx and replace by part.xxx with color.xxx" isn't too hard if you know a bit of coding, for it wouldn't necessarily require insight into the Add-On itself. So if you happen to find someone with a decent coding knowledge that might actually work, but I'm the wrong guy to ask for it. 😁

Edit: also, just noting, the filesize of Blender files with orphaned data might need a few saves before it lowers noteworthy. I usually reload the same file four to five times and just save over until the lowest filesize is reached.

Hi there! I am having issues with the advanced addon on blender 2.8, I am trying to render a simple scene and the minfigs look realistic but all bricks look really weird, like a mixture of glossy and transparent yet they are solid. What could be causing this? Here is what it looks like: https://imgur.com/a/juk3BSm

btw i did use an aqua color but can you see how its really glossy?

Avatar of Scrubs
Administrator

@GeneralTofu You scaled down the model. That is not possible as it breaks the materials. It is made for scale 1:1. 1bu = 1mm.

ah yes i did scale it down, so should i just import it and leave it as is? is there a way i can ever a way i can scale down a model for unique purposes? also should i change the unit system in blender from meters to mm?

ok it looks better https://imgur.com/a/ClKM6Lp but is it just me or does the baseplate look off?

@NGCHunter2 Yes, there are benefits for having less duplicates of mesh data. Similar, but duplicated, mesh data causes Blender to build each one separately (contributing to a longer build time) as an individual mesh.

Avatar of Scrubs
Administrator

@samino this is much more relevant for animation where you have 1000s of frames and therefore 1000s of times the calculation. For a still image that becomes almost irrelevant. The Mecabricks add-on already deals with instancing to limit the amount of memory used as well as render time. Nathan script actually summarises pretty well why I do not reuse data from elements already in the scene when more than one model are imported. I prefer sacrificing a little bit of performance to ensure that everything works in all possible cases. That is a choice. Up to you guys to write your own tools to get extra features like Nathan did 😃

any guides for this?

@Scrubs
Would it be possible to export Mecabricks groups + subgroups to Blender collections? Sometimes I group parts together in order to be able to rotate or move certain parts of a model in Blender later, and losing those groups during export is resulting in a lot of (often complicated) extra work that won't be necessary if grouping information could be stored in .ZMBX files.

Also, would it be possible to get back to naming the exported parts like their respective LEGO® ID again instead of "mbElement.xyz"? That way, selecting similar parts is made easier, for certain search function only work for object names, not mesh names in Blender (as far as I've experienced).

I second this.

I definitely second that too.
Often i export my model in pieces because i need to remake the group and pivot point in Blender, on some ship, like the X-Wing, it's primordial to keep that point to make the wing deploy properly.
Having the group exported directly to Blender would save so much work !

Hi, I recently bought Mecabricks Advanced using my checking account, and I still don't have it in purchases. Do I need to "activate" the payment?

If you don't get an answer here soon, LegoMolder. Use the "Contact Us" in the bottom to contact Scrubs personally about this.

Avatar of Scrubs
Administrator

@LegoMolder155 Your order is pending as your payment didn't come through. I'll send you the Paypal email showing that your payment has failed.

Seconding the preservation of groups in Blender + 1 here. : )

Seconding the preservation of groups in Blender + 1 here. : )

Hi! Are there any options to reduce the scale of the model while preserving the material? It’s not convenient to work on such a scale when trying to make large scenes.

Not that I know of unless you put in a bit of work into it. The SSS radius and the bevel are about the only things that require the current scale I believe. If you add a math node (Multiply function), assuming you are wanting to work with the models say, a tenth of their current scale, set the lower value to 0.1 and multiply that for the final result of the SSS equation (there's a separate node group for it within the material system) and do something similar to the bevel node (just set the current value (0.350 I believe) to a tenth of the original). This should hopefully work. I had to do something similar for my custom Lego shader so that it works on multiple scales. 😉

Advertising
87 participants
Avatar of Scrubs
Avatar of Renderbricks
Avatar of Krisego
Avatar of Helo
Avatar of jim_the_jim_boi
Avatar of wlange
Avatar of Markal
Avatar of SaitoGray
Avatar of macrolegouniverse
Avatar of Masman8675
Avatar of NGCHunter2
Avatar of Sommer123456
Avatar of Owenator13
Avatar of Tintin1
Avatar of Sealund
Avatar of jaydotjay
Avatar of Dr.Gektor
Avatar of guy0629
Avatar of WetWired
Avatar of dtriangle
Avatar of Davdup
and others

LEGO, the LEGO logo, the Minifigure, and the Brick and Knob configurations are trademarks of the LEGO Group of Companies. ©2024 The LEGO Group.

Mecabricks, the Mecabricks logo and all content not covered by The LEGO Group's copyright is, unless otherwise stated, ©2011-2024 Mecabricks.