public static void LoadT() { CleanAssetDatabase(); string path = EditorUtility.OpenFilePanel("Overwrite with png", "", "*"); Debug.Log(path); var model_agent = new ModelAgent(path); MMD.PMX.PMXFormat pmx_format; try { //PMX読み込みを試みる pmx_format = PMXLoaderScript.Import(model_agent.file_path_); } catch { //PMXとして読み込めなかったら //PMDとして読み込む MMD.PMD.PMDFormat pmd_format = PMDLoaderScript.Import(model_agent.file_path_); pmx_format = PMXLoaderScript.PMD2PMX(pmd_format); } var fbxGameObject = MMD.PMXConverter.CreateGameObject(pmx_format, false, MMD.PMXConverter.AnimationType.LegacyAnimation, false, 1f); fbxGameObject.transform.SetParent(GameObject.Find("Parent").transform); fbxGameObject.transform.localScale = new Vector3(0.085f, 0.085f, 0.085f); fbxGameObject.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f); }
protected void Init(Point3D pos, Vector3D look, Vector3D up) { OriginPosition = pos; OriginLookDir = look; OriginUpDir = up; Agent = new ModelAgent(this); }
/// <summary> /// Create pmx from pmx list /// </summary> private void CreatePmx() { var model_agent = new ModelAgent(Statement.PmxFiles[Statement.CurrentPmx]); PMXFormat pmx_format; try { //PMX読み込みを試みる pmx_format = PMXLoaderScript.Import(model_agent.file_path_); } catch { //PMXとして読み込めなかったら //PMDとして読み込む var pmd_format = PMDLoaderScript.Import(model_agent.file_path_); pmx_format = PMXLoaderScript.PMD2PMX(pmd_format); } fbxGameObject = PMXConverter.CreateGameObject(pmx_format, false, PMXConverter.AnimationType.LegacyAnimation, false, 1f); fbxGameObject.transform.SetParent(GameObject.Find("Parent").transform); fbxGameObject.transform.localScale = new Vector3(0.085f, 0.085f, 0.085f); fbxGameObject.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f); }
//meta! userInfo="Generated code: do not modify", tag="begin" private void Init() { ModelAgent = new ModelAgent(SimId.ModelAgent, this, null); VehiclesAgent = new VehiclesAgent(SimId.VehiclesAgent, this, ModelAgent); BusStopsAgent = new BusStopsAgent(SimId.BusStopsAgent, this, ModelAgent); StadiumAgent = new StadiumAgent(SimId.StadiumAgent, this, ModelAgent); ExternalEnvironmentAgent = new ExternalEnvironmentAgent(SimId.ExternalEnvironmentAgent, this, ModelAgent); }
/// <summary> /// Create pmx from pmx list /// </summary> private void CreatePmx() { var modelAgent = new ModelAgent(CurrentMmdObject.FilePath); PMXFormat pmxFormat; try { pmxFormat = PMXLoaderScript.Import(modelAgent.file_path_); } catch { var pmdFormat = PMDLoaderScript.Import(modelAgent.file_path_); pmxFormat = PMXLoaderScript.PMD2PMX(pmdFormat); } _fbxGameObject = PMXConverter.CreateGameObject(pmxFormat, false, PMXConverter.AnimationType.LegacyAnimation, false, 1f); _fbxGameObject.transform.SetParent(parent.transform); _fbxGameObject.transform.localScale = new Vector3(0.085f, 0.085f, 0.085f); _fbxGameObject.transform.localRotation = new Quaternion(0f, 0f, 0f, 0f); }