64 for (
int i = 0; i < srcList.Count(); i++)
66 prefab = srcList.Get(i);
67 if (prefab.GetClassName() == name)
86 ResourceName ancestor = ancestorSource.GetResourceName();
93 int hierarchy = GetPrefabParamIndex(prefab, EBTContainerFields.hierarchy);
100 prefabSocket.Get(EBTContainerFields.pivot, pivotID);
102 response.ids.Insert(prefab.GetID().ToString());
103 response.pivots.Insert(pivotID);
108 response.pivots.Insert(
"xxx");
117 if (prefab.IsVariableSet(EBTContainerFields.coords))
119 prefab.Get(EBTContainerFields.coords,
coords);
126 if (prefab.IsVariableSet(EBTContainerFields.scale))
128 prefab.Get(EBTContainerFields.scale,
scale);
137 if (prefab.IsVariableSet(EBTContainerFields.angles))
139 prefab.Get(EBTContainerFields.angles,
angles);
146 int parentObjectID = GetPrefabParamIndex(parent, EBTContainerFields.meshObject);
147 if (parentObjectID != -1)
150 string parentFbx = GetFBXPath(parent, parentObjectID, EBTContainerFields.object, response,
false);
151 for (
int i = response.fbx.Count() - 1; i > 0; i--)
154 if (response.fbx.Count() > 1 && parentFbx == response.fbx[i])
156 response.parents.Insert(i);
164 response.coords.Insert(
coords);
165 response.scales.Insert(
scale);
166 response.angles.Insert(
angles);
170 if (response.parents.Count() != response.coords.Count())
172 response.parents.Insert(-1);
176 int meshObjectID = GetPrefabParamIndex(prefab, EBTContainerFields.meshObject);
180 if (meshObjectID != -1)
182 string fbxPath = GetFBXPath(prefab, meshObjectID, EBTContainerFields.object, response,
true);
184 if (fbxPath.Contains(
".fbx"))
186 response.fbx.Insert(fbxPath);
187 ReadAncestor(ancestorSource, response,
true);
194 response.fbx.Insert(
"Collection-" +
FilePath.StripExtension(
FilePath.StripPath(prefab.GetResourceName())));
195 ReadAncestor(ancestorSource, response,
true);
205 array<string>
sourceMat =
new array<string>;
206 Workbench.GetAbsolutePath(prefab.GetResourceName().GetPath(), absPath);
207 BaseContainerList srcList = prefab.GetObjectArray(EBTContainerFields.components);
212 GetPrefabEmat(prefabMesh, response);
215 prefabMesh.Get(meshVarName, relXob);
216 Workbench.GetAbsolutePath(relXob.GetPath(), output);
217 output.Replace(
"xob",
"fbx");
218 if (!
FileIO.FileExists(output)){
229 array<string>
sourceMat =
new array<string>;
235 for (
int i = 0; i <
sourceMat.Count(); i++)
242 Workbench.GetAbsolutePath(
ematPath.GetPath(), absPathEmat);
245 response.sourceMat.Insert(response.fbx.Count().ToString() +
"|" + matName);
259 if (ancestorMain == empty)
265 ReadChild(prefab, response);
267 ReadAncestor(ancestorMain, response, getMeshObject);
275 for (
int i = 0; i < prefab.GetNumChildren(); i++)
278 if(EBTContainerFields.supportedTypes.Contains(child.GetClassName()))
280 GetPrefabParams(child, response);
287 ResourceManager resourceManager = Workbench.GetModule(ResourceManager);
289 MetaFile meta = resourceManager.GetMetaFile(
path);
291 BaseContainer prefab = resource.GetResource().ToEntitySource();
300 GetPrefabParams(prefab, response);
301 ReadChild(prefab, response);
308 const int DATA_CAP = 60000;
310 for (
int i = 0; i < startIndex; i++)
312 response.fbx.RemoveOrdered(0);
313 response.scales.RemoveOrdered(0);
314 response.angles.RemoveOrdered(0);
315 response.coords.RemoveOrdered(0);
316 response.pivots.RemoveOrdered(0);
317 response.parents.RemoveOrdered(0);
321 while (response.GetSizeOf() > DATA_CAP)
323 response.fbx.RemoveOrdered(response.fbx.Count()-1);
324 response.scales.RemoveOrdered(response.scales.Count()-1);
325 response.angles.RemoveOrdered(response.angles.Count()-1);
326 response.coords.RemoveOrdered(response.coords.Count()-1);
327 response.pivots.RemoveOrdered(response.pivots.Count()-1);
328 response.parents.RemoveOrdered(response.parents.Count()-1);
330 int stopIndex = response.fbx.Count() + startIndex;