Unreal Learning Notes 8—Blueprint Operation of Other Unreal Modules

I. Introduction

        Blueprints can not only operate and communicate with each other, but other resources and modules also have methods of operation and communication. The text mainly explains the communication between blueprints and materials, Niagara, and editors.

2. Realization

2.1. Blueprint and materials

1) First, hold down "4 + left mouse button" in the material blueprint to create a parameter with a four-dimensional vector parameter, named "Self-illumination parameter", as shown in Figure 2.1.1:

Figure 2.1.1

2) Create a dynamic material instance for the target object: If an Actor's sphere does not have a material by default, it can be dynamically created through a blueprint.

Figure 2.1.2

A material instance, why is it called a material instance, because it is a copy of the original material, and any subsequent modifications will not affect the original material.

3) Modify the parameters in the material blueprint: add the parameter name "Self-illumination parameter" to it, and add the new value to it, as shown in Figure 2.1.3, so that the material instance is modified.

Figure 2.1.3

4) In addition to Vector, there are other parameter types, such as Float, Boolean, Int, etc.

2.2. Blueprint and Niagara

        The Niagara system is similar to Unity's particle system. It is a component that specializes in processing a large number of particle effects. It is very commonly used in both major engines. The following example is an operation that controls the number of particles in the particle system through a blueprint.

1) Add Niagara components to objects in 2.1: First, create a Niagara system, select it and then in the blueprint of 2.1

To add components, select the Niagara you just created.

2) Create a new blueprint operable variable: Open the blueprint of the Niagara system, and create a new one in the user disclosure as shown in Figure 2.2.1

Figure 2.2.1

A floating point number variable, name it "Control the number of particles". At the same time, you can change the default CPU simulation to GPU simulation

Figure 2.2.2

3) Drag this variable to the current variable to associate it: Select Spawn Rate, and then drag the newly created variable "Control the number of particles" to the option shown in Figure 2.2.3. Only variables of the same type can be directly linked by dragging them like this.

Figure 2.2.3

4) Control variables in the blueprint: Drag the created Niagara component into the blueprint, and then perform the operation as shown in Figure 2.2.4

Figure 2.2.4

The number of particles in the Niagara component

2.3. Blueprint and Editor

1) Create an editor control: right-click and select Editor Tools->Editor Tools Control. Open the blueprint of the control and you will find the UI editor.

Figure 2.3.1

the same.

2) Run the editor: Add a slider component to the editor tool, then return to the content and right-click to select the just created editor tool.

Figure 2.3.2

Tool-》Run Editor Tool Control, so that a newly created slider interface will be run in real time in the editing state, as shown in Figure 2.3.3

Figure 2.3.3

3) Control the object properties in the editing state through blueprints: Create the processing event "when the value changes" of the slide bar, that is, when the slide bar is dragged

Figure 2.3.4

This event will be triggered, and then the selected Actor will be bound. As shown in Figure 2.3.5, it is the Scale of all selected Actors.

Figure 2.3.4

To zoom, return to Figure 2.3.3, select any Actor in the editing interface, and then drag and drop the slider to change the scaling of the Actor.

3. Summary

none.

Guess you like

Origin blog.csdn.net/zhangxiao13627093203/article/details/134695423