Author Topic: Cash prize for Collada - POF support!  (Read 123467 times)

0 Members and 1 Guest are viewing this topic.

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Cash prize for Collada - POF support!
So I got this up and running and it's all very nice. But I'm running into the same problem with one model that I had with the max exporter: Submodels that are outside the bounding box of detail0 are ghosting (shoot-though, fly-through).
Is that a problem with PCS2 or engine-related? I suspect PCS2, because we have some old TBP models that were created with PCS1.X and are working fine, but also have submodels outside the detail0 bounding box, so it was possible at one point.

I know the problem can be circumvented by some cleverly placed polys attached to detail0, but that's kinda the non-elegant solution  :blah:
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Cash prize for Collada - POF support!
VA was discussing that issue a long time ago.  This is I think an engine problem that needs to be solved much more gracefully than it can be now.  Even if PCS2 could try and guess all possible subobject locations including rotations and expand the bounding box to include those, things like subobject translation (which I believe are only determinable when they happen) still make that fail I believe.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Col. Fishguts

  • voodoo doll
  • 211
Re: Cash prize for Collada - POF support!
So any idea what PCS1.X did different with the bounding boxes so that it didn't suffer from this problem?
"I don't think that people accept the fact that life doesn't make sense. I think it makes people terribly uncomfortable. It seems like religion and myth were invented against that, trying to make sense out of it." - D. Lynch

Visit The Babylon Project, now also with HTL flavour  ¦ GTB Rhea

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Cash prize for Collada - POF support!
Maybe it did something that's technically 'wrong' but seemed to work ok? Or maybe PCS2 isn't doing something that it would be fine if it did, I don't know.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Cash prize for Collada - POF support!
Yeah I don't get this thing. I open a .dae file in PCS2 that was exported out of Maya and all of my weapon points are in the wrong place and facing the wrong direction and so on and so forth. Oh and it's not reading the textures for some reason. Even though a previous build DOES read the textures (I downloaded what I take to be the newest one from the Wiki).

In either case the model enters at an odd angle, and half of the components seem shifted. So the actual fighter model for example seems shifted forward which results in the shield and all weapon/dock/subsystem points being in the wrong place (further back than they should be and/or at a wrong elevation relative to the model).

What the heck.

EDIT - oh I downloaded a different file off the Wiki (Jan 4 2009 build??) and it loads the textures but the ship is still out of sync with all of the relevant information. Including the shield and all points. Meanwhile in Maya, the shield mesh and the fighter mesh for example  both have translates of 0,0,0. So why when imported are they different????
« Last Edit: July 23, 2009, 05:09:44 pm by Akalabeth Angel »

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: Cash prize for Collada - POF support!
So I got this up and running and it's all very nice. But I'm running into the same problem with one model that I had with the max exporter: Submodels that are outside the bounding box of detail0 are ghosting (shoot-though, fly-through).
Is that a problem with PCS2 or engine-related? I suspect PCS2, because we have some old TBP models that were created with PCS1.X and are working fine, but also have submodels outside the detail0 bounding box, so it was possible at one point.

I know the problem can be circumvented by some cleverly placed polys attached to detail0, but that's kinda the non-elegant solution  :blah:

Try setting all subobject centers to 0,0,0 in your modeling program.  Convert the model then move them back in PCS2.  Usually solves that issue.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 
Re: Cash prize for Collada - POF support!
Hmmn, so somewhat inspired by fubar's message I reset transformations on my model and that seemed to get everything more/less where it's supposed to be. Or more accurately the guns are in the right place. Then however, I discover my fighter is upside down and backwards for some odd reason.  So I rotate it around. But NOW, my docking points and my thrusters are in the wrong places, while everything else remains the same. I parented everything to a locator in maya when I rotated it to get it rightside up so I don't know why these would be in teh wrong place why everything else is in the right place. I am however reminded of why I lost interest in modding.

Maybe I'll just have to shift/re-do this stuff in PCS2 since for whatever reason it's clearly not translating properly.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
There are options to rotate/flip everything in PCS 2 for Collada importing.

 
Re: Cash prize for Collada - POF support!
There are options to rotate/flip everything in PCS 2 for Collada importing.

Oh is there? Okay maybe I'll have to look into that next time. I just fixed the stuff more/less manually this time. Should be good enough.
Thanks

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Cash prize for Collada - POF support!
A question for anyone still working with this, how does the importer behave when there are things as lights in the null hierarchies?

As i have a rather retarded situation with Cinema4D's collada exporter...
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
I can still work on this but I have no idea how it would behave.

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Cash prize for Collada - POF support!
well, perhaps just make it completely drop any data from lights found and then to parse the helper tree structure?
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
What do lights turn into? Anything that doesn't have a special name and doesn't have any associated geometry should get ignored.

What exactly is the importer doing that isn't what you'd like?

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Cash prize for Collada - POF support!
sometimes the transforms that were on the lights get applied to the nulls which shouldnt have said transforms. resetting transforms multiple times on the whole tree structure didnt help a lot unfortunately, and sometimes it completely scrapped a perfectly good pof otherwise.

note, i do not edit pofs in PCS2 much, i mostly edit them in C4D then re-export.
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
Are these lights parents of the nulls? Small examples always help.

 
Re: Cash prize for Collada - POF support!
UGH I wrote up a long response for the opencollada issue and the forum spit it back at me  :ick:

In short:
Look in <library_geometries><geometry><mesh><triangles> material attribute.  It points to a modified version of <library_materials><material>name attribute instead of id attribute.  The solution we've found so far is remove the appended _1 and append "-material".

The attachment contains a simple detail0 box.  It has two textures assigned to it, "Details 1" (confed_details_1.psd) and "Details 2" (confed_details_2.psd).


Here's some of the source for my little hack fix:
Code: [Select]
private void LoadGeometry(XmlNode node)
        {
            Debug.Assert(node != null, "param <node> is null");

            foreach (XmlNode geometry in node.ChildNodes)
            {
                // Make sure we're dealing with a geometry entry
                if (geometry.Name == "geometry")
                {
                    // Ignore shields, they don't need textures
                    if (IsShieldGeometry(geometry))
                        continue;

                    // Go through all of the geometry entry's children
                    foreach (XmlNode mesh in geometry)
                    {
                        // Make sure we're dealing with a <mesh>  There shouldn't be anything but <mesh> but just in case.
                        if (mesh.Name == "mesh")
                        {
                            // Go through each of it's children.  We're looking for just <triangles> entries.
                            foreach (XmlNode triangles in mesh)
                            {
                                if (triangles.Name == "triangles")
                                {
                                    for (int loop = 0; loop < triangles.Attributes.Count; loop++)
                                    {
                                        XmlAttribute material = triangles.Attributes[loop];

                                        // We're only interested in the material attribute
                                        if (material.Name == "material")
                                        {
                                            int foundAt = FindMaterial(material.Value);

                                            if (foundAt == -1)
                                            {
                                                Debug.Assert(false, "<Geometry<<Triangles material=> not found in <library_Geometries>");
                                            }

                                            // At this point simply append "-material" to the name.
                                            // We've already gotten rid of any excess "_1" or such from the string
                                            material.Value = materialNames[foundAt] + "-material";

                                        }
                                    }
                                }
                            }
                        }
                    }

                }
            }
        }


        private int FindMaterial(String value)
        {
            Debug.Assert(value != null, "param <value> is null");

            bool done = false;

            while (!done)
            {
                // Attempt to find the material's value in a list containing all the materials <library_materials>
                int loc = materialNames.IndexOf(value);

                if (value.Length != 0)
                {
                    // Couldn't find it.  Probably as an extension appended to it.  Simply remove one char at a time till we find it or run of out chars
                    if (loc == -1)
                    {
                        value = value.Substring(0, value.Length - 1);
                    }
                    else
                    {
                        return loc;
                    }
                }
                else
                {
                    return -1;
                }
            }

            return -1;
        }


[attachment deleted by admin]
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Re: Cash prize for Collada - POF support!
I still need a changeset to get this integrated into the trunk (not 2_0-fixes) branch.  once that is integrated i'm goin to try to stabilize trunk and switch to SVN and then open up the repository to more contributors

i'm also going to be doing some significant code refactoring of the main program to clean up poor coding techniques i used in the past
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Cash prize for Collada - POF support!
:yes:

 

Offline Spicious

  • Master Chief John-158
  • 210
Re: Cash prize for Collada - POF support!
Try the attached.

Is there a problem with using a more modern VCS?

[attachment deleted by admin]

 

Offline chief1983

  • Still lacks a custom title
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Cash prize for Collada - POF support!
Last I heard we plan to get it moved to SVN at some point.  And also to open up access to more SCP members.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays