mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-16 10:22:59 +08:00
Ability to edit YTYP files and MLO Entity Defintions + Revisions to grass brush (#33)
* - Add ability to edit/add ytyp files to project. - Add ability to edit/add ytyp archetype files to ytyp. - Add ability to add/remove entities from mlo archetype defs. - Add ability to save ytyp files. - Add dialog popup before optimizing grass batches. - Fix grass batches not being selected when chaning selection in project explorer. - Merged with upstream/master. - Squashed last 4 commits for PR cleanliness. * Fixed windows forms reference error. * - Added error checking to deleting mlo entities. - Fixed various bugs with deleting mlo entities. - Fixed edit archetype panel Asset Type box. - Removed redundant/unnecessary. - Removed backwards references between MCEntityDef and YmapEntityDef. All ymap entity to mcentity references are grabbed using indecies in the MloInstanceData class. - Fixed "YmapMenu" not showing when selecting entities/mlo entities in project form. Current bugs: - Loading a ytyp file -- mlo entities are not editiable, and are created in the world. - entitysets are not editable (properly). - Removing an mloinstancedef from a ymap does not delete the mlo instance's gizmo from the world, and it's still selectable. (Although all references are lost, and I believe collected by the GC?) * - Moved archetype initialization methods YmapFile.InitYmapEntityArchetypes(GameFileCache gfc) and MloInstanceData.InitYmapEntityArchetypes(GameFileCache gfc) - Added ability to load mlo instance defs through ymap files. - Fixed add method for mlo archetypes. * - Removed SetOrientationInv. - Removed unreachable code + updated comment. - Renamed CreateEntity to CreateYmapEntity, and renamed params for consistency. * Split calls to CreateYmapEntity() and MloArchetype.AddEntity(). * Fixed redundant rotation inversions. * - Added ability to select rooms. - Changed tree view grouping for mlo entities. - Fixed projectexplorer selection bugs. - Added ability to toggle mlo entity sets. - Fixed some change events when editing archetypes.
This commit is contained in:
committed by
dexyfex
Unverified
parent
4da1e3d8c7
commit
462e464c2f
+45
-14
@@ -1745,24 +1745,55 @@ namespace CodeWalker.Rendering
|
||||
|
||||
if (renderinteriors && ent.IsMlo) //render Mlo child entities...
|
||||
{
|
||||
if ((ent.MloInstance != null) && (ent.MloInstance.Entities != null))
|
||||
if ((ent.MloInstance != null))
|
||||
{
|
||||
for (int j = 0; j < ent.MloInstance.Entities.Length; j++)
|
||||
if (ent.MloInstance.Entities != null)
|
||||
{
|
||||
var intent = ent.MloInstance.Entities[j];
|
||||
if (intent.Archetype == null) continue; //missing archetype...
|
||||
if (!RenderIsEntityFinalRender(intent)) continue; //proxy or something..
|
||||
|
||||
intent.IsVisible = true;
|
||||
|
||||
var iebscent = intent.Position + intent.BSCenter - camera.Position;
|
||||
float iebsrad = intent.BSRadius;
|
||||
if (!camera.ViewFrustum.ContainsSphereNoClipNoOpt(ref iebscent, iebsrad))
|
||||
for (int j = 0; j < ent.MloInstance.Entities.Length; j++)
|
||||
{
|
||||
continue; //frustum cull interior ents
|
||||
}
|
||||
var intent = ent.MloInstance.Entities[j];
|
||||
if (intent.Archetype == null) continue; //missing archetype...
|
||||
if (!RenderIsEntityFinalRender(intent)) continue; //proxy or something..
|
||||
|
||||
renderworldentities.Add(intent);
|
||||
intent.IsVisible = true;
|
||||
|
||||
var iebscent = intent.Position + intent.BSCenter - camera.Position;
|
||||
float iebsrad = intent.BSRadius;
|
||||
if (!camera.ViewFrustum.ContainsSphereNoClipNoOpt(ref iebscent, iebsrad))
|
||||
{
|
||||
continue; //frustum cull interior ents
|
||||
}
|
||||
|
||||
renderworldentities.Add(intent);
|
||||
}
|
||||
}
|
||||
if (ent.MloInstance.EntitySets != null)
|
||||
{
|
||||
foreach (var entitysets in ent.MloInstance.EntitySets)
|
||||
{
|
||||
var entityset = entitysets.Value;
|
||||
if (!entityset.Visible) continue;
|
||||
|
||||
var entities = entityset.Entities;
|
||||
for (int i = 0; i < entities.Count; i++)
|
||||
{
|
||||
var intent = entities[i];
|
||||
if (intent.Archetype == null) continue; //missing archetype...
|
||||
if (!RenderIsEntityFinalRender(intent)) continue; //proxy or something..
|
||||
|
||||
intent.IsVisible = true;
|
||||
|
||||
var iebscent = intent.Position + intent.BSCenter - camera.Position;
|
||||
float iebsrad = intent.BSRadius;
|
||||
if (!camera.ViewFrustum.ContainsSphereNoClipNoOpt(ref iebscent, iebsrad))
|
||||
{
|
||||
continue; //frustum cull interior ents
|
||||
}
|
||||
|
||||
renderworldentities.Add(intent);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user