Section 12. Useful Editor and Runtime Utility Nodes/Functions

Section 12.1. Introduction

rdInst has many useful utility functions, both for run-time and for the editor – I’ll try and cover the most useful ones here in two sections:

Section 12.1.1 – Editor Utilities
  1. Probably the most used by me is the “rdDirty()” function – It can be very useful when you want to spawn and build from the constructor during editing, but not have all the hassle of not knowing what’s already constructed, the issues with attached actors – and of course, the 100 million times the constructor gets called when dragging etc. If you’re using the rdActor with managed instances or one of the standard build types, just call it and it will take care of it. If you want custom control, just derive rdBuild and add your code there – it happens after your actor as been created, and filters out multiple calls so only gets called once at the end.
  2. Another useful couple are “rdIsEditor()” – you can execute code only if in the editor, or visa-versa. Also “rdIsRealWorld()” can be used to execute code only in the level, not in Blueprint Editor viewports.
  3. This one is really useful too – “rdAddToTickHookList()” and “rdRemFromTickHookList()” – when in the Editor, you can receive ticks on your actor at any time.
  4. ReseatMeshInstances()” can be very useful if you change the pivot on a mesh – this allows you to offset the mesh in the prefab by any amount.
  5. There’s no easy way to set an Actors label! That’s where “rdSetActorLabel()” comes in.
Section 12.1.2 – Run-time Utilities
  1. rdGetCurrentScalability()” is an easy way to grab the current scalability.
  2. rdBakeVolumeTransformsForProxies()” is a realtime system that harvests the locations of objects in volumes such as PCG and builds fast scan data for swapping them to proxies.
  3. rdGetFunctionCycles()” is an easy to use way to time functions.
  4. rdTestForActorChange()” can be used to signal rdInst that instance transforms need to be updated.

Section 12.2. Tutorials