#661
Posted 24 January 2014 - 01:15 PM
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
Posted 24 January 2014 - 01:56 PM
I tried and it all twisted around and not just a few but all.
#663
Posted 24 January 2014 - 02:01 PM
Iacov, on 24 January 2014 - 01:15 PM, said:
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
Posted 24 January 2014 - 02:28 PM
baabaa214, on 24 January 2014 - 01:56 PM, said:
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?
#665
Posted 24 January 2014 - 10:03 PM
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!
#666
Posted 25 January 2014 - 01:17 AM
Heffay, 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
Posted 25 January 2014 - 08:08 AM
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
Posted 25 January 2014 - 10:24 AM
#669
Posted 25 January 2014 - 10:29 AM
sorry if it made the appearance I was rushing you
#670
Posted 25 January 2014 - 02:26 PM
Iacov, on 25 January 2014 - 10:29 AM, said:
sorry if it made the appearance I was rushing you
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
Posted 25 January 2014 - 08:43 PM
#672
Posted 25 January 2014 - 08:57 PM
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
Posted 26 January 2014 - 03:35 PM
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
Posted 26 January 2014 - 03:55 PM
#675
Posted 26 January 2014 - 04:47 PM
Tekadept, on 26 January 2014 - 03:55 PM, said:
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
Posted 26 January 2014 - 04:52 PM
Goose Igaly, on 25 January 2014 - 08:43 PM, said:
ooohhh, pretty!
#677
Posted 27 January 2014 - 06:01 AM
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
Posted 27 January 2014 - 07:20 AM
CyclonerM, on 27 January 2014 - 06:01 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?
CyclonerM, on 27 January 2014 - 06:01 AM, said:
Do you have a link to your thread? I did a quick search in this forum and didn't see anything.
#679
Posted 27 January 2014 - 08:52 AM
Heffay, 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
Posted 02 February 2014 - 07:13 PM
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)!
9 user(s) are reading this topic
0 members, 9 guests, 0 anonymous users