How do I use the "-lod:dist" import flag in the "Import 3D scene" window?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CrazyDisplay
:warning: Old Version Published before Godot 3 was released.

I am trying to add objects with LOD to a scene created in Blender, to be exported to DAE with the better collada plugin.

The “Import 3D Scene” window lists “Create LODs (-lod:dist)” as an import option under “Create”.

I’ve tried naming my LOD objects like so: Cylinder-lod:1, Cylinder-lod:2 and so forth, but after importing the .DAE file into Godot, the objects LOD properties (Range Begin and Range End) are both still just set to 0.

Am I doing something wrong here? Can anyone clarify how I’m supposed to properly use this?

Thanks in advance.

I’m fairly sure it just doesn’t work. I’ve tried using it multiple times, but nothing got it working.

CowThing | 2017-01-13 19:44

Yeah, I’m beginning to think the same thing, I’ve tried a few different ways to name the objects but nothing gives.

CrazyDisplay | 2017-01-13 19:54

:bust_in_silhouette: Reply From: ingo_nikot

it searches for lodxxx
from the source:

String d=str.substr(str.find("lod")+3,str.length());
//some  ifs
float dist = d.to_double();
mi->set_draw_range_begin(dist);
mi->set_draw_range_end(100000);

Update
Cant get this to work. In the latest version they commented “set_draw_range_begin” out, so i gues it didnt work. But i couldnt find an issue related to this.

Oh, that’s a shame, thanks for taking the time to check it out anyway.
Is there any dev that could comment on this? I would really like to use this feature.

CrazyDisplay | 2017-01-13 19:10

i changed my awnser just the moment you commented. pls read again :slight_smile:

ingo_nikot | 2017-01-13 19:12

I see, so if I understand this correctly, I should be naming objects like this: some_mesh-lod10?

Edit: I tried the naming I mentioned above and both range begin and range end are still set to 0.

CrazyDisplay | 2017-01-13 19:20

i will try it later, another code chunk:

if ((_teststr(name,"lod"))) {
	    str=name; 

ingo_nikot | 2017-01-13 22:21

did try, did not work. I think its broken.

ingo_nikot | 2017-01-14 10:55

Alright, thanks again for looking into it, if the devs commented that specific part of the code then they probably already know it doesn’t work, but i’ll post a bug report on this anyway.

Update:
Link to Github issue

CrazyDisplay | 2017-01-14 11:01

:bust_in_silhouette: Reply From: wombatstampede

At the moment you have to use “$lod” instead of “-lod” because of an error.

Make the reduced detail lod mesh the child of the original mesh. Then name it with $lod:<value>.

So the structure in i.e. Blender is like this.

any_parent_mesh_name
  any_child_name$lod:20

Import won’t support more than two lod levels. So just one lod child.
For more levels you’d have to write your own import script.