Skip to content

Commit

Permalink
get rid of transient properties when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto De Ioris committed Jul 30, 2017
1 parent 166619c commit b157b2a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Source/UnrealEnginePython/Private/UObject/UEPyActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ PyObject *py_ue_add_actor_component(ue_PyUObject * self, PyObject * args) {
}
}

UActorComponent *component = NewObject<UActorComponent>(actor, u_class, FName(UTF8_TO_TCHAR(name)));
UActorComponent *component = NewObject<UActorComponent>(actor, u_class, FName(UTF8_TO_TCHAR(name)), RF_Public);
if (!component)
return PyErr_Format(PyExc_Exception, "unable to create component");

Expand Down Expand Up @@ -413,7 +413,7 @@ PyObject *py_ue_add_python_component(ue_PyUObject * self, PyObject * args) {
return PyErr_Format(PyExc_Exception, "uobject is not an AActor");
}

UPythonComponent *component = NewObject<UPythonComponent>(actor, FName(UTF8_TO_TCHAR(name)));
UPythonComponent *component = NewObject<UPythonComponent>(actor, FName(UTF8_TO_TCHAR(name)), RF_Public);
if (!component)
return PyErr_Format(PyExc_Exception, "unable to create component");

Expand Down Expand Up @@ -495,7 +495,7 @@ PyObject *py_ue_add_actor_root_component(ue_PyUObject * self, PyObject * args) {
return PyErr_Format(PyExc_Exception, "argument is not a class");
}

USceneComponent *component = NewObject<USceneComponent>(actor, (UClass *)py_obj->ue_object, FName(UTF8_TO_TCHAR(name)));
USceneComponent *component = NewObject<USceneComponent>(actor, (UClass *)py_obj->ue_object, FName(UTF8_TO_TCHAR(name)), RF_Public);
if (!component)
return PyErr_Format(PyExc_Exception, "unable to create component");

Expand Down
11 changes: 9 additions & 2 deletions Source/UnrealEnginePython/Private/UObject/UEPyObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ PyObject *py_ue_add_property(ue_PyUObject * self, PyObject * args) {
}
}

EObjectFlags o_flags = RF_Public | RF_MarkAsNative | RF_Transient;
EObjectFlags o_flags = RF_Public | RF_MarkAsNative;// | RF_Transient;

if (ue_is_pyuobject(obj)) {
ue_PyUObject *py_obj = (ue_PyUObject *)obj;
Expand Down Expand Up @@ -854,7 +854,14 @@ PyObject *py_ue_add_property(ue_PyUObject * self, PyObject * args) {
return PyErr_Format(PyExc_Exception, "unable to allocate new UProperty");
}

uint64 flags = CPF_Edit | CPF_BlueprintVisible | CPF_Transient | CPF_ZeroConstructor;
// one day we may want to support transient properties...
//uint64 flags = CPF_Edit | CPF_BlueprintVisible | CPF_Transient | CPF_ZeroConstructor;
uint64 flags = CPF_Edit | CPF_BlueprintVisible | CPF_ZeroConstructor;

// we assumed Actor Components to be non-editable
if (u_prop_class && u_prop_class->IsChildOf<UActorComponent>()) {
flags |= ~CPF_Edit;
}

// TODO manage replication
/*
Expand Down

0 comments on commit b157b2a

Please sign in to comment.