//获取到世界大纲中的 Bp_CineCameraProj 实例
for (TActorIterator ActorItr(GetWorld()); ActorItr; ++ActorItr)
{
FString str1 = ActorItr->GetName();
if (str1.Equals(TEXT(“BP_CineCameraProj_2”))) {
this->m_BPCameraActor = ActorItr;
this->m_BP_cinecamera_proj=ActorItr->GetClass()->GetDefaultObject();
//获取其中AlphaThreshold 关于抠像色值的一个参数,按理说设置到1.4投射的视频会变成全灰
UProperty Prop = m_BP_cinecamera_proj->GetClass()->FindPropertyByName(TEXT(“AlphaThreshold”));
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT("2The Properties Before Is : %s "), Prop->GetName()));
void StructAddress = Prop->ContainerPtrToValuePtr(m_BP_cinecamera_proj);
UFloatProperty* ChildFloatProp = Cast(Prop);
//输出修改前返回值
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT("3The Properties Before Is : %f "), ChildFloatProp->GetPropertyValue_InContainer(StructAddress)));
//将AlphaThreshold变量改为1.4
float floatNumber = float(1.4f);
//设置变量操作
ChildFloatProp->SetPropertyValue_InContainer(StructAddress, floatNumber);
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Green, FString::Printf(TEXT("The Properties After Is: %f "), ChildFloatProp->GetPropertyValue_InContainer(StructAddress)));
}
}
}
I Use Plugin is Composite Plane ,Use to Operate GreenVideo,But Find the Property has Changed in DebugMessage,But The Camera projection to plane has No Change ,
Hope Any Advice And Help ~~