Recommended Posts

Hah. Damn python, trying to be clever. Apparently when you call 'title()' on a snake-case string, it capitalizes every part. So 'Billboard_to_Local_Z' becomes 'Billboard_To_Local_Z'. For the non-programmers out there, that's not what most languages do. Normally it capitalizes the first letter, or the first letter of every word separated by whitespace.

Thanks for the report, fixed in KB 1.0.1.

MDLOps and KotORBlender don't add the empty value 'chunkname ' line. It is especially problematic for how the MDLOps parser was originally written, but KB is fine with it. That is too bad that MDLEdit seems to put it in, but unless I did something special, I'd expect that to cause MDLOps some problems. Maybe I'll take a look at that sometime.

  • Like 1

Share this post


Link to post
Share on other sites

 

6 minutes ago, LiliArch said:

So it treats _ as whitespace inside a string?

Yeah, it seems to treat pretty much any non-word-character as 'whitespace' for the purpose of word-separation for title(). It's like they used [^\w]\w as a regular expression to match the start of words. It even treats numbers as word breaks! I like a couple things about Python... this is not one of them.

>>> 'blah.blah.blah'.title()
'Blah.Blah.Blah'
>>> 'blah-blah.blah'.title()
'Blah-Blah.Blah'
>>> 'blah$blah.blah'.title()
'Blah$Blah.Blah'
>>> 'blah55blah.blah'.title()
'Blah55Blah.Blah'

 

  • Haha 2

Share this post


Link to post
Share on other sites
5 hours ago, DarthParametric said:

Interesting. If you compile and decompile with MDLEdit, you can see it adds in blank chunkname and render variables to each node. So I guess @bead-v added in a failsafe for missing variables, which is why it doesn't crash. Although presumably it would not function correctly in-game, given it is missing all the specific render semantics like Motion_Blur, Billboard_to_Local_Z, etc.

There is indeed a failsafe, but not always I think, in the currently released version . In the next version of mdledit, pretty much everything will either use a default value or show you a specific error message in such cases. You will also be able to see in the report all the cases where values were missing in the ASCII and mdledit used default values instead.

Share this post


Link to post
Share on other sites
6 hours ago, ndix UR said:

Hah. Damn python, trying to be clever.

🐍 That sneaky hungry snake strikes again. Bad snake! Baaaad snake! :whip:

Quick! We must feed it more variables, so that it might be tame again.

  • Haha 1

Share this post


Link to post
Share on other sites
6 hours ago, CarthOnasty said:

Should I just hold off using this until the next patch comes out then?

Well probably so in the case of this one particular model, for right now, but that's up to you. Although you could still use KB for say maybe some other model projects you have in mind? And if you just so happen to find any more new bugs, we'd really like to hear about it and you post them here. Because the more people who help us find new bugs the better the next version will be, see? :)

Share this post


Link to post
Share on other sites
2 hours ago, CarthOnasty said:

Should I just hold off using this until the next patch comes out then?

Sure, if this is what's important for you. Or just make this change in nvb/nvb_node.py:

@@ -1619,11 +1619,9 @@ class Emitter(GeometryNode):
                     value = value.title()
             elif attrname == 'render':
                 attrname = 'render_emitter'
-                if value.title() not in ['Normal', 'Billboard_to_Local_Z', 'Billboard_to_World_Z',
-                                         'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion']:
+                if value not in ['Normal', 'Billboard_to_Local_Z', 'Billboard_to_World_Z',
+                                 'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion']:
                     value = 'NONE'
-                else:
-                    value = value.title()
             elif attrname == 'blend':
                 if value.lower() == 'punchthrough':
                     value = 'Punch-Through'

You might have to look up how to read a unified diff (it shows the before and after in one document) if it's not clear--notice the line number reference in the header line also.

Share this post


Link to post
Share on other sites
1 hour ago, Purifier said:

Well probably so in the case of this one particular model, for right now, but that's up to you. Although you could still use KB for say maybe some other model projects you have in mind? And if you just so happen to find any more new bugs, we'd really like to hear about it and you post them here. Because the more people who help us find new bugs the better the next version will be, see? :)

For sure, if I come across anything, I'll shoot your way. Thanks!

1 hour ago, ndix UR said:

Sure, if this is what's important for you. Or just make this change in nvb/nvb_node.py:


@@ -1619,11 +1619,9 @@ class Emitter(GeometryNode):
                     value = value.title()
             elif attrname == 'render':
                 attrname = 'render_emitter'
-                if value.title() not in ['Normal', 'Billboard_to_Local_Z', 'Billboard_to_World_Z',
-                                         'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion']:
+                if value not in ['Normal', 'Billboard_to_Local_Z', 'Billboard_to_World_Z',
+                                 'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion']:
                     value = 'NONE'
-                else:
-                    value = value.title()
             elif attrname == 'blend':
                 if value.lower() == 'punchthrough':
                     value = 'Punch-Through'

You might have to look up how to read a unified diff (it shows the before and after in one document) if it's not clear--notice the line number reference in the header line also.

Oh nice, yeah, I can make this change then. I'll give it a shot with the updated code. Thanks fam.

I'm still getting the reading ascii model lockup in MDLOps. Here's what the code reads:

310990463_ScreenShot2018-06-02at7_14_30PM.png.3ca88d9e1802a35fb77dba26cd052be7.png

Sorry if I being a pain in the ass.

Edited by CarthOnasty
Edited code update.

Share this post


Link to post
Share on other sites
17 hours ago, Hunters Run said:

With your star map model is it in the same folder as the original model when you try to compile?

Tried within and outside, same result.

Share this post


Link to post
Share on other sites

Hey folks, just me being a pain in the ass again. I quickly installed the latest version in excitement and have unfortunately run into the same with MDLOps locking up when compiling the model. Attached is my direct decompile of the original model using MDLOps 1.0.0, then the export from Blender (made no edits to be sure).

Again, I'm not trying to be a pain. Let me know if I can provide any more information. Thanks.

plc_starmap-ascii.mdl

plc_starmap.mdl

Share this post


Link to post
Share on other sites

Yeah, that's more of a MDLOps issue than KotorBlender actually. It happens because kotorblender isn't putting the PWK nodes after all the geometry nodes. There's no particular reason that should be required other than the naive way I implemented the code to remove those nodes in mdlops. Technically, in your model, the PWK nodes are after all the geometry nodes, it's just that your plc_starmap_wg node has the wrong parent (which makes it seem like there's one non-PWK node in the middle of the PWK nodes, which triggers the same bug). If you change its 'parent plc_starmap' line to 'parent plc_starmap_pwk' the model works fine. I had to make some fixes to how that stuff was exported to make it more like mdledit after the 1.0.0 release of mdlops, which, I think is why you are having that issue...

Share this post


Link to post
Share on other sites
19 minutes ago, ndix UR said:

Yeah, that's more of a MDLOps issue than KotorBlender actually. It happens because kotorblender isn't putting the PWK nodes after all the geometry nodes. There's no particular reason that should be required other than the naive way I implemented the code to remove those nodes in mdlops. Technically, in your model, the PWK nodes are after all the geometry nodes, it's just that your plc_starmap_wg node has the wrong parent (which makes it seem like there's one non-PWK node in the middle of the PWK nodes, which triggers the same bug). If you change its 'parent plc_starmap' line to 'parent plc_starmap_pwk' the model works fine. I had to make some fixes to how that stuff was exported to make it more like mdledit after the 1.0.0 release of mdlops, which, I think is why you are having that issue...

Should I make that change before importing to Blemder? Or after?

Share this post


Link to post
Share on other sites

Well, that would be after export.

Also, in Blender, if you just parent plc_starmap_wg under the plc_starmap_pwk node, you should get the right result without having to make text edits after exporting from Blender. I think. Maybe.

Share this post


Link to post
Share on other sites
29 minutes ago, ndix UR said:

Well, that would be after export.

Also, in Blender, if you just parent plc_starmap_wg under the plc_starmap_pwk node, you should get the right result without having to make text edits after exporting from Blender. I think. Maybe.

  1. That did the trick! I was able to import/export and recompile. And then to confirm, you can just parent that node in Blender to avoid doing it manually later.
  2. Only one issue at this point (sorry): some of the particle/animations are either activating early or have different effects.

Share this post


Link to post
Share on other sites

Just a heads up, I repeated the process using MDLedit 1.0.3. No issues with modeling or maps or anything like that. Only issue I'm seeing is same as above, particle effects have changed and animations are off or not loading.

Share this post


Link to post
Share on other sites
21 minutes ago, CarthOnasty said:

Just a heads up, I repeated the process using MDLedit 1.0.3. No issues with modeling or maps or anything like that. Only issue I'm seeing is same as above, particle effects have changed and animations are off or not loading.

Cool, if you're interested in getting support, you need to be way, way more specific about what animations are changed and/or what particle effects on what meshes.

Share this post


Link to post
Share on other sites
11 hours ago, ndix UR said:

Cool, if you're interested in getting support, you need to be way, way more specific about what animations are changed and/or what particle effects on what meshes.

For sure, understandable. Here's what I'm working with.

This first clip, starmap1.mov, is the default texture/animations, nothing's been touched.

First try was using MDLOps 1.0.0. I used the following settings to process the model:

dcDb8dp.png

I then imported into Blender with the following settings:

5hH15PS.png

I didn't change anything with the model and then exported with the following settings:

Q7U5JHp.png

The clip you see in starmap2.mov is the end result.

starmap3.mov is repeating the above steps with MDLEdit 1.0.3.

In the second video, you can see how plc_starmap_08.tpc and plc_starmap_09.tpc have loaded prematurely. Then in the process of the starmap opening, the particle effects have changed on the rising orb, sphere02 it looks to be called. After that none of the remaining textures (outside of plc_starmap_06.tpc) have loaded and the arms (Map_Arm_01, Map_Arm_02, Map_Arm_03) have duplicated, with one set remaining "unopened".

In the third, processed using MDLEdit, the animations are working, though none of the interior textures are loading.

Let know if I can provide any more info. And thanks!

  • Thanks 2

Share this post


Link to post
Share on other sites

OK, I've got these issues sorted. All kotorblender issues. Will be fixed in 1.0.2.

One complete typo was making the particle effect on the sphere wrong (Motion instead of Motion_Blur in two places).

The issue w/ the lines & symbols being visible came down to my setting of minimum values for alphaMid and lifeExp that didn't include the full range of possible values. I had them set to 0.0, but apparently -1.0 is the actual minimum value. Because there are 50+ emitter controllers, I think I probably relied on logic, rather than exhaustive cataloging, to establish some of the min/max values. And anyone who tries to apply logic to the functioning of the game engine gets bitten eventually...

Here's the code patch:

Spoiler

--- a/nvb/nvb_node.py
+++ b/nvb/nvb_node.py
@@ -1625,7 +1625,7 @@ class Emitter(GeometryNode):
             elif attrname == 'render':
                 attrname = 'render_emitter'
                 if value not in ['Normal', 'Billboard_to_Local_Z', 'Billboard_to_World_Z',
-                                 'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion']:
+                                 'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion_Blur']:
                     value = 'NONE'
             elif attrname == 'blend':
                 if value.lower() == 'punchthrough':
@@ -1639,6 +1639,8 @@ class Emitter(GeometryNode):
                 else:
                     obj.nvb.p2p_type = 'Gravity'
                 # p2p_type has update method, sets p2p_sel
+                # except it doesn't seem to initially
+                obj.nvb.p2p_sel = self.p2p_sel
                 continue
             #print(attrname)
             setattr(obj.nvb, attrname, value)
--- a/nvb/nvb_props.py
+++ b/nvb/nvb_props.py
@@ -389,7 +389,7 @@ class KB_PG_OBJECT(bpy.types.PropertyGroup):
     frameend = bpy.props.IntProperty(name="End Frame", description="Frame End", default=0)
     framestart = bpy.props.IntProperty(name="Start Frame", description="Frame Start", default=0)
     grav = bpy.props.FloatProperty(name="Gravity", description="Gravity (m/s²)", default=0.0, min=0.0, unit='ACCELERATION')
-    lifeexp = bpy.props.FloatProperty(name="Lifetime", description="Life Expectancy", default=1.0, min=0.0)#, update=kb_update_lifeexp_prop)
+    lifeexp = bpy.props.FloatProperty(name="Lifetime", description="Life Expectancy", default=1.0, min=-1.0)#, update=kb_update_lifeexp_prop)
     mass = bpy.props.FloatProperty(name="Mass", description="Mass", default=1.0, min=0.0)
     p2p_bezier2 = bpy.props.FloatProperty(name="Bezier 2", description="???", default=0.0)
     p2p_bezier3 = bpy.props.FloatProperty(name="Bezier 3", description="???", default=0.0)
@@ -411,7 +411,7 @@ class KB_PG_OBJECT(bpy.types.PropertyGroup):
     lightningsubdiv = bpy.props.IntProperty(name="Subdivisions", description="Lightning Subdivisions", default=0, min=0, max=12, update=nvb_update_emitter_prop)
     lightningscale  = bpy.props.FloatProperty(name="Scale", description="Lightning Scale", default=1.0, min=0.0, max=1.0)
     lightningzigzag = bpy.props.IntProperty(name="ZigZag", description="Lightning Zig-Zag", default=0, min=0, max=30)
-    alphamid = bpy.props.FloatProperty(name="Alpha mid", description="Alpha mid", default=1.0, min=0.0, max=1.0)
+    alphamid = bpy.props.FloatProperty(name="Alpha mid", description="Alpha mid", default=1.0, min=-1.0, max=1.0)
     percentstart = bpy.props.FloatProperty(name="Percent start", description="Percent start", default = 1.0, min=0.0, max=1.0)
     percentmid = bpy.props.FloatProperty(name="Percent mid", description="Percent mid", default=1.0, min=0.0, max=1.0)
     percentend = bpy.props.FloatProperty(name="Percent end", description="Percent end", default=1.0, min=0.0, max=1.0)
@@ -474,7 +474,7 @@ class KB_PG_OBJECT(bpy.types.PropertyGroup):
                  ('Billboard_to_World_Z', "Billboard to world Z", "Billboard to world Z", 4),
                  ('Aligned_to_World_Z', "Aligned to world Z", "Aligned  to world Z", 5),
                  ('Aligned_to_Particle_Dir', "Aligned to particle dir.", "Aligned to particle direction", 6),
-                 ('Motion', "Motion Blur", "Motion Blur", 7)],
+                 ('Motion_Blur', "Motion Blur", "Motion Blur", 7)],
         default='NONE', options=set())
     blend = bpy.props.EnumProperty(
         name ="Blend", description="Blending Mode",

 

 

  • Thanks 1
  • Light Side Points 1

Share this post


Link to post
Share on other sites
On 7/10/2018 at 1:33 AM, ndix UR said:

OK, I've got these issues sorted. All kotorblender issues. Will be fixed in 1.0.2.

One complete typo was making the particle effect on the sphere wrong (Motion instead of Motion_Blur in two places).

The issue w/ the lines & symbols being visible came down to my setting of minimum values for alphaMid and lifeExp that didn't include the full range of possible values. I had them set to 0.0, but apparently -1.0 is the actual minimum value. Because there are 50+ emitter controllers, I think I probably relied on logic, rather than exhaustive cataloging, to establish some of the min/max values. And anyone who tries to apply logic to the functioning of the game engine gets bitten eventually...

Here's the code patch:

  Reveal hidden contents


--- a/nvb/nvb_node.py
+++ b/nvb/nvb_node.py
@@ -1625,7 +1625,7 @@ class Emitter(GeometryNode):
             elif attrname == 'render':
                 attrname = 'render_emitter'
                 if value not in ['Normal', 'Billboard_to_Local_Z', 'Billboard_to_World_Z',
-                                 'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion']:
+                                 'Aligned_to_World_Z', 'Aligned_to_Particle_Dir', 'Motion_Blur']:
                     value = 'NONE'
             elif attrname == 'blend':
                 if value.lower() == 'punchthrough':
@@ -1639,6 +1639,8 @@ class Emitter(GeometryNode):
                 else:
                     obj.nvb.p2p_type = 'Gravity'
                 # p2p_type has update method, sets p2p_sel
+                # except it doesn't seem to initially
+                obj.nvb.p2p_sel = self.p2p_sel
                 continue
             #print(attrname)
             setattr(obj.nvb, attrname, value)
--- a/nvb/nvb_props.py
+++ b/nvb/nvb_props.py
@@ -389,7 +389,7 @@ class KB_PG_OBJECT(bpy.types.PropertyGroup):
     frameend = bpy.props.IntProperty(name="End Frame", description="Frame End", default=0)
     framestart = bpy.props.IntProperty(name="Start Frame", description="Frame Start", default=0)
     grav = bpy.props.FloatProperty(name="Gravity", description="Gravity (m/s²)", default=0.0, min=0.0, unit='ACCELERATION')
-    lifeexp = bpy.props.FloatProperty(name="Lifetime", description="Life Expectancy", default=1.0, min=0.0)#, update=kb_update_lifeexp_prop)
+    lifeexp = bpy.props.FloatProperty(name="Lifetime", description="Life Expectancy", default=1.0, min=-1.0)#, update=kb_update_lifeexp_prop)
     mass = bpy.props.FloatProperty(name="Mass", description="Mass", default=1.0, min=0.0)
     p2p_bezier2 = bpy.props.FloatProperty(name="Bezier 2", description="???", default=0.0)
     p2p_bezier3 = bpy.props.FloatProperty(name="Bezier 3", description="???", default=0.0)
@@ -411,7 +411,7 @@ class KB_PG_OBJECT(bpy.types.PropertyGroup):
     lightningsubdiv = bpy.props.IntProperty(name="Subdivisions", description="Lightning Subdivisions", default=0, min=0, max=12, update=nvb_update_emitter_prop)
     lightningscale  = bpy.props.FloatProperty(name="Scale", description="Lightning Scale", default=1.0, min=0.0, max=1.0)
     lightningzigzag = bpy.props.IntProperty(name="ZigZag", description="Lightning Zig-Zag", default=0, min=0, max=30)
-    alphamid = bpy.props.FloatProperty(name="Alpha mid", description="Alpha mid", default=1.0, min=0.0, max=1.0)
+    alphamid = bpy.props.FloatProperty(name="Alpha mid", description="Alpha mid", default=1.0, min=-1.0, max=1.0)
     percentstart = bpy.props.FloatProperty(name="Percent start", description="Percent start", default = 1.0, min=0.0, max=1.0)
     percentmid = bpy.props.FloatProperty(name="Percent mid", description="Percent mid", default=1.0, min=0.0, max=1.0)
     percentend = bpy.props.FloatProperty(name="Percent end", description="Percent end", default=1.0, min=0.0, max=1.0)
@@ -474,7 +474,7 @@ class KB_PG_OBJECT(bpy.types.PropertyGroup):
                  ('Billboard_to_World_Z', "Billboard to world Z", "Billboard to world Z", 4),
                  ('Aligned_to_World_Z', "Aligned to world Z", "Aligned  to world Z", 5),
                  ('Aligned_to_Particle_Dir', "Aligned to particle dir.", "Aligned to particle direction", 6),
-                 ('Motion', "Motion Blur", "Motion Blur", 7)],
+                 ('Motion_Blur', "Motion Blur", "Motion Blur", 7)],
         default='NONE', options=set())
     blend = bpy.props.EnumProperty(
         name ="Blend", description="Blending Mode",

 

 

You the best, thanks for the extensive work and patience! I'll give everything a shot this evening when I get home. Thanks again.

::edit::

@ndix UR Patched and compiled with no issues! Opened in-game and the model, animations, textures, etc. loaded perfectly. Thanks!

Edited by CarthOnasty
Updating status.

Share this post


Link to post
Share on other sites

Is there a 1.02.. I'm new  and totally fucking  new to modding  .. I'm having trouble loading personal character heads mesh wtf ever they called.. just comes up as a block and animation .. I tryed a stupid number of  how to videos i could find only thing that helped was make the block less blocky with subtle corners... I'm new and dont know what to do ... any help well be welcome ...also might be helpful to note I'm dumb and dont use mdlops so that could be my problem too but ttyl I'm fucking tired.

Edited by Iamstarlordsra

Share this post


Link to post
Share on other sites

hello wondering if you could update the addon to work with blender 2.81 or newer as the current version does not seem to work with that version of blender

Share this post


Link to post
Share on other sites
On 2/28/2020 at 3:25 AM, Kobra299 said:

hello wondering if you could update the addon to work with blender 2.81 or newer as the current version does not seem to work with that version of blender

I've upgraded the add-on to work with Blender 2.8+ - available for download from https://github.com/seedhartha/kotorblender

I did not test it extensively, but importing and exporting (skinned) creature and area models (including walkmeshes) works for me. I'm willing to provide support for this version - so, if you encounter bugs, don't hesitate to make a post in this thread or create an issue on GitHub.

Hopefully we'll do a merger with @ndix UR as some point - wouldn't want this to take too much time out of the reone project 😅

  • Like 2
  • Light Side Points 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.