[BETA/RELz/WIPz] NifSE v1.0

Post » Wed Mar 30, 2011 12:21 am

Sorry, you're right; switch what I said about NiAVObject to NiObjectNET.

Basically, here's the deal: the various nif block types derive from one another, so that every NiMaterialProperty is a type of NiProperty, which is a type of NiObjectNET, which is a type of NiObject. You can use any NiObject, NiObjectNET, or NiProperty function on it, because in addition to being a NiMaterialProperty, it is also one of those other things also. Since the name field is defined in NiObjectNET, NiMaterialProperty doesn't redefine it - it inherits that from NiObjectNET. So there is no NiMaterialPropertyGetName function - and never will be. You access that information through NiObjectNETGetName. Same for NiAVObjects (which derive from NiObjectNET), NiNodes (which derive from NiAVObject and thus from NiObjectNET), etc. etc.

Here's a tree that shows the relationships:
  • NiObject
    • NiExtraData
      • NiBinaryExtraData
      • NiBooleanExtraData
      • NiFloatExtraData
      • NiIntegerExtraData
      • BSXFlags
      • NiStringExtraData
      • ...

    • NiObjectNET
      • NiAVObject
        • NiNode

      • NiProperty
        • NiAlphaProperty
        • NiMaterialProperty
        • NiStencilProperty
        • NiTexturingProperty
        • ...

      • NiTexture
        • NiSourceTexture
Thus, every block can have NiObject functions used on them, NiNodes can have all NiNode, NiAVObject, NiObjectNET, and NiObject functions used on them, etc. NiExtraData and NiProperty are actually identical to NiObject and NiObjectNET, respectively, but it's important that only a subset of blocks derive from them (the various Ni_____ExtraData and Ni_____Property blocks all define individual features and functions).

Here's a function that goes through NIF and prints the name of each child's Material property (if any).
scn DWnifMaterialTestshort nifIDshort blockIDarray_var childarray_var childrenshort NiMaterialPropertyIDstring_var matNameBegin _GameMode ; compiler override - only necessary, for NifSE, if you're using functions that accept array arguments.    if ( !NiMaterialPropertyID ) ; if not NiMaterialProperty - effectively a doOnce since we'll set it right after this        let NiMaterialPropertyID := GetNifTypeIndex "NiMaterialProperty" ; caching this because GetNifTypeIndex is slowish        let nifID := NifOpen "something.nif" ; open a nif as read-only        let children := NiNodeGetChildren nifID ; optional blockID omitted, defaults to 0 or root        foreach child <- children ; each child is a NiAVObject of some kind            let blockID := NiAVObjectGetProperties NiMaterialPropertyID nifID (*child)            if ( blockID > -1 ) ; returns -1 if it didn't find the property                let matName := NiObjectNETGetName nifID blockID            else                let matName := "No Material"            endif            Print matName        loop    endifEnd
Does that help somewhat?
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Wed Mar 30, 2011 3:38 am

that helps, still one bit i dont understand, these two lines.

        foreach child <- children ; each child is a NiAVObject of some kind             let blockID := NiAVObjectGetProperties NiMaterialPropertyID nifID (*child) 


I havent used foreach loops before....only while loops.....that may have something ot do with what i dont understand. I copied what you put there, but it stops the script dead (aka, the script stop running altogether) when it reaches the foreach loop.
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Wed Mar 30, 2011 3:37 am

Could I see NifSE.log?
User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Wed Mar 30, 2011 6:03 am

Okay, i forgot to get rid of the nifopen line in yours....thats what cause the script to halt, sorry.

So its running....sort of....its saying there is a skin material on every mesh,

here is the nifse log:
Spoiler

NifSE v1.00 b:3 a:f

query
load

oblivion root = C:\Games\Bethesda Softworks\Oblivion\
List of BSA files: (excluding BSA files known to contain non-NIF data)
C:\Games\Bethesda Softworks\Oblivion\Data\DLCBattlehornCastle.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCFrostcrag.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCHorseArmor.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCOrrery.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCShiveringIsles - Meshes.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCThievesDen.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCVileLair.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\Knights.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\Oblivion - Meshes.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\TheOubliette-Sounds.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\TheOubliette.bsa
11 total.

Registering OBSE script interface.

Listening to OBSE dispatches.

Registering String Interface.

Setting Serialization callbacks.

Initializing NifSE Hooks.

Initialization complete.


Game loaded: Creating ni\ directory.

NifLoad - Clearing previous RegList.
NifLoad - Load complete.

NifOpen - "Armor\Ebony\M\Cuirass.NIF" opened for editing.
NifFile c'tor - NifFile created for editing.
NifFile.loadNif - Loading "Armor\Ebony\M\Cuirass.NIF"!
NifFile.readNif - Read 736128 of 736128 bytes.
NifFile.loadNif - Nif is good; v20.0.0.5. Loaded 42 blocks.
NifFile.reg - Registering "Armor\Ebony\M\Cuirass.NIF" on RegList.
NifFile.reg - Registered as #2-0.
NifOpen - "Armor\Ebony\M\Cuirass.NIF" registered as #2-0.

NifGetPath - Getting the path to nif #2-0
NifGetPath - Returning "ni\CMR - Master_0.nif".

GetNifTypeIndex - Getting the code for Nif block type "NiMaterialProperty".
GetNifTypeIndex - Returning 192.

NiNodeGetChildren - Getting Children nodes to nif #2-0 block #0.
NiNodeGetChildren - Returning node's children.

GetNifTypeIndex - Getting the code for Nif block type "NiMaterialProperty".
GetNifTypeIndex - Returning 192.

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.a
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

NiAVObjectGetProperties - Getting the properties held by of Child #0 of nif #2-192
NifFile::getRegNif - Nif #2-192 not found.
NiAVObjectGetProperties - Could not find Nif.
NiAVObjectGetProperties - Failed to create and return array.

NiObjectNETGetName - Getting the name of nif #2-0 block #0.
NiObjectNETGetName - Returning "Scene Root".

Game quit: Deleting ni\ directory.

User avatar
ANaIs GRelot
 
Posts: 3401
Joined: Tue Dec 12, 2006 6:19 pm

Post » Wed Mar 30, 2011 8:19 am

Ack, sorry, typo on my part. I meant NiAVObjectGetPropertyByType not NiAVObjectGetProperties. Try switching that (same argument list).
User avatar
Fam Mughal
 
Posts: 3468
Joined: Sat May 26, 2007 3:18 am

Post » Tue Mar 29, 2011 11:29 pm

oh darn.......well its now CTD when it looks at a mesh....

here the log:
Spoiler
NifSE v1.00 b:3 a:f

query
load

oblivion root = C:\Games\Bethesda Softworks\Oblivion\
List of BSA files: (excluding BSA files known to contain non-NIF data)
C:\Games\Bethesda Softworks\Oblivion\Data\DLCBattlehornCastle.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCFrostcrag.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCHorseArmor.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCOrrery.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCShiveringIsles - Meshes.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCThievesDen.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCVileLair.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\Knights.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\Oblivion - Meshes.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\TheOubliette-Sounds.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\TheOubliette.bsa
11 total.

Registering OBSE script interface.

Listening to OBSE dispatches.

Registering String Interface.

Setting Serialization callbacks.

Initializing NifSE Hooks.

Initialization complete.


Game loaded: Creating ni\ directory.

NifLoad - Clearing previous RegList.
NifLoad - Load complete.

NifOpen - "Armor\Ebony\M\Cuirass.NIF" opened for editing.
NifFile c'tor - NifFile created for editing.
NifFile.loadNif - Loading "Armor\Ebony\M\Cuirass.NIF"!
NifFile.readNif - Read 736128 of 736128 bytes.
NifFile.loadNif - Nif is good; v20.0.0.5. Loaded 42 blocks.
NifFile.reg - Registering "Armor\Ebony\M\Cuirass.NIF" on RegList.
NifFile.reg - Registered as #2-0.
NifOpen - "Armor\Ebony\M\Cuirass.NIF" registered as #2-0.

NifGetPath - Getting the path to nif #2-0
NifGetPath - Returning "ni\CMR - Master_0.nif".

GetNifTypeIndex - Getting the code for Nif block type "NiMaterialProperty".
GetNifTypeIndex - Returning 192.

NiNodeGetChildren - Getting Children nodes to nif #2-0 block #0.
NiNodeGetChildren - Returning node's children.

NiAVObjectGetPropertyByType - Getting the index of the "192" Property of nif #2-0 block #0.


IF you dont want us filling up this thread we can always move this to a PM.
User avatar
Pat RiMsey
 
Posts: 3306
Joined: Fri Oct 19, 2007 1:22 am

Post » Wed Mar 30, 2011 10:17 am

Well that's not good... I'll have to play with that some in the morning to figure out what that is. Definitely a bug there, but hard to say exactly what since we're not getting any further messages...
User avatar
Crystal Clear
 
Posts: 3552
Joined: Wed Aug 09, 2006 4:42 am

Post » Wed Mar 30, 2011 1:06 pm

Apparently, NiAVObject::GetPropertyByType (the Niflib function) crashes if there are no properties. It shouldn't, and looking at the code I don't see why it does, but I can easily just check the size of the property list before calling that function to remove that problem. Next version (probably out tonight or tomorrow) should fix that. Gonna report that as a bug to the NifTools guys...

EDIT: Of course, you yourself could do the same thing by calling NiAVObjectGetNumProperties on it before calling NiAVObjectGetPropertyByType.
User avatar
Claire Jackson
 
Posts: 3422
Joined: Thu Jul 20, 2006 11:38 pm

Post » Wed Mar 30, 2011 5:21 am

Okay....this foreach thing is completely throughing my off...

How does it work? Hows does the NiAVObjectGetPropertyByType know what block it is looking at? Im assuming it is to do with the (*child) bit on the end, but what does that do?

I opened up the nif log after putting in the NiAVObjectGetNumProperties check, but it just checked the first block over and over rather then going through the other ones.....the trouble is I dont know how to tell it to look at each block.
User avatar
KIng James
 
Posts: 3499
Joined: Wed Sep 26, 2007 2:54 pm

Post » Wed Mar 30, 2011 9:25 am

OK, your code should look like this:
scn DWnifMaterialTestshort nifIDshort blockIDarray_var childarray_var childrenshort NiMaterialPropertyIDstring_var matNameBegin _GameMode ; compiler override - only necessary, for NifSE, if you're using functions that accept array arguments.    if eval ( !NiMaterialPropertyID ) ; if not NiMaterialProperty - effectively a doOnce since we'll set it right after this        let NiMaterialPropertyID := GetNifTypeIndex "NiMaterialProperty" ; caching this because GetNifTypeIndex is slowish        let nifID := NifOpen "something.nif" ; open a nif as read-only        let children := NiNodeGetChildren nifID ; optional blockID omitted, defaults to 0 or root        foreach child <- children ; each child is a NiAVObject of some kind            if eval ( NiAVObjectGetNumProperties nifID (*child) )                let blockID := NiAVObjectGetPropertyByType NiMaterialPropertyID nifID (*child)                if eval ( blockID > -1 ) ; returns -1 if it didn't find the property                    let matName := NiObjectNETGetName nifID blockID                else                    let matName := "No Material"                endif                Print matName            else                Print "No properties"            endif        loop    endifEnd

All (almost all) NifSE functions have the following syntax:
(returned value) NiBlockTypeGetSomething nifID [blockID](bool) NiBlockTypeSetSomething newValue nifID [blockID]
In both cases, the blockID argument is optional; it defaults to 0. The blockID refers to which block within the Nif we're talking about; 0 is the root block (always a NiNode), so when you're talking about the root, you don't need to include that argument (e.g. when you call NiNodeGetChildren nifID above, you're talking about the children of the root; other blocks can have children of their own, if they're NiNodes). In the case of our NiAVObjectGetNumProperties and NiAVObjectGetPropertyByType calls, we're not talking about the root's properties (which it could have, since NiNode derives from NiAVObject), but rather the properties of each of the children. NiNodeGetChildren returns an array of blockIDs that refer to each of the children; when we use foreach child <- children, in each loop child is a map containing { "key"::#, "value"::blockID }, and using *child is equivalent to child["value"] and thus returns the blockID for that child. The number under "key" refers to which child this is (i.e. 0 for the first one, 1 for the second one, etc.)

Does that help? You really should read up on the foreach loop; that seems to be the biggest problem here.
User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Wed Mar 30, 2011 6:01 am

Yep, okay i did put it in right, just used your way of writing it and got the same results.

nifse log:
Spoiler

NifSE v1.00 b:3 a:f

query
load

oblivion root = C:\Games\Bethesda Softworks\Oblivion\
List of BSA files: (excluding BSA files known to contain non-NIF data)
C:\Games\Bethesda Softworks\Oblivion\Data\DLCBattlehornCastle.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCFrostcrag.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCHorseArmor.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCOrrery.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCShiveringIsles - Meshes.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCThievesDen.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\DLCVileLair.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\Knights.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\Oblivion - Meshes.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\TheOubliette-Sounds.bsa
C:\Games\Bethesda Softworks\Oblivion\Data\TheOubliette.bsa
11 total.

Registering OBSE script interface.

Listening to OBSE dispatches.

Registering String Interface.

Setting Serialization callbacks.

Initializing NifSE Hooks.

Initialization complete.


Game loaded: Creating ni\ directory.

NifLoad - Clearing previous RegList.
NifLoad - Load complete.

NifOpen - "Armor\Ebony\M\Cuirass.NIF" opened for editing.
NifFile c'tor - NifFile created for editing.
NifFile.loadNif - Loading "Armor\Ebony\M\Cuirass.NIF"!
NifFile.readNif - Read 736128 of 736128 bytes.
NifFile.loadNif - Nif is good; v20.0.0.5. Loaded 42 blocks.
NifFile.reg - Registering "Armor\Ebony\M\Cuirass.NIF" on RegList.
NifFile.reg - Registered as #2-0.
NifOpen - "Armor\Ebony\M\Cuirass.NIF" registered as #2-0.

NifGetPath - Getting the path to nif #2-0
NifGetPath - Returning "ni\CMR - Master_0.nif".

GetNifTypeIndex - Getting the code for Nif block type "NiMaterialProperty".
GetNifTypeIndex - Returning 192.

NiNodeGetChildren - Getting Children nodes to nif #2-0 block #0.
NiNodeGetChildren - Returning node's children.

NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
NiAVObjectGetNumProperties - Getting the number of properties held by of Child #0 of nif #2-0
NiAVObjectGetNumProperties - Returning 0.
Game quit: Deleting ni\ directory.

User avatar
Sabrina garzotto
 
Posts: 3384
Joined: Fri Dec 29, 2006 4:58 pm

Post » Wed Mar 30, 2011 12:54 am

You must have entered the script wrong. Please post it.
User avatar
Catharine Krupinski
 
Posts: 3377
Joined: Sun Aug 12, 2007 3:39 pm

Post » Wed Mar 30, 2011 8:07 am

I cant post it all, but here is the bit that uses nifse.

				let nifID := NifOpen $filepath 1				let filepath := NifGetPath nifID				let NiMaterialPropertyID := GetNifTypeIndex "NiMaterialProperty"				let children := NiNodeGetChildren nifID				foreach child <- children					if eval ( NiAVObjectGetNumProperties nifID (*child) )						set blockID to NiAVObjectGetPropertyByType NiMaterialPropertyID nifID (*child)  						if ( blockID > -1 ) 							let matName := NiObjectNETGetName nifID blockID 						else 							let matName := "None" 						endif						if sv_Compare skin material == 1							message "Skin Found"						endif					endif				loop

User avatar
Darrell Fawcett
 
Posts: 3336
Joined: Tue May 22, 2007 12:16 am

Post » Wed Mar 30, 2011 12:04 am

I copied and pasted that and it worked fine. Do you have the compiler override enabled (i.e. _GameMode instead of GameMode)?
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Wed Mar 30, 2011 7:28 am

Updated to beta 4; new save system is in place and the NiMaterialProperty and NiStencilProperty functions have been added.
User avatar
sally R
 
Posts: 3503
Joined: Mon Sep 25, 2006 10:34 pm

Post » Wed Mar 30, 2011 2:44 am

This tool has fantastic potential. I had some success running Unnecessary Violence with the dummy NifScript and NifSE 1.0 b3. Dual wielding and throwing seem to work fine.

There were two problems however (haven't tested yet with b4 to see if they're already solved):
- If I saved with a weapon switched to my off-hand (in this case an ayleid battleaxe from KOTN), on game load it would always revert to the longsword mesh.
- Even after disabling Unnecessary Violence I could still see in the console that NifSE was loading meshes, for "mod 255". I think it was saving them, too. This sounds like savegame bloat if you can't get rid of the NifSE meshes a mod created by removing it from your load order.
User avatar
Luis Reyma
 
Posts: 3361
Joined: Fri Nov 02, 2007 11:10 am

Post » Tue Mar 29, 2011 11:56 pm

Gabba: the unnecessary loading is why those functions that UV uses are deprecated. NifSE has absolutely no way of knowing if they're still necessary or not, so it keeps them. The bloating should not be very serious, however - not very much data is saved per mesh. Frankly, I don't particularly wish to continue to support those functions, and writing some kind of utility to instruct NifSE to forget about them does not strike me as a particularly worthwhile use of my time. I've already "wasted" enough time as it is making sure that I haven't completely broken those functions.

As for the load issues, that's... it actually sounds like a UV problem, not a NifSE problem. I'm not certain. Would you mind including NifSE.log (after a game session that includes both a save and a load, preferably)? I know on my end, I can save meshes created by those deprecated functions and load them up correctly (though if you call a deprecated function [or NifOpen or NiNodeCopyChild] on a NifSE-modified mesh, it won't load correctly in beta 3 - that's why I rewrote things for beta 4, since going forward that situation becomes more and more likely).
User avatar
..xX Vin Xx..
 
Posts: 3531
Joined: Sun Jun 18, 2006 6:33 pm

Post » Wed Mar 30, 2011 4:46 am

I've reinstalled UV and NifSE b4, and reverted to a save before I installed it and NifSE b3. But I haven't been able to reproduce the bug. This time items loaded fine, but testing conditions were not exactly the same: I've uninstalled Knights of the 9, and this time the weapons I used were either from vanilla or OOO. Maybe the problem was related to the Knights.bsa? I've read in the DR6 thread that NifSE has had problems loading from bsas.

In any case I'm done testing this for now: UV has several other bugs besides what I described, it conflicts with my hotkey mod, and so on. Too bad since it's really close to integrating well in the game world; hopefully Hex will return soon with a new version!
User avatar
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Wed Mar 30, 2011 2:39 pm

Beta 3 fixed all of the problems you read about in the DR thread. Was the weapon a longsword before you started?
User avatar
Stu Clarke
 
Posts: 3326
Joined: Fri Jun 22, 2007 1:45 pm

Post » Wed Mar 30, 2011 1:59 am

Beta 3 fixed all of the problems you read about in the DR thread. Was the weapon a longsword before you started?

Good to know that the problems are fixed. I'm not sure I understand your question so I'm gonna summarize everything (I missed some details in my descriptions above):

Test #1:
- Installed: UV, NifSE b3, OBSE 20b4 or b5
- I cleaned the UV esp, which removed a few identical to master records
- When switching a (two-handed) Ayleid Battleaxe from Knights of the Nine to off-hand, and saving and exiting the game, on next load it would have the same name, but with the mesh/texture of a vanilla elven (long?)sword (sorry, I was mistaken when I said plain longsword above).

Test #2:
- Installed: UV, NifSE b4, OBSE20b5
- I reverted to the original (non-cleaned) UV esp, just in case.
- Tried to reproduce the bug with some single-handed weapons I had on hand (from vanilla and OOO), but this time loading/saving worked fine.

Too many parameters changed to make the test conclusive, I know, but the game was crashing way too often, and I got tired of testing. If someone wants to take it up and do more test, he has my blessing.
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Wed Mar 30, 2011 2:09 pm

Yeah, there's basically no way from my end for the type of weapon to change. That sounds like UV replaces your weapon with a special weapon whose mesh it updates to match whatever you had before (except with the handedness changed), and whose default mesh is the Elven Longsword. For some reason, it seems the change to that weapon (from the default Elven Longsword to battleaxe) wasn't saved, but that's not a NifSE thing.
User avatar
Ownie Zuliana
 
Posts: 3375
Joined: Thu Jun 15, 2006 4:31 am

Post » Wed Mar 30, 2011 6:53 am

OK, beta 5's up. I'm strongly considering releasing v1.0 final as exactly what's in beta 5 after some testing by you guys, because there've been an insane number of things added and the obvious things left on my to-do list are going to take longer. Please speak up if you have any requests that you'd like to see happen sooner rather than later!

Also, I finally updated the CS Wiki with documentation for all of the new functions. Ugh, that's so tedious.
User avatar
Sunny Under
 
Posts: 3368
Joined: Wed Apr 11, 2007 5:31 pm

Post » Wed Mar 30, 2011 10:54 am

Um, unfortunately don't have the time to test anything, but stumbled upon a commands that sounds interesting: Does http://cs.elderscrolls.com/constwiki/index.php/NiNodeCopyChild allow to copy stuff (or even the whole thing) from one nif to another?


If so: :intergalactic:
:twirl:
User avatar
Rik Douglas
 
Posts: 3385
Joined: Sat Jul 07, 2007 1:40 pm

Post » Wed Mar 30, 2011 3:17 pm

It does. For example, http://img.photobucket.com/albums/v238/DragoonWraith/Oblivion/NifSE/ScreenShot8.png is a picture of my assistant showing off a NifSE-made combination of Steel Dagger scaled to half size and translated 20 units on the Y axis, and the Wooden Rod model I made for Magickal Arsenal way back when.
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Wed Mar 30, 2011 12:46 am

Topic's a bit dusty, but I've got a question and an idea. What is the chance that EGM files for NIFs can be injected forcefully? Like if you have a piece of headwear that's assigned to the Head or Tail slot and you made an EGM for it, can Oblivion be forced to read that data and conformulate that mesh to match the head shape?
User avatar
Nicole Kraus
 
Posts: 3432
Joined: Sat Apr 14, 2007 11:34 pm

PreviousNext

Return to IV - Oblivion