Jump to content

.fbx files containing more than 1 model, is there a way to use the single parts in Leadwerks 3.1?


Mordred
 Share

Recommended Posts

Hello,

 

another (hopefully not to dumb) question. In this case it's about models in .fbx format. I have a modelpackage that contains only one .fbx file, but in this file are several different models included (trees and flowers). Is there a way to use the single models in Leadwerks 3, or do i have to somehow import the .fbs file into some program and export every model on it's own by myself?

 

I know from Unity3d that you can access the several models containing a single .fbx file by clicking a small "arrow" near the package, thus it collapses and shows me the single parts. But i cannot export the single files as .fbx in Unity3d.

Link to comment
Share on other sites

Is there a way to use the single models in Leadwerks 3, or do i have to somehow import the .fbs file into some program and export every model on it's own by myself?

 

Yes you will have to import your model in some program , than export the object you want only.

LE3 model editor don't allow to select sub objects and export them or make a new model from them.

Stop toying and make games

Link to comment
Share on other sites

Does anybody know if that "sub objects" thingy is on the "to do" list? Because i've seen several such .fbx files in the last few days...

 

What do you really want ? access child objects of FBX by code to manipulate them by code ?

Or be able to extract sub objects and make them standalone object using LE3 model editor ?

Could you explain it clearly please ?

(even if i think objects creation, manipulation should stay on you modeling App)

Stop toying and make games

Link to comment
Share on other sites

It's actually the 2nd part you mentioned YouGroove. If i have a multimodel (it doesn't have to do with children or smth. like that, it's just that the file does contain more than 1 model at a time). I'd like to see a way to extract those sub objects to use them individually, as it is possible in Unity3d for e.g. The problem is: Several finished model files you can buy actually are (!) multiobject .fbx files.

 

@Gamecreator, thanks for your reply too, but it's not that i want to access "child object". Say, you have 3 different tree models and want to save them. You can either use one file containing all 3 models, or 3 files containing a single model each. If i have the file containing the 3 models, i want to use those individually.

Link to comment
Share on other sites

. I'd like to see a way to extract those sub objects to use them individually, as it is possible in Unity3d for e.g. The problem is: Several finished model files you can buy actually are (!) multiobject .fbx files.

 

A common example of this is for instance a tree pack with say 5 trees that all share the same leaf/bark textures.

 

It stands to reason that you'd be able to import the fbx file containing all 5 trees and then use them as individual objects/prefabs/models ( not sure what term LE uses in the editor )

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

ok.

So the response is no, LE 3 model editor don't allow to edit or extract models.

Just use some modeling software where you can import objects and export the sub object you want.

 

@Guppy :

Objects number is performance problem for 3D engines.

For trees, better use engine tree painting system, if your game is not terrain based, keeping trees as one model is lot more fast for the engine than have 5 individual trees.

 

Some engines like Unity have a great feature : Combine static models as one model on your level, this you you greatly improve performance, so not bad thing to have models grouped as one object sometimes.

Stop toying and make games

Link to comment
Share on other sites

Yea, well, but in this specific case i bought a whole set of Treemodels, with and without leaves. The .fbx file is one large File containing all trees, so far not a problem but.

 

1. i want to attach scripts on each individual tree

2. in the package are those models without leafs and i do not want to use those at all.

 

Well, i gonna take a look if i can extract them on my own. I just was wondering if there's any information about how that's done in the future.

Link to comment
Share on other sites

@Gamecreator, thanks for your reply too, but it's not that i want to access "child object". Say, you have 3 different tree models and want to save them. You can either use one file containing all 3 models, or 3 files containing a single model each. If i have the file containing the 3 models, i want to use those individually.

I understood you clearly and I've now tested my theory and it's correct. If you load only ONE model file with three models inside that file, CountChildren returns 3.

 

I exported one FBX with three models in it and the below code returned 3.

 

function App:Start()
	--Create a window
	self.window = Window:Create()
	self.context = Context:Create(self.window)
	self.world = World:Create()
	local camera = Camera:Create()
	camera:SetRotation(35,0,0)
	camera:Move(0,0,-3)
	local light = DirectionalLight:Create()
	light:SetRotation(35,35,0)

	--Load a model
	self.entity = Model:Load("Models/3objects.mdl")

	return true
end

function App:Loop()

	if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end

	Time:Update()
	self.world:Update()
	self.world:Render()

	self.context:SetBlendMode(Blend.Alpha)
	self.context:DrawText("The entity has "..self.entity:CountChildren().." children.",2,2)

	self.context:Sync()

	return true
end

  • Upvote 1
Link to comment
Share on other sites

Oh sorry @ Gamecreator in that case i missunderstood you. I thought your question was depending on Scenetab where you can hit "+" on such models (what doesn't work in this case sadly).

Okay so basically, the engine is capable to "see" that there are several models in that .fbx file. But it sound's like a mess to select a specific one out of that file, especially in my case because the model consists of roughly 40 diff. trees.

 

Just as i sidenote, i wrote the creator of the models if he can supply them as single files for each entity, no response yet though. But as said, those "multi model files" occured several times to me, so it would be a cool feature (well, i might add this to "feature request" in a while) to be able to just select and place the individual models.

Link to comment
Share on other sites

I sort of feel like this isn't a very common thing. Every tree model I've ever purchased were separated. So he actually has 40 DIFFERENT tree models all in 1 model? If even 1 of those are repeated you are wasting memory and for sure should get them separated out.

Link to comment
Share on other sites

Well,

 

another example where that happens. If you look at the video of Arteria3d of the "OBM" Model it's a single character with several types of armor, clothing, faces etc. That's again one single large file containing everything.

 

http://arteria3d.com/products/obm

 

Anyways, if that's really not that often i just might've had some bad luck that i had contact to several of those files, in that case i have to admit that it's not really needed to change anything from what is possible right now. Well, i just wait for the response of the creator of those trees if i can get the stuff as individual files.

 

Thanks for all your effort.

Link to comment
Share on other sites

That's again one single large file containing everything.

 

I think the way this was meant to be handled is to load everything and find all the child gear and call :Hide()/:Show() based on the ones you want. I seem to recall talking with the creator about that (I recommended he do something like this although I was more thinking it wouldn't be a hide/show thing)

 

You might think that's a waste to load everything, but you have to remember that if the player can wear any of those at any time, then you'd want to preload the individual pieces anyway or else you'll get a pause while it loads because LE doesn't load models in separate threads. So loading them all and just show/hide what you need makes sure if they switch gear it's instant.

  • Upvote 1
Link to comment
Share on other sites

I has advvantages and disadvantages.

 

Show , Hide () si more easy than attach by script.

But it's lot more memory space : a character with 20 complex armors

Attaching by code you have just one armor in memory.

I would say, really suited for Mobile , or low poly, not for Next Gen character with complex armos and bitmaps materials.

 

A 3D artist delivering trees as a single file, this is bad client delivery indeed.

OR at least he should give the two versions: one FBX for people interested and all objects separate as individual FBX files.

 

I agree loading time all in one file will be great, like texture atlas containing textures for lot of objects.

That's why i asked in Suggestions, for the ability when you have made a level complete : to "MERGE" several models together as one model. This would result in one model only.

 

If trees have wind waving shaders i'm not sure if all in one can work ?

Or apply shader to childs possible ?

Same for script , can you apply different scripts on different child objects ?

Stop toying and make games

Link to comment
Share on other sites

@Gamecreator what if you try copying the child models? Will it just copy the child model (basically allowing us in code to break apart models that are like this?)

Good question. I don't know for sure but I believe that's the case as you can scale and color and whatnot individual children (at least you could in 2.5). I don't know Lua though (I barely got the above to work, even if I copied most of it from the docs). If you want to give me the code to add to the above, I'll try it at home and report back.

Link to comment
Share on other sites

@Guppy :

Objects number is performance problem for 3D engines.

For trees, better use engine tree painting system, if your game is not terrain based, keeping trees as one model is lot more fast for the engine than have 5 individual trees.

We are going off topic here but that's a really weird way to look at it - I mean it would properly also be faster if I replaced every single model with a cube, but as they say diversity is the spice of life. And if I decide to build my forest out of 5 different base trees where instances can then be randomly rotated and scaled then I don't see why any modern day engine should struggle with that

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...