Jump to content

How To: Create Your Own Art Using Pgi's Mechs

Art Misc

2252 replies to this topic

#661 Iacov

    Member

  • PipPipPipPipPipPipPip
  • The Hammer
  • The Hammer
  • 668 posts
  • LocationAustria

Posted 24 January 2014 - 01:15 PM

I have to thank you for guiding me to that workaround:)

what does the line
bpy.context.object.data.materials.pop(0, update_data=True)
do?
could this have to do why my raven's cockpit is in a lighter Grey than the rest?

cheers!

#662 baabaa214

    Member

  • PipPipPipPipPipPip
  • 304 posts
  • LocationCentral Texas

Posted 24 January 2014 - 01:56 PM

Has anybody tried the commando yet?
I tried and it all twisted around and not just a few but all.

#663 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 24 January 2014 - 02:01 PM

View PostIacov, on 24 January 2014 - 01:15 PM, said:

I have to thank you for guiding me to that workaround:)

what does the line
bpy.context.object.data.materials.pop(0, update_data=True)
do?
could this have to do why my raven's cockpit is in a lighter Grey than the rest?

cheers!


De-assigns the material from the object. It's very likely, because instead of having a default material, it has no material. It's better to have no material, so that you can assign one of the 3 materials (body, variant, cockpit glass) easily.

I mean, not that it's hard, just less cleanup if everything is deassigned.

#664 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 24 January 2014 - 02:28 PM

View Postbaabaa214, on 24 January 2014 - 01:56 PM, said:

Has anybody tried the commando yet?
I tried and it all twisted around and not just a few but all.


Ok, found a rather significant bug in my script. Or less a bug than an assumption that isn't universal. I'm keying off the AName variable in the .cdf file, which is the name of the object. In a lot of the cases (especially with the newer mechs), this matches up nicely with the file name. However, in the older mechs the AName and the Binding (the actual path/file) doesn't match up, so it fails to import the obj file (can't find the file because the name doesn't match).

This is also causing the 0000_ and 0001_ names, as the AName that is being loaded can be duplicated apparently (or maybe it's duplicating the binding; doesn't matter right now). Anyway, I need to modify the script to use the Binding, for what the python script is loading up, have it load up with the AName object name, and ... hang on, brain is starting to overload.

The point is... give me a bit to figure this out. I really appreciate everyone testing this out, because I probably wouldn't have found it on my own for a good long time.

<Attachment AName="leg_thigh_right" Type="CA_BONE" Rotation="0.70663494,0.025844391,0.70663369,0.025845312" Position="2.848999,4.9619298e-006,8.6315355" BoneName="Bip01 R Thigh" Binding="objects/mechs/atlas/body/atlas_leg_right.cga" Flags="6" Material="objects/mechs/atlas/body/atlas_body" />

That's the issue right there. It's trying to load leg_thigh_right.obj, and that's not the filename.

Anyone any good at powershell xml programming? :unsure:

#665 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 24 January 2014 - 10:03 PM

Getting very close! The gas-mask looking thing is actually the interior cockpit, and you can see how the sizing doesn't fit quite right (something haruko worked a ton on). The only problems I'm having now is that any weapon obj that has a capital letter is screwing up the translation/rotation portion of the script.

I ran into a lot of problems with .obj files that have multiple objects in them. That is what was causing the 0000_ names. I solved that with an argument on the importer that puts them all in one group, then makes vertex groups out of each of the objects. The problem is if you do that, you can't eliminate the double vertices, so I have logic in the script now to take care of that.

The next step is to figure out what to do with the capitals, and see if I can get the mtl files to work!



Posted Image

#666 Iacov

    Member

  • PipPipPipPipPipPipPip
  • The Hammer
  • The Hammer
  • 668 posts
  • LocationAustria

Posted 25 January 2014 - 01:17 AM

View PostHeffay, on 24 January 2014 - 02:01 PM, said:


De-assigns the material from the object. It's very likely, because instead of having a default material, it has no material. It's better to have no material, so that you can assign one of the 3 materials (body, variant, cockpit glass) easily.

I mean, not that it's hard, just less cleanup if everything is deassigned.

thank you:) how do I do that by hand?

and regarding the catapult...what i just saw...my script-assembled catapult has a "cube" in the cockpit... (everything is in correct place though) it is right beneath the canopy
i don't remember a square/cube there when i importet the catapult_main.obj, before i used the script
(the cube seems to belong to the torso.obj...don't remember which one though edit: belongs to the center torso)

just wanted to ask, to know if everything is correct with my catapult

cheers!

Edited by Iacov, 25 January 2014 - 06:48 AM.


#667 Iacov

    Member

  • PipPipPipPipPipPipPip
  • The Hammer
  • The Hammer
  • 668 posts
  • LocationAustria

Posted 25 January 2014 - 08:08 AM

i've tested some mechs with the script:
awesome: works almost perfectly (cockpit has to be rotated)
highlander: works perfectly
orion: is currently quite a mess...renaming and rerunning the script helped, but even then it's not easy to distinguish the correct parts from the false ones
thunderbolt: works perfectly
edit:
battlemaster: like a charm
cicada: renaming/re-running the script helpts, some thing (like uac5 and flamer) have to be brought into place by hand
edit 2:
hunchbark: almost everything in place, re-running helps - arms are in the wrong angle, but this has nothing to do with the script

btw: how do i fix the angle of the hunchback's arms?
are there bones that i can move? if so how do i enter the specific mode in blender?

i'll update when i try other mechs

Edited by Iacov, 25 January 2014 - 08:42 AM.


#668 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 25 January 2014 - 10:24 AM

Patience. :P I'm making some significant updates to the script now, and it should be able to load materials as well as all the cockpit parts.

#669 Iacov

    Member

  • PipPipPipPipPipPipPip
  • The Hammer
  • The Hammer
  • 668 posts
  • LocationAustria

Posted 25 January 2014 - 10:29 AM

just wanted to help with testing, where problems might occur
sorry if it made the appearance I was rushing you :P

#670 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 25 January 2014 - 02:26 PM

View PostIacov, on 25 January 2014 - 10:29 AM, said:

just wanted to help with testing, where problems might occur
sorry if it made the appearance I was rushing you :P


Hehehe, no worries. :) I've figured out all the bugs in that version of the script and am working on a more enhanced one that assembles everything properly from the get go.

#671 Goose Igaly

    Member

  • PipPipPipPipPipPip
  • FP Veteran - Beta 1
  • FP Veteran - Beta 1
  • 282 posts

Posted 25 January 2014 - 08:43 PM

Very much enjoying this thread. Here's my first decent render. Not much to brag about, but proof that you guys make it easy for anyone relatively inexperienced with 3D rendering software to pull this off.

Posted Image

#672 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 25 January 2014 - 08:57 PM

Latest verson (1.3):

https://dl.dropboxus...ch-importer.ps1

It now imports most mechs without an issue, although some mechs (like the commando) will not rotate some weapon parts, as there is an issue with case. Looking for a workaround.

It also now creates a material stub for each of the materials in both the mech and the cockpit. All you need to do is flesh out the node layout and each object will have the proper material and (BIG CAVEAT) reassign the proper material to each part. I haven't figured out where the game identifies if an object is a standard part or a variant, so right now it just assigns the <mech>_body material to all the nodes.

Complicated nodes (i.e. object files with more than one object, such as the head [head piece and window] or cockpit [many pieces]) are now split into vertex groups You can assign a material to a vertex group, but it's a bit complicated until you figure it out.

Working on importing the armatures tomorrow. It probably will be a mess, but... yeah. It's all better than nothing.

edit: Ugh, still super buggy. Just tried hunchback and catapult, and it was a mess. Awesome worked great at least.

Edited by Heffay, 25 January 2014 - 09:02 PM.


#673 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 26 January 2014 - 03:35 PM

Here's part of the problem I'm facing: The standard places things are stored aren't standard. And that means I have to make a ton of additional error checking and verification of where things are, instead of making assumptions. Then again, maybe that is good because assumptions are the root of all evil in programming, and it's an important lesson I need to learn over and over again. An example:

Let's compare the Awesome and the Hunchback. Both are a bit older mechs, but the directory structure is not the same. For example, the File locations differ (from their respective .cdf files):

<Model File="objects/mechs/awesome/body/awesome.chr" Material="objects/mechs/awesome/body/awesome"/>

<Model File="objects/mechs/hunchback/hunchback.chr" Material="objects/mechs/hunchback/hunchback"/>

This is why the current version of the script works for one model (Awesome) and not the other (Hunchback). So now I basically need to verify the location of each file prior to trying to use it, and make else statements to check other places if they aren't where I expect.

This is fine, but it does slow things down for me, and may actually be a problem when PGI goes to update things. Their programmers and artists will also be making assumptions like I have, and that leads to bugs, etc.

So anyway... rewrite of the script in process. I'll call it Mech Importer 2.0, and it'll have the interface necessary to add future models even if things change again. It'll be ready Soon.

.... Why does this sound eerily familiar? ;)

Edited by Heffay, 26 January 2014 - 03:35 PM.


#674 Tekadept

    Member

  • PipPipPipPipPipPipPipPip
  • Knight Errant
  • 1,290 posts
  • LocationPerth, Australia

Posted 26 January 2014 - 03:55 PM

Next your going to charge $500 that exports the mech with a gold material.

#675 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 26 January 2014 - 04:47 PM

View PostTekadept, on 26 January 2014 - 03:55 PM, said:

Next your going to charge $500 that exports the mech with a gold material.


I'm going to make it work with Star Citizen too. For $15,000, I'll create a special level that you control in the script. Basically you can type "hello world" and other people who use it will see it pop up on their screen.

In gold. ;)

#676 Stingray Productions

    Member

  • PipPipPipPipPipPipPipPip
  • 1,906 posts

Posted 26 January 2014 - 04:52 PM

View PostGoose Igaly, on 25 January 2014 - 08:43 PM, said:

Very much enjoying this thread. Here's my first decent render. Not much to brag about, but proof that you guys make it easy for anyone relatively inexperienced with 3D rendering software to pull this off.

Posted Image

ooohhh, pretty! ;)

#677 CyclonerM

    Tina's Warrior

  • PipPipPipPipPipPipPipPipPipPip
  • FP Veteran - Beta 2
  • FP Veteran - Beta 2
  • 5,685 posts
  • LocationA 2nd Wolf Guards Grenadiers JumpShip

Posted 27 January 2014 - 06:01 AM

Questions for Heffay:
1) Where can i take the basic metal texture for my 'Mechs? And are there special settings to apply it? I only applied a texture to a plain so far..
2) Why my models miss some parts? I thought it was suppsoed to be the full model.. (check my thread)

#678 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 27 January 2014 - 07:20 AM

View PostCyclonerM, on 27 January 2014 - 06:01 AM, said:

1) Where can i take the basic metal texture for my 'Mechs? And are there special settings to apply it? I only applied a texture to a plain so far..


The first video (linked in the first post) has some detailed information on how to set up the textures using Cycles. What steps are you having problems with?

View PostCyclonerM, on 27 January 2014 - 06:01 AM, said:

2) Why my models miss some parts? I thought it was suppsoed to be the full model.. (check my thread)


Do you have a link to your thread? I did a quick search in this forum and didn't see anything.

#679 CyclonerM

    Tina's Warrior

  • PipPipPipPipPipPipPipPipPipPip
  • FP Veteran - Beta 2
  • FP Veteran - Beta 2
  • 5,685 posts
  • LocationA 2nd Wolf Guards Grenadiers JumpShip

Posted 27 January 2014 - 08:52 AM

View PostHeffay, on 27 January 2014 - 07:20 AM, said:


The first video (linked in the first post) has some detailed information on how to set up the textures using Cycles. What steps are you having problems with?



Do you have a link to your thread? I did a quick search in this forum and didn't see anything.


Ah well i will check your first video before trying it ;)

My thread is this, look at the legs.

Edited by CyclonerM, 27 January 2014 - 08:52 AM.


#680 Heffay

    Rum Runner

  • PipPipPipPipPipPipPipPipPipPip
  • The Referee
  • The Referee
  • 6,458 posts
  • LocationPHX

Posted 02 February 2014 - 07:13 PM

Mech Importer v1.3

https://dl.dropboxus...ch-importer.ps1

Fixed a ton of bugs. It now works for all mechs (that I've tested) except the Hunchback. Screw the Hunchback!

It also creates a material slot for each of the materials, and loads up all the image files so you can easily select them when creating the node groups. I'll have to make a video to explain this better, but it works pretty freaking slick if I do say so myself. For each of the materials, create the node group. Each part is assigned the <mech>_body material by default, so if it doesn't look right you'll have to assign the <mech>_variant (or cockpit glass) material to it. The entire cockpit is brought in as well, but they tend to have 10+ materials, and you'll have to create those node groups. The cockpits are brought in as single objects with a bunch of vertex groups, and you can assign materials to particular vertex groups fairly easily, but that part isn't automated as well.

I've had some success importing the armatures into Blender as well, although for some reason the scripting version of it doesn't work. And I can't parent it properly yet, since I can't figure out a way to parent a particular object to a particular bone. That and actually creating the material node groups is the plan for v1.4, but I probably won't work on those for a bit. Too many competing priorities.

Anyway... video coming out soon as an addendum to the 2/3 training video, which details how to use the script (and is probably significantly outdated now); should be fairly short, about 10-15 minutes. That's because it'll only take 10-15 minutes to fully import a mech now (minus armature stuff)!





7 user(s) are reading this topic

0 members, 7 guests, 0 anonymous users