Page 1 of 1

Spawn Entity in Editor

Posted: Fri Apr 07, 2017 12:08 pm
by JonathanSTG
Hi,
Coding in C++ I was looking for spawning an entity that could be then manipulated in editor (position, scale, rotation etc...).
It does not seem to be possible, which is very regrettable but may be I did not find the solution. Has any one tried/succeed to spawn
an entity with C++ code and then make it handle in the sandbox?

Thank you.

Re: Spawn Entity in Editor

Posted: Fri Apr 07, 2017 1:12 pm
by @eisenkolb
Check out the GeomEntity class inside the CryDefaultEntities.
  • > Code/CryPlugins/CryDefaultEntities/Module/Geometry/GeomEntity

Re: Spawn Entity in Editor

Posted: Tue Apr 11, 2017 9:37 am
by JonathanSTG
Thansk,
I did an eye on this and did not see anything related to sandbox handling but I will check further

Re: Spawn Entity in Editor

Posted: Fri May 12, 2017 12:48 pm
by JonathanSTG
Okay it seems to be related to CDesignerEntityComponent but I don't know how I can access it from a C++ Project, is there a special CMake configuration to access the files in the CryDefaultEntities?

Re: Spawn Entity in Editor

Posted: Fri May 12, 2017 1:54 pm
by mknmknmknjk
i doubt that

search

void MarkEntityForSerialize(TSerializationData& data, IEntity* pEntity, int reason, bool markParent = true)

it is about level Serialization

search
GetEntity()->GetFlags() & ~ENTITY_FLAG_NO_SAVE for markng entity to save to level

http://docs.aws.amazon.com/lumberyard/l ... ation.html

http://www.crytek.co.kr/confluence/disp ... ool+System


search ENTITY_EVENT_XFORM_FINISHED_EDITOR

ENTITY_EVENT_RESET

ENTITY_EVENT_PRE_SERIALIZE

ENTITY_EVENT_POST_SERIALIZE

ENTITY_EVENT_EDITOR_PROPERTY_CHANGED

to find where event send . they are related to editor

Re: Spawn Entity in Editor

Posted: Tue May 16, 2017 2:03 pm
by JonathanSTG
Well actually I am spawning my entities with flags = 0 so ENTITY_FLAG_NO_SAVE is not set. The events sent from editor can be caught but my entity is not editable from the sandbox. I think that you are referring to some CryEngine 3.x functions because there is not EntityPoolManager in CryEngine V.

Re: Spawn Entity in Editor

Posted: Tue May 16, 2017 2:20 pm
by mknmknmknjk
create entity like LightEntity.h test function call

hard way . add gizmo proxy, register mouse hover or click drag event. then move entity to gizmo position.

the core is event driving

virtual uint64 GetEventMask() const override { return BIT64(ENTITY_EVENT_START_LEVEL) | BIT64(ENTITY_EVENT_RESET) | BIT64(ENTITY_EVENT_EDITOR_PROPERTY_CHANGED) | BIT64(ENTITY_EVENT_XFORM_FINISHED_EDITOR); }

i did not find where send ENTITY_EVENT_XFORM_FINISHED_EDITOR event in source code . may be from lua or other dll ?