About Store Forum Documentation Contact



Post Reply 
import of 1.0 project (material in object)
Author Message
yvanvds Offline
Member

Post: #1
import of 1.0 project (material in object)
Hello again.

I know i should have done it a lot earlier, but somehow I succeeded in delaying the import of my Attr-X project from esenthel 1.0 format to the new editor blushing

There's this problem:

Materials which are set in the mesh editor import fine. But The object editor (in the old world editor) allows you to adjust the material too. The objects with a material set in there look fine in the editor, but when I try to run the game, i get a message that the material file cannot be found. It still tries to load the material by its old name, so I guess that's the problem.

I've included a very simple data folder to import, which illustrates the problem. If you just import it and add the code from tutorials/game basics/world, the error will be clear.

(I understand if you don't want to work on that import function anymore. I was looking at the source code for import project, but I cannot figure out where the material is copied. I guess it is somewhere along with ObjParam, but I can't find anything about materials there. Perhaps a few pointers would be enough to help me on my way.)

Anyway, a bit of help would be welcome. It's quite a big project and I had hopes of finalizing it within the year wink

Regards,

yvan


Attached File(s)
.7z  test.7z (Size: 695.28 KB / Downloads: 3)
10-08-2014 09:00 PM
Find all posts by this user Quote this message in a reply
yvanvds Offline
Member

Post: #2
RE: import of 1.0 project (material in object)
Yeah, it's thousands of objects in my case, grass included. And the error only says which material is involved, not which object should be adjusted.

Edit: Oh wait, I can do it in the object editor I think. It might be doable if i keep on cursing long enough smile
(This post was last modified: 10-08-2014 09:35 PM by yvanvds.)
10-08-2014 09:27 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: import of 1.0 project (material in object)
Hi,

I could easily adjust the import codes to clear the material adjustment to NULL, as custom material override in latest EE is not yet supported.
Would that be OK?
10-09-2014 12:34 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: import of 1.0 project (material in object)
Please update the
"Shared/Params" in the Editor source, to update the following function
Code:
void copyTo(Game.ObjParams &obj, C Str &game_path, bool zero_align, C UID *mesh_id, C UID *phys_id)C // 'zero_align' should be set only to ELM_OBJ
   {
      super.copyTo(obj);
      obj.access  (FlagTest(flag, OVR_ACCESS), access    );
      obj.type    (FlagTest(flag, OVR_TYPE  ), type      );
      obj.constant(FlagTest(flag, OVR_CONST ), constant());
      obj.path    (FlagTest(flag, OVR_PATH  ), path      );
      obj.align   (zero_align);
      UID base_id=base.id();                                      if(!base_id.valid())obj.base(null);else obj.base(      game_path+EncodeFileName( base_id));
                             if(!mesh_id)obj.mesh    (false);else if(!mesh_id.valid())obj.mesh(true);else obj.mesh(true, game_path+EncodeFileName(*mesh_id));
                             if(!phys_id)obj.phys    (false);else if(!phys_id.valid())obj.phys(true);else obj.phys(true, game_path+EncodeFileName(*phys_id));
                                         obj.material(false);
      FREPA(sub_objs){C SubObj &src=sub_objs[i]; if(!src.removed)obj.sub_objs.New().base(game_path+EncodeFileName(src.elm_obj_id)​);}
   }
10-09-2014 12:45 AM
Find all posts by this user Quote this message in a reply
Post Reply