Support SFMLab on Patreon

Universal Control Adder


Description

This is a small script I made to add the standard XPS-XNALARA controls into SFM, so that it will be easier to manipulate models imported from XNALARA with the standard bone names, without the need to attach a rig.
(My models are Catherine, Nude Nina TTT2 and Anna Williams TTT2)

Tutorial is inside the .rar in myNote.txt

This script was brought to you by detecter007 on www.sfmlab.com

Please report to me any bugs you might encounter.

Additional rant: I'm a total noob at making the flexes and controls properly for SFM, but at least I realized I could just add their controls on the control list so it will make the models easier to manipulate. Now that this is kinda out of the way for me, I will start importing new models that use the standard XNALara bone model.

Additional rant_2: Thanks to ganonmaster (although his criticism was unnecessarily harsh) I have fixed important bugs my script had. I might add a feature to the interface today, like the possibility of adding new custom controls.

Features to be added: None atm.



Comments

Ganonmaster

I have several issues with this script. I did not decompile the code in the Jar file but from just opening the jar file in Notepad++, I can deduce some glaring problems which lead me to believe that this script is basically useless. This program looks for the default animationgroups file at this hardcoded path: `C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\platform\cfg\sfm_defaultanimationgroups.txt` This will basically not work if you have SFM installed on a different hard drive. With SFM folders larger than 50GB being very common, it is not uncommon to have your SFM directory on a different hard drive due to storage concerns. It then creates a new folder called `C:\Program Files (x86)\Steam\SteamApps\common\SourceFilmmaker\game\platform\cfg\BACKUP\` and copies the file there. Next the script looks for a specific line in the animationgroups file and it will append a specific **predefined list** of animationgroups. It does not take into account the many variations in bone names that exist between XPS models or any XPS bone names that may already be present in the file. The script will add the values a second time if the script is run twice or more, duplicating the values and cluttering up the file. This program is incredibly "dumb" because all the values are hardcoded and it will just fail when any of the user's values are different. It also requires the installation of Java, which is unnecessary bloat for a script that only edits a text file. You can write this script in a few lines of {ython and have it run with only SFM installed. No need for any other tools. You can run Python code in SFM without the need for other programs. Python is really easy and has really comprehensive tools for working with text files and manipulating strings. Use it! And even then. Are people really that dumb to not know how to **copy and paste a list of pre-defined list of bone names into another text file**? Don't get me wrong, there is merit to automating this process, but I think it could be implemented much better with a little bit of forethought. For example, include a text file with the bones names that should be added and let the script read the definitions from there. That way the user can edit the definitions list and add more than just the basic XPS bones and maybe also the Blender bone name convention or naming schemes from other games. Try to auto-detect the SFM directory first, then let the user confirm if the location is correct. Prompt the user to specify his SFM directory manually if you can't find it in the usual location. Then, read the file and check if the bone names you are adding are already present and only add them if they're not there. That way you don't clutter up the file with useless shit. In its current state, this is incredibly shoddy work. I can understand if this is your first programming project, but I urge you to *think* about the problem you are trying to tackle before you just start writing your code. I considered not approving this upload based on my assessment, but it's not like I moderate models or texture uploads for quality either. I just hope you will consider some of this feedback and hope you will write a better version at some point. It will help you become a better programmer and problem solver.

Ganonmaster posted 3 years, 6 months ago

detecter007

@Ganonmaster Ouchies, you could've put the problems this script in a lighter tone, but I'll address your points immediately. - The script is not useless, I'm sure there are people who don't know how to make those changes, and I just wanted to help them. - I have said that this script adds the STANDARD XPS/XNALARA bones to the control list. I was thinking about implementing a basic interface to help the user add additional bones he may wish, but that would've been a later update, or a whole other script at that. - Yes, you are correct, the hardcoded path was a bad idea, I will make it so that the user can choose the correct path for his SFM\cfg - Are you sure the program duplicates the notepad? Because then I just forgot to rebuild it... I have tackled that problem as far as I remember. I'll update this script anyhow today. - "Not having Java on your computer in 2016." Seriously bloat program?... It's 8mb and it requires a soft that most people SHOULD have on their computer. Maybe you have an affinity to Python but I'm not forcing anyone to use my software if they do not wish to install Java. - If you wish to do improvements to my script, you can do them on your own, I only wanted people to report any bugs they might encounter. - That is your subjective opinion. Stating that this is my first programming project is absurd. Do you know me in person? Do you know my background? You assess my entire programming work in a single simple text script that I have done in less than 2 hours while lazily looking at some videos on the background. TL;DR version: I'm going to update the program, I think it can be useful to some people, Java is common on a lot of PC's, I don't intend to make it more than add the XPS bone standard. I really wish not all mods talk to their userbase like they are some annoying teenagers.

detecter007 posted 3 years, 6 months ago

detecter007

Correction to my first comment for @Ganonmaster, my files isn't even 8mb, its less than 15kb...

detecter007 posted 3 years, 6 months ago

detecter007

Script is now patched and most bugs are gone! In the future if I ever decide of making new scripts I will make them earlier in the day so I can focus better on debugging. :)

detecter007 posted 3 years, 6 months ago

Ganonmaster

I am aware that Java is still common on many PCs but it is a popular attack vector for exploits, has many zero-day vulnerabilities and is not open source software. However, Java usage is decreasing rapidly worldwide. Web based Java applets no longer work because modern browsers no longer support NPAPI. That narrows the userbase down to businesses trapped in Oracle's draconian contracts and people who play Minecraft on PC. Java's only relevancy in today's world is thanks to mobile phones, but that doesn't help its PC install base one bit. I'm oversimplifying ofcourse, but it is about as common (and often the safer choice) to not have Java installed. Keep your target audience in mind. Your target audience uses SFM and most likely on Windows. That basically means you already know, have several pre-installed and comprehensive runtime environments to work with (visual c++, C#, python), but instead you add another one to the mix. Convenient for you, but the user has to install another relatively large piece of software for a script they'll only use once. For the task this script executes, that's overkill. KISS. Don't take this the wrong way, I'm just pouring out my thoughts comparing your script to how I would tackle a project like this. I made an assumption based on the code I read and it doesn't look like something that would've taken a relatively inexperienced programmer long to write. And by that I don't mean to hate on your skill level. I don't know your situation. I don't mean to offend you or attack you personally. But that's what it looked like to me.

Ganonmaster posted 3 years, 6 months ago

lapinedours

Why make it simple when you can make it complicated ;) ganon do not have quite wrongly I think imo. you should accept criticism when it's constructive i think ;)

lapinedours posted 3 years, 6 months ago

detecter007

All I can say is that I'm not very experienced in python and so I did it in Java. I wasn't looking to over complicate, simplify or anything. Your criticism was harsh and too long, a lot of the "problems" like the "bloat" software were not necessary. I do not take offence, nor should anyone take offence in any criticism that has some relevant points in it, and my answer tackled your points, but your relevant points were spread wide, with a lot of subjective taste about what is the "better" way. I took in consideration what you said, but I will continue to write in whatever I think is in my capabilities. And I repeat, if someone in the website does not wish to use my script because it is in JAVA, then he may make his own script, or ask someone else to make a script for him in python, or just, like you said, make the changes himself in the notepad file.

detecter007 posted 3 years, 6 months ago

this is great! i really hope many people adopt it since this would make porting XNA models so much easier. i know i'll try to utilize it on a few.

panzerfaust posted 3 years, 6 months ago


Leave a reply

You need to be logged in to leave a comment.

Support SFMLab on Patreon