Got a spare computer on your LAN sitting idle? Do you wish your lighting bakes wouldn’t take so long? Well, Unreal Engine’s Swarm system allows you to bake lightmaps using computers on your network to share the load and speed up your bakes.
Read More →Tips and Tricks
Unreal Engine C++: How to spawn a Blueprint by name
If you find yourself wanting to spawn a Blueprint class within C++, here’s how.
Read More →Visual Studio Extensions: How to get colors from the VS theme
TL;DR:
// Note that I've only tried this in VS 2022.
// Browse the EnvironmentColors class to see all the available colors.
var themeColor = VSColorTheme.GetThemedColor(EnvironmentColors.ToolWindowBackgroundColorKey);
// If you want to use this in a WPF brush, convert it like this.
var wpfCompatibleColor = Color.FromRgb(themeColor.R, themeColor.G, themeColor.B);
Read on for full details.
Read More →JavaScript snippet: Remove base URL from link
I needed this function this morning so I thought I’d share it in case someone else does too.
function RemoveBaseUrl(url) {
/*
* Replace base URL in given string, if it exists, and return the result.
*
* e.g. "http://localhost:8000/api/v1/blah/" becomes "/api/v1/blah/"
* "/api/v1/blah/" stays "/api/v1/blah/"
*/
var baseUrlPattern = /^https?:\/\/[a-z\:0-9.]+/;
var result = "";
var match = baseUrlPattern.exec(url);
if (match != null) {
result = match[0];
}
if (result.length > 0) {
url = url.replace(result, "");
}
return url;
}
Pre-populate Django ModelForm with Specific Queryset
I just had a situation where I was trying to filter the queryset for a ModelMultipleChoiceField based on the currently logged-on user. I was going crazy trawling through the Django docs and eventually Google. It seemed like something which should be so simple, but there was no obvious way to do it. Eventually I found the answer, and it IS simple!
Read More →