amit
Members-
Posts
35 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by amit
-
yep, i too hope so. would be waiting for LE3. Good documentation is what i could have really wanted few weeks before. but thanks to this forum, its a lot of help.
-
Works like a charm, thanks. Where do you get all this info?
-
Hi, trying to print child mesh name, using: int mesh_childrencount = CountChildren(mesh1); dbprint("no of children for %s : %d", MeshName(mesh1), mesh_childrencount); for(int i=1; i<=mesh_childrencount; i++) { TEntity sm = GetChild(mesh1, i); TSurface ts = GetSurface(sm,1); str mat_name = MaterialName( GetSurfaceMaterial(ts) ); str entity_name = MeshName(sm); mat_surface_map.insert(mat_name,(void*)&sm); dbprint("surface : %d : %s : %s\n", i, mat_name, entity_name); } The material name prints well, but the mesh name does not. MeshName(mesh1) gives the file path of the gmf, From Model I get one root mesh, which has around 129 child mesh, each of them has a name as shown in Model viewer, but if i do the code above, it does not. If I open the model (in a .gmf) in Model Viewer, It shows all the child mesh name well. any suggestions?
-
access model and properties from InitDialog in class.lua
amit replied to amit's topic in Programming
sorry for late reply, was trying to test the code you gave (modified to my requirement), but wasn't working for me, here it is: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) function class:InitDialog(grid) local group, meshx, childrencount gridme = grid self.super:InitDialog(grid) meshx=object.model:GetChild(1) --return meshx:CountSurfaces() childrencount = meshx:CountChildren() group=grid:AddGroup( "Abc" ) group:AddProperty("aaaa",PROPERTY_INTEGER ,childrencount) end function object:Init() --group=gridme:FindGroup( "Xyz" ) --group:AddProperty("test",PROPERTY_CHOICE,"") end function object:SetKey(key,value) return self.super:SetKey(model,key,value) end function object:GetKey(key,value) --if key=="surfacecount" then -- abc=object.model:GetChild(1) -- --return abc:CountSurfaces() -- return abc:CountChildren() --else return self.super:GetKey(key,value) --end end object:Init() end the value of "aaaa" in group Abc is 0. If I uncomment all the code lines in GetKey() function, then the value comes to be 169 (which is right for my model). -
access model and properties from InitDialog in class.lua
amit replied to amit's topic in Programming
Please see the commented lines for my problem. require("scripts/class") local class=CreateClass(...) local gridme; function class:InitDialog(grid) local group gridme = grid self.super:InitDialog(grid) group=grid:AddGroup( "Abc" ) group:AddProperty("aaaa",PROPERTY_CHOICE,"") -- here i want to access the object/model instance but in all tried cases, -- I get error like "attempt to index field 'object' (a nil value)" -- local mymesh = class.super.object.model:GetChild(1) end function class:CreateObject(model) local object=self.super:CreateObject(model) function object:Init() -- This also does not, work. My guess is that this is not the place to code UI! --group=gridme:FindGroup( "Appearance" ) --group:AddProperty("aaaa",PROPERTY_CHOICE,"") end function object:SetKey(key,value) return self.super:SetKey(model,key,value) end function object:GetKey(key,value) return self.super:GetKey(key,value) end object:Init() end -
access model and properties from InitDialog in class.lua
amit replied to amit's topic in Programming
I didn't get it, ( not a lua programmer ), but InitDialog and CreateObject are both defined in class, <class>. Can you guide me with some code? -
Ok, now I know, how to mark it solved :-)
-
access model and properties from InitDialog in class.lua
amit replied to amit's topic in Programming
Hi, Thanks, looked at few scripts in editor for various objects, The function InitDialog(grid), is the one which is responsible for the property ui, but the only connection i can see to the model is via, SetKey() function, which is like a callback to AddProperty(). What I want to do is to check the no of children for model, and its assigned materials and list them in the ui, so it can be edited as required. somehow I would like to access the model instance in InitDialog function, but was not able to do so. Any suggestions? -
Hi, As far as i understand there is only one type of PropertyDialog for all objects if we use, require("scripts/myclass") local class=CreateClass(...) in the class lua script. But now I want to read the model while the creation of UI < class:InitDialog(grid) >, which seems to be not possible in current setting as model is created only when we create an instance of it, Right? < class:CreateObject() > q1) Is it possible to get and use model class, while ui creation? q2) Is it possible to create ui for each instance, and also created in CreateObject code, so ui can be customized as required! Also, all this had to be figured out, so any link to details of editor working would be great help. If any trouble understanding what I wrote, please let me know, I'll try to detail it more.
-
[Sorted] No of surfaces are less than expected, 3ds export
amit replied to amit's topic in General Discussion
The .3ds seems ok in UU3d, and thanks to DaDonik, gmf exported from UU3d, is as expected with 8 surfaces. Some how 3ds2gmf.exe is far optimizing the model to club 4 surfaces together, and on what logic, I am not able to get. ... ... wait I think I can get some thing to it ..... Fount it ... It seems that "3ds2gmf.exe" is coupling all surfaces with materials having "texture applied to it,", to the very first ok surface. It may also be that this does happen because of texture name or if texture not found or something like that. hope someone can shed some light on it. -
[Sorted] No of surfaces are less than expected, 3ds export
amit posted a topic in General Discussion
Hi, I am exporting a 3ds file from 3d studio max. The export as such goes fine ( .max->[3d studio max]->.3ds->[3ds2gmf.exe]->.gmf ). I can view the model in ModelViewer, all white and grey. There are 8 material applied to model in 3d studio max. But somehow only 5 sufaces are shown in ModelViewer, (Also confirmed programatically in c/c++). Even thou the mesh is full, the first surface seems to contain a number of meshes combined. If this is a problem with 3d studio 3ds export? or with 3ds to gmf export? Anything else please suggest? -
That there, but not as structured or detailed as would have wanted it. Anyways thanks for the help up there, really worked for me. Now, I am stuck somewhere else. Only 5 surfaces exported from 3ds max. Time to get support.:-)
-
So, It is not possible to change material for individual surfaces, without programing. Well, back to coding (c/c++ for me). Maybe I can do some Lua Stuff and make it happen in Editor itself! Thanks, @ChrisMAN : Thanks for the info.
-
Yep its, GetChild(model, index=1), thanks a lot. Any text/Manual/Guide i can refer to for such kind of info?
-
Hi, Just starting with leadwerk after a long time. What I am trying is to load a scene(a small building) from 3ds max. The scene contains 15 odd meshes in it and 6 materials, including 1 glass type material. I am exporting is to 3ds format, and then usinf 3ds2gmf.exe converting it to a .gmf file. Now I am using c/c++ for coding an loading the .gmf file using LoadModel(). My idea is now to assign material to different meshes in it, which I can not as there is no function to getsurfaces from TModel type. I think is suppose to be TModel<-TMesh<-TSurface, while getting Surface from mesh is possible, but getting mesh from model ... I do not know. Any suggestion?
-
Oh yes, not to worry, it was all taken with good heart. But wha you are saying is for the "Editor", I was looking for something in "Model Viewer".
-
Yes, you are right. It certainly is a good guide with all the small details for beginers. Thanks to Aggror for it. Not just lazyness, but also that, so many 3d engines, so many ways of doing things .... :-). Just need to settle out things. But is there any way to "see / change / set" Materials for a .gmf in "Model Viewer", i.e. before exporting it to editor.
-
yes, that works perfectly. Thank you. Also any way to try different material for different .gmf in "model viewer"? Anyways for any one else, whos is too lazy to read fully the user guide (a copy-paste fom user-guide): 1) Double click on the reference object in the hierarchy (not its instances that are placed in the scene) in the editor. 2) The Lua script editor will open. Place this code in the Lua file and press save. require("scripts/class") local class=CreateClass(...)
-
May be commenting a month later ..., But Even if we get the model in the leadwerk edit, there is no propery, we can not assign any material. 1)I am exporting from 3dsmax -> .3ds format -> 3ds2gmf.exe -> .gmf format. 2) Copy the gmf in model directory (this bring the model in editor) 3) make an instance and right click for propery, here the property window is empty???
-
I am really not liking the export mechanism with LE. (specific to 3d studio max) Trying to export from 3d studio max (mesh - > editable mesh -> export to fbx -> y-axis up -> "verbose-less model convertor" -> ~gmf ), but am facing a lot of troubles, specially with normals. So this is just a request to have a step by step, process / tutorial of exporting a mesh from 3d studio max to LE, with details of steps which have to be done before exporting to to fbx, then fbx->gmf conversion. Or if there is any other better way. I know this has more to do with 3d studio max, but then, 3d studio max has a lot to do with a lot of game developers. A version above 2010 or above autodesk fbx exporter would be likable. Also really feeling the pain of not having scale mechanism build in, in the editor. Would it be in LE3, and would it be in for us who have bought <LE3. #When is LE3 expected?
-
HUD, water body, Modeled and divided Terrain with LOD, and more
amit replied to amit's topic in General Discussion
Still google(199usd to inr) < google(138.93€ to inr) -
HUD, water body, Modeled and divided Terrain with LOD, and more
amit replied to amit's topic in General Discussion
Your Profile -> Friend Josh -> send pm .. done tree search! thanks again. -
HUD, water body, Modeled and divided Terrain with LOD, and more
amit replied to amit's topic in General Discussion
$50 only, woah .... oh wait that upgrade. I prefer google checkout thou . -
HUD, water body, Modeled and divided Terrain with LOD, and more
amit replied to amit's topic in General Discussion
now what to do, mail it to support ?? -
HUD, water body, Modeled and divided Terrain with LOD, and more
amit replied to amit's topic in General Discussion
and coupons anyone ... B)