Adding Materials to Linked Objects In Composer

Hi there,

I’m a huge fan of using the SDK’s scene composer for a lot of reasons. One thing I’d really find useful is if I could add Materials to linked objects (like a cube or a model with a few uv maps) So I can visualize my scene better and to save me some work adding the materials at run time.

Is this possible?

Thanks for reading!

I don’t get it. You can set a material to an object by clicking on it in the scene navigator and choosing a material from the properties panel on the right.

@nehon

It seems like you can only do that in the Geometry. If the object is “linked” in the scene composer than you cannot directly access the Geometry from the scene explorer. If you “add” the object in the scene composer than you can access all aspects of it. But creates a new copy in the scene rather than just a reference to it.

If I link a generic object such as a cube it will always have the material that is in the cube.j3o and cannot be changed within the scene composer if it’s linked. But seeing as how this cube can serve multiple purposes based on its material and shape (shape can be modified) it would be most useful to simply link the generic cube and apply the material without having to “add” a new copy of the model access the geometry then set the material (which seems to be impossible in the same manner as an “added” object).

The only alternative I’m using right now is to have a cube of different materials (wood, metal, wallpaper) and then linking that. This solution becomes ineffective with things like models with multiple UV maps because you’d just have 6 different models or you’d add 6 of the same model in the scene composer to change it.

So in Short

Adding rather than linking creates scenes that take up massive amounts of memory by making an actual copy of each model in each scene, which is not helpful especially for Android applications where size is very important.

To avoid this and save memory you have to add all the materials at run time but makes the Scene Composers “link” ability much less effective for this case as all cubes such as walls, crates, floors, etc will have the same material until run time.

I feel there may be a way using a custom control or perhaps an apps state to make visualization of complicated scenes with many “linked” objects that have multiple materials per single linked object.

@BigBob said: Hi there,

I’m a huge fan of using the SDK’s scene composer for a lot of reasons. One thing I’d really find useful is if I could add Materials to linked objects (like a cube or a model with a few uv maps) So I can visualize my scene better and to save me some work adding the materials at run time.

Is this possible?

Thanks for reading!

what about to edit that linked file?

1 Like

@Ascaria

Reading your post I my first reaction was “Well of course I can do that.”

But rereading my original post I may not have been clear enough on my problem.

Let’s say I have a model with 5-6 uv maps. Or a generic object such as a cube. A cube can act as a floor or or wall or a crate based on its material. But, to “add” a new copy of this cube takes up more memory than just linking the cube.

But depending on the purpose this cube is serving the texture would be different. So linking the cube will always have the texture in the cube.j3o it’s referencing. I’m wondering if I can add a material in the Scene Composer via a custom control or property.

So basically Im trying to avoid
A) Using a massive amount of space being taken up by adding a model every time
B) Adding materials at run time to massive amounts of linked objects that consist of 100% of the scene. (Also can’t tell the difference between floor, wall, crate, etc until runtime)
C) Making a new object with the proper material then linking that (the solution I’m currently using)

@BigBob said: Adding rather than linking creates scenes that take up massive amounts of memory by making an actual copy of each model in each scene, which is not helpful especially for Android applications where size is very important.
This makes absolutely no difference at runtime. Idk what makes you think that it would. Adding or Linking is just a SDK scheme, the objects will be loaded in memory and placed in your scene graph at runtime. The idea behind linking is really having an object that you can have in several scenes and being able to change parameters on it and impact all scenes without having to tweak the model in each scene. You want to do the other way around, having a generic object and tweak it depending on the scene it's included in. This is the Add feature.

In other words, linking in the SDK is not the same as OpenGL “instancing” - if that makes sense, if not, please ignore my post :slight_smile:

@nehon

The fact that this is the case is what makes me believe it’s true.

If you want a simple test case simply make a new scene. Right click model and “add” to the scene 10 times. Then create another scene and “link” that object in the scene and I assure you the scene is much smaller.

I cannot explain my problem any clearer as I can assure you that the purpose of “linking” objects in the scene composer is meant to save space as you are not adding the entire .j3o to the scene but simply a link to it.

I assure you this is regular practice for me and I’d ask you to try my test case to see what specifically I mean.

I use the scene composer quite often and quite effectively and I’d be quite surprised that others who do use the scene composer do not know the difference between linking and adding objects.

Hello friends,

I apologize for bumping the topic but this has continued to stump me and I assure you the benefits would be extremely helpful!

Perhaps I could use a custom control to change the material in the scene editor of an object that is linked.

I have seen the videos that allowed the windmills to spin and the character to run around at the windmills!

I’d really like to know if I can use something similar to simply change the material!