Earen Posted November 22, 2014 Posted November 22, 2014 @4onen NiOverride doesn't animates node scale changes, so .. NetImmerse also doesn't do that. But Nioverride is quicker in displaying new values. Just pointed to the author that one of his ideas still can be implemented But it seems like NetImmerse Override could be a better, centralized place for doing all node related operations (e.g. scale animations, too)..
4onen Posted November 22, 2014 Author Posted November 22, 2014 @4onen NiOverride doesn't animates node scale changes, so .. NetImmerse also doesn't do that. But Nioverride is quicker in displaying new values. Just pointed to the author that one of his ideas still can be implemented But it seems like NetImmerse Override could be a better, centralized place for doing all node related operations (e.g. scale animations, too).. It could, but for effective animating of a node you have to lock any other updates to that node, (spin off another thread somehow, I'm looking into that) and then run the increment and application over and over until the requisite size is reached. And what if the mod author wanted a different time period between increments? Like spurts of cum after sex? It's better to let the authors handle that side of things. I could write example scripts for it, but there isn't really a reason to implement scaling animation as a part of the framework. So yeah, lets let this thread die and I'll pull out my animation code to write some example snippets. Ta!
dweezer Posted December 7, 2014 Posted December 7, 2014 So, I'm just doing a test build of Macromancy using NiOverride, and I'm slightly confused on the AddNodeTransformScale function. In trying to animate this, is the scale variable the amount to be added when calling that function at the time, or the modified total for that node? If it's the former, then that's going to mean a hefty rewrite. Also, while I think it works this way, I want to be sure: does the isFemale bool being set as false mean it's then for both genders?
DeepBlueFrog Posted December 7, 2014 Posted December 7, 2014 Great... a conversation about NiOverride. Something I noticed with Hormones (and it is happening more as mods are adding more changes to body shape using NiOverride) is that too many calls from multiple mods to QueueNiNodeUpdate to apply the changes result in pretty serious crashes. Did you guys run into that issue before? any tips to better handle it?
4onen Posted December 7, 2014 Author Posted December 7, 2014 I was trying to build my mod off of the NetImmerse script packaged with SKSE, so I haven't had a chance to mess too deeply with NiOverride. As far as I understand, the scale value is the modified total for the node as defined by your modkey. Say you have set the node to 5.0 with your modkey then call the function again with 1.0, it'll subtract 4.0 from the current node scale across all mods and just set that. So it's a modified total that ignores the values from other mods, but will be summed to them. (As I understand)
Groovtama Posted December 8, 2014 Posted December 8, 2014 Great... a conversation about NiOverride. Something I noticed with Hormones (and it is happening more as mods are adding more changes to body shape using NiOverride) is that too many calls from multiple mods to QueueNiNodeUpdate to apply the changes result in pretty serious crashes. Did you guys run into that issue before? any tips to better handle it? The main advantage of NiOverride for Hormones for example, would be that I can do my sliders in RM and you can do your scales in Hormones and nobody of us two have to think 2 secs of what the other does. You don't have to save an inital scale of anything you just have your transforms with your keys and I have mine. You don't need to reapply at startup,you don't need to check if anythng has changed. When you wanna uninstall your mod you remove your transforms and don't have to reload some saved values from ages ago. Where other mods may have changed them middlewhile anyway. That is also a reason why I do no belly slider, Because most likely one mod gets fucked up or overwrite it anyway. And I converted some pregnancy mods from NetImmerse to NiOverride, it's technically just coping over my scale function from earlier and replacing NetImmerse.SetNodeScale with just SetNodeScale you copied. You can also throw out the part with akactor == player, for first person scaling transforms are so small and performance cheap that doesn't matter anymore. QueueNiNodeUpdate is not needed for scale changes with NiOverride. So you don't need to call it on Transforms. Maybe for Weight or Textures y such changes are sheldom comapred to scales. QueueNiNodeUpdate never worked properly that what Expired said to me. I was trying to build my mod off of the NetImmerse script packaged with SKSE, so I haven't had a chance to mess too deeply with NiOverride. As far as I understand, the scale value is the modified total for the node as defined by your modkey. Say you have set the node to 5.0 with your modkey then call the function again with 1.0, it'll subtract 4.0 from the current node scale across all mods and just set that. So it's a modified total that ignores the values from other mods, but will be summed to them. (As I understand) You have a Transform named with key "myTransform", that transform can contain 3 changes scale (AddTransformScale), translation (AddTransformPosition) and rotation (AddTransformRotation) with the same key. You now add a scale Transform with "myTransform" as key with the value 5.0, the result will be the following: original bone scale * other scale Transforms * your scale Transform (5.0) You now add/change (adding with the same key is changing it) the scale of Transform with "myTransform" as key with the value 1.0, the result will be the following: original bone scale * other scale Transforms * your Transform scale (1.0) which is the same as original bone scale * other scale Transforms (that is why you can remove scale trasform when they are 1.0, same for rotation and translations when they are 0.0) The difference to NetImmerse is now you don't change the scale, you scale it. If you use NetImmerse scale change on a Belly with value 5.0 your Belly node will have the scale 5.0. If you do the same with NiOverride and the Belly is orginal 1.1 and your Transform with 5.0 the scale will be 5.5. Animating growth with NiOverride is not much different than doing it in NetImmerse.
DeepBlueFrog Posted December 8, 2014 Posted December 8, 2014 Interesting... I didn't realize that NiOverride didn't require a refresh from QueueNodeUpdates. I will try out your SetScale function in Hormones once SD+ 3.0 is out the door.
Groovtama Posted December 8, 2014 Posted December 8, 2014 Interesting... I didn't realize that NiOverride didn't require a refresh from QueueNodeUpdates. I will try out your SetScale function in Hormones once SD+ 3.0 is out the door. If you need multiple ModKeys on one bone there are also ones with a modkey as parameter and the same for rotation and postions. You might need to look through multiple script sourcefilles of mine. The more mods with NiO the better, NetImmerse is just such a horror of incompatibility issues even when using NetImmerse with NiO most mods with NetImmerse just fail the whole thing.
4onen Posted December 8, 2014 Author Posted December 8, 2014 So you use multiplication to scale! Interesting. And makes a bit more sense than adding the scales and NetImmersing... Thanks for making NiO! I'm going to go around suggesting that to the mod authors whenever someone complains about incompatibilities now.
Groovtama Posted December 8, 2014 Posted December 8, 2014 So you use multiplication to scale! Interesting. And makes a bit more sense than adding the scales and NetImmersing... Thanks for making NiO! I'm going to go around suggesting that to the mod authors whenever someone complains about incompatibilities now. Like I said transforms are behaving like new bones in the skeleton, and skeleton is every previous scale is a scalar to the later ones. Same goes for Rotation and Translation they are slightly different from non-trivial solutions, that are also the twos when you try something you need a skeleton mannequin in nifskope. But scale should be be easier as scalar.
dweezer Posted December 9, 2014 Posted December 9, 2014 So, I just caught up on the thread, and I though I'd try a code example: If NetImmerse.HasNode(ActorRef, LBreastNode, False) && NetImmerse.HasNode(ActorRef, RBreastNode, False) Float NewBust = GetFloatValue(ActorRef, "BSR_Bust") if HasNodeTransformScale(ActorRef, false, true, LBreastNode, "BSR_Bust") RemoveNodeTransformScale(ActorRef, false, true, LBreastNode, "BSR_Bust") RemoveNodeTransformScale(ActorRef, false, true, RBreastNode, "BSR_Bust") EndIf AddNodeTransformScale(ActorRef, false, true, LBreastNode, "BSR_Bust", NewBust) AddNodeTransformScale(ActorRef, false, true, RBreastNode, "BSR_Bust", NewBust) UpdateNodeTransform(ActorRef, false, true, LBreastNode) UpdateNodeTransform(ActorRef, false, true, RBreastNode) EndIf For context, this is an attempt at a rewrite for Body Scale Randomizer (as I'd like to transition to this from Macromancy) , as part of a reusable standalone function. Did I miss anything? Also, as this stands for animating, could I then just use the function call in a loop (once dependencies are set) as BSR.SetBustScale(actor) without having to rework the math, or is it better in the long term to just use the AddNodeScaleTransform once I jigger the math to fit?
Groovtama Posted December 9, 2014 Posted December 9, 2014 So, I just caught up on the thread, and I though I'd try a code example: If NetImmerse.HasNode(ActorRef, LBreastNode, False) && NetImmerse.HasNode(ActorRef, RBreastNode, False) Float NewBust = GetFloatValue(ActorRef, "BSR_Bust") if HasNodeTransformScale(ActorRef, false, true, LBreastNode, "BSR_Bust") RemoveNodeTransformScale(ActorRef, false, true, LBreastNode, "BSR_Bust") RemoveNodeTransformScale(ActorRef, false, true, RBreastNode, "BSR_Bust") EndIf AddNodeTransformScale(ActorRef, false, true, LBreastNode, "BSR_Bust", NewBust) AddNodeTransformScale(ActorRef, false, true, RBreastNode, "BSR_Bust", NewBust) UpdateNodeTransform(ActorRef, false, true, LBreastNode) UpdateNodeTransform(ActorRef, false, true, RBreastNode) EndIf For context, this is an attempt at a rewrite for Body Scale Randomizer (as I'd like to transition to this from Macromancy) , as part of a reusable standalone function. Did I miss anything? Also, as this stands for animating, could I then just use the function call in a loop (once dependencies are set) as BSR.SetBustScale(actor) without having to rework the math, or is it better in the long term to just use the AddNodeScaleTransform once I jigger the math to fit? That code isn't really optimized that RemoveNodeTransformScale part doesn't make mach sense because if HasNodeTransformScale would be true and you remove it, the result is the same as if it were false, AddNodeTransformScale will update it, or you could just use my help function that removes on 1.0 If NetImmerse.HasNode(ActorRef, LBreastNode, False) && NetImmerse.HasNode(ActorRef, RBreastNode, False) Float NewBust = GetFloatValue(ActorRef, "BSR_Bust") SetNodeScaleEX(ActorRef, false, LBreastNode, NewBust, "BSR_Bust") SetNodeScaleEX(ActorRef, false, RBreastNode, NewBust, "BSR_Bust") EndIf ..... Function SetNodeScaleEX(Actor akActor, bool isFemale, string nodeName, float value, string modkey) If value != 1.0 NiOverride.AddNodeTransformScale(akActor, false, isFemale, nodeName, modkey, value) NiOverride.AddNodeTransformScale(akActor, true, isFemale, nodeName, modkey, value) Else NiOverride.RemoveNodeTransformScale(akActor, false, isFemale, nodeName, modkey) NiOverride.RemoveNodeTransformScale(akActor, true, isFemale, nodeName, modkey) Endif NiOverride.UpdateNodeTransform(akActor, false, isFemale, nodeName) NiOverride.UpdateNodeTransform(akActor, true, isFemale, nodeName) EndFunction That would exactly do the same + update the first person breasts also, and would auto remove the transforms when they unneeded.
Expired6978 Posted December 9, 2014 Posted December 9, 2014 Adding a transform of the same type with the same key will overwrite the previous entry. By type I mean scale, rotation, translation. You can have one of each per key. If you are going to immediately overwrite it there's no point in removing it. You should only remove transforms when they are normalized, i.e. their result contributes nothing to the calculation. e.g. scale * 1.0 = scale rot * 0 degrees = rot (Essentially matrix multiplication by the identity, which doesn't change the matrix) pos + (0,0,0) = pos UpdateNodeTransform actually performs the computation and applies the result on the bone and updates the world data, Adding and Removing keys only alters the internal table from which the computation draws from.
dweezer Posted December 10, 2014 Posted December 10, 2014 Ok, so now I have all that integrated and compiling correctly, but nothing happens when trying to push the values in a while loop to animate changes. While Casting == 0 If cBreastCurrent < tarBreasts cBreastCurrent += 0.01 if cBreastCurrent > tarBreasts cBreastCurrent = tarBreasts endif BSR.SetNodeScaleEx(Caster, false, "NPC L Breast", cBreastCurrent, "BSR_Bust") BSR.SetNodeScaleEx(Caster, false, "NPC R Breast", cBreastCurrent, "BSR_Bust") SetFloatValue(Caster, "BSR_Bust", cBreastCurrent) EndIf Utility.Wait(0.3) EndWhile The StorageUtil is reporting back correctly, but nothing is visually happening, so I must be doing something wrong. Edit: I never did get an answer in regards to if the IsFemale bool matters, so I tried making a helper function to return a bool based on the gender of the actor(s) in each function. I do have to ask though: if the IsFemale bool designates which skeleton to look at, is it also working for beast races (and their skeletons), or will that be a separate variable to add in the future? I mainly use Jhajiit (or variants thereof) and it would be nice if the scaling can also work for the HDT werewolves, but I can be patient.
Groovtama Posted December 12, 2014 Posted December 12, 2014 Ok, so now I have all that integrated and compiling correctly, but nothing happens when trying to push the values in a while loop to animate changes. While Casting == 0 If cBreastCurrent < tarBreasts cBreastCurrent += 0.01 if cBreastCurrent > tarBreasts cBreastCurrent = tarBreasts endif bool gender = Caster.GetActorBase().GetSex() BSR.SetNodeScaleEx(Caster, gender, "NPC L Breast", cBreastCurrent, "BSR_Bust") BSR.SetNodeScaleEx(Caster, gender, "NPC R Breast", cBreastCurrent, "BSR_Bust") SetFloatValue(Caster, "BSR_Bust", cBreastCurrent) EndIf Utility.Wait(0.3) EndWhile The StorageUtil is reporting back correctly, but nothing is visually happening, so I must be doing something wrong. Edit: I never did get an answer in regards to if the IsFemale bool matters, so I tried making a helper function to return a bool based on the gender of the actor(s) in each function. I do have to ask though: if the IsFemale bool designates which skeleton to look at, is it also working for beast races (and their skeletons), or will that be a separate variable to add in the future? I mainly use Jhajiit (or variants thereof) and it would be nice if the scaling can also work for the HDT werewolves, but I can be patient. yeah isFemale does matter and needs to be true when you want to address female skeletons, you addressing the male one, Caster.GetActorBase().GetSex() instead of true and false always makes that you address the right one.
dweezer Posted December 13, 2014 Posted December 13, 2014 Ok, so now I have all that integrated and compiling correctly, but nothing happens when trying to push the values in a while loop to animate changes. While Casting == 0 If cBreastCurrent < tarBreasts cBreastCurrent += 0.01 if cBreastCurrent > tarBreasts cBreastCurrent = tarBreasts endif bool gender = Caster.GetActorBase().GetSex() BSR.SetNodeScaleEx(Caster, gender, "NPC L Breast", cBreastCurrent, "BSR_Bust") BSR.SetNodeScaleEx(Caster, gender, "NPC R Breast", cBreastCurrent, "BSR_Bust") SetFloatValue(Caster, "BSR_Bust", cBreastCurrent) EndIf Utility.Wait(0.3) EndWhile The StorageUtil is reporting back correctly, but nothing is visually happening, so I must be doing something wrong. Edit: I never did get an answer in regards to if the IsFemale bool matters, so I tried making a helper function to return a bool based on the gender of the actor(s) in each function. I do have to ask though: if the IsFemale bool designates which skeleton to look at, is it also working for beast races (and their skeletons), or will that be a separate variable to add in the future? I mainly use Jhajiit (or variants thereof) and it would be nice if the scaling can also work for the HDT werewolves, but I can be patient. yeah isFemale does matter and needs to be true when you want to address female skeletons, you addressing the male one, Caster.GetActorBase().GetSex() instead of true and false always makes that you address the right one. Like I said earlier in my edit, I made a helper to return true if female, false if male that is then called for each actor prior to the loop starting (stored in separate variables). I'm still not seeing any animation though. I wonder if I need to upload my code for others to pour through as to what I'm still doing wrong.
Earen Posted December 13, 2014 Posted December 13, 2014 Ok, so now I have all that integrated and compiling correctly, but nothing happens when trying to push the values in a while loop to animate changes. While Casting == 0 If cBreastCurrent < tarBreasts cBreastCurrent += 0.01 if cBreastCurrent > tarBreasts cBreastCurrent = tarBreasts endif bool gender = Caster.GetActorBase().GetSex() BSR.SetNodeScaleEx(Caster, gender, "NPC L Breast", cBreastCurrent, "BSR_Bust") BSR.SetNodeScaleEx(Caster, gender, "NPC R Breast", cBreastCurrent, "BSR_Bust") SetFloatValue(Caster, "BSR_Bust", cBreastCurrent) EndIf Utility.Wait(0.3) EndWhile The StorageUtil is reporting back correctly, but nothing is visually happening, so I must be doing something wrong. Edit: I never did get an answer in regards to if the IsFemale bool matters, so I tried making a helper function to return a bool based on the gender of the actor(s) in each function. I do have to ask though: if the IsFemale bool designates which skeleton to look at, is it also working for beast races (and their skeletons), or will that be a separate variable to add in the future? I mainly use Jhajiit (or variants thereof) and it would be nice if the scaling can also work for the HDT werewolves, but I can be patient. yeah isFemale does matter and needs to be true when you want to address female skeletons, you addressing the male one, Caster.GetActorBase().GetSex() instead of true and false always makes that you address the right one. Like I said earlier in my edit, I made a helper to return true if female, false if male that is then called for each actor prior to the loop starting (stored in separate variables). I'm still not seeing any animation though. I wonder if I need to upload my code for others to pour through as to what I'm still doing wrong. Written this for myself to update some mods that are not aware of NiOverride scaling functionality.. lol it seems simpler to list mods who use new scaling instead. Note, that this code is bad for production use, it was written to imitate NetImmerse and to not bother myself with re-writing of bunch of their code Scriptname NetImmerseEx Hidden Function SetNodeScale(string modKey, ObjectReference ref, string nodeName, float value, bool firstPerson) global bool isFemale = false Actor act = ref as Actor if act isFemale = act.GetActorBase().GetSex() as bool endif If value != 1.0 NiOverride.AddNodeTransformScale(ref, firstPerson, isFemale, nodeName, modKey, value) Else NiOverride.RemoveNodeTransformScale(ref, firstPerson, isFemale, nodeName, modKey) Endif NiOverride.UpdateNodeTransform(ref, firstPerson, isFemale, nodeName) endfunction float Function GetNodeScale(string modKey, ObjectReference ref, string node, bool firstPerson) global bool isFemale = false Actor act = ref as Actor if act ActorBase targetBase = act.GetActorBase() isFemale = targetBase.GetSex() as bool endif if NiOverride.HasNodeTransformScale(ref, firstPerson, isFemale, node, modKey) return NiOverride.GetNodeTransformScale(ref, firstPerson, isFemale, node, modKey) Else return 1.0 endif endfunction
dweezer Posted December 13, 2014 Posted December 13, 2014 About the only real difference is I'm actually using GetLeveledActorBase instead of GetActorBase. Is that somehow not reporting the correct value back when checking gender? Edit: Wait, you're passing an ObjectReference instead of an Actor? I know that the NetImmerse original functions use ObjectReferences, so have I been passing the wrong type the whole time in the new functions?
Groovtama Posted December 13, 2014 Posted December 13, 2014 About the only real difference is I'm actually using GetLeveledActorBase instead of GetActorBase. Is that somehow not reporting the correct value back when checking gender? Edit: Wait, you're passing an ObjectReference instead of an Actor? I know that the NetImmerse original functions use ObjectReferences, so have I been passing the wrong type the whole time in the new functions? ObjectReference is the parent class of Actor, so Actor is also an ObjectReference but an ObjectReference doesn't need to be an Actor. Specialization: http://sourcemaking.com/uml/modeling-it-systems/structural-view/generalization-specialization-and-inheritance The compiler will cast it on compiling time automatically between ObjectReference and Actor.
Earen Posted December 13, 2014 Posted December 13, 2014 About the only real difference is I'm actually using GetLeveledActorBase instead of GetActorBase. Is that somehow not reporting the correct value back when checking gender? Mm, idk, it just works. I'm unaware of the difference. From what I read GetLeveledActorBase creates a copy of a base form (for what?) e.g. allocates unnecessary memory.
dweezer Posted December 13, 2014 Posted December 13, 2014 Hmm, just did another attempt with animating NiOverride changes on the player when compiled as GetActorBase instead of GetLeveledActorBase. The log reports "Error: Cannot call SetNodeScaleEX() on a None object, aborting function call". Maybe the Actor isn't somehow being passed through? Edit: and the GetGender bool function fails as well. In both cases, I'm checking with the Caster as defined in OnEffectStart. Edit2: Tried again with a recompiling and using GetLeveledActorBase instead. No difference,and the actor still isn't being passed on. I think it's because I referenced the main BSR script as a property (and didn't associate it in the CK). Edit the third: Retyped the property as importing the script instead, now getting an error on compile "cannot call the member function GetGender alone or on a type, must call it on a variable." I guess I have to create extra local variables for the actors prior to calling GetGender, then. Edit IV: Added the global tags to the functions to make them work in other scripts. Things have compiled properly now and are working, mostly. I'm getting a glitch where everytime I go through a loading screen it zeros out the height and I'm the size of a gnat. A quick fire of the restore to 1.0 height fixes it temporarily. I either need to have this fire automatically with OnCellAttach or use OnUpdate again. Still have to check if the other nodes are zeroing as well.
milzschnitte Posted January 7, 2015 Posted January 7, 2015 But what would happen if BeeingFemale, EstrusChaurus and FillHerUp are active.... and all 3 mods would scale the belly node at the same time. 2 Pregnancy mods + 1 mod that may scale the belly a lot. it would be a realy realy big belly or I'm wrong? It can happen that a chaurus may impregnates the actor with both mods - so it's realy easy possible that both pregnancy mods are "active" at the same time
Groovtama Posted January 7, 2015 Posted January 7, 2015 Depends on how you 3 would implement it, if you all would use 3 different keys the scales would multiply, if you 3 would use the same key it would overwrite each other. But you can also check if a transform key is on the belly and if it is not 1.0 and and so check if some other pregancy mod is active instead of checking for other mods or effects. If you for example would have Mana Tanks and EC and BF and all 3 would scale breast, you could do it that mana tanks would run independent of the other twos and the other have checks between them. At the moment all 3 mods would save each others data, check if each other are active etc.
milzschnitte Posted January 8, 2015 Posted January 8, 2015 I will try to implementate it in BF and using NetImmerse as a fallback when RaceMenu isn't installed. Don't want another requirement. I'm about to create some MCM Settings how BF should reavt to other mods like EC, Fill Her Up and most other node scaling mods. NiOverride will be a great help. Well, I have to find some performance safe ways to make this all work Thx for now Maybe I will find back when some questions are left :-)
Deimos Posted January 8, 2015 Posted January 8, 2015 But what would happen if BeeingFemale, EstrusChaurus and FillHerUp are active.... and all 3 mods would scale the belly node at the same time. 2 Pregnancy mods + 1 mod that may scale the belly a lot. it would be a realy realy big belly or I'm wrong? It can happen that a chaurus may impregnates the actor with both mods - so it's realy easy possible that both pregnancy mods are "active" at the same time I think if you had BeeingFemale, Soul Gem Oven, and Estrus Chaurus running, I would have any standard pregnancies from BF be ended if you get pregnant with EC, but in the case of SGO being just soulgems no change, ergo BF and EC would share the same weight scaling slot, where as SGO could be considered additonal amount added or to make it easier no weight changes, But with Fillherup give an additional scale added ontop of the original (Preg with EC and SGO 3 belly scale and then Fillherup would bump it to a 4 and then fall back to a 3 overtime .
Recommended Posts
Archived
This topic is now archived and is closed to further replies.