这篇教程C++ ue_py_check函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ue_py_check函数的典型用法代码示例。如果您正苦于以下问题:C++ ue_py_check函数的具体用法?C++ ue_py_check怎么用?C++ ue_py_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ue_py_check函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ue_py_checkPyObject *py_ue_get_player_pawn(ue_PyUObject *self, PyObject * args){ ue_py_check(self); int controller_id = 0; if (!PyArg_ParseTuple(args, "|i:get_player_pawn", &controller_id)) { return NULL; } UWorld *world = ue_get_uworld(self); if (!world) return PyErr_Format(PyExc_Exception, "unable to retrieve UWorld from uobject"); APlayerController *controller = UGameplayStatics::GetPlayerController(world, controller_id); if (!controller) return PyErr_Format(PyExc_Exception, "unable to retrieve controller %d", controller_id); // the controller could not have a pawn if (!controller->GetPawn()) Py_RETURN_NONE; Py_RETURN_UOBJECT(controller->GetPawn());}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:25,
示例2: ue_py_checkPyObject *py_ue_actor_has_tag(ue_PyUObject * self, PyObject * args) { ue_py_check(self); char *tag; if (!PyArg_ParseTuple(args, "s:actor_has_tag", &tag)) { return NULL; } if (!self->ue_object->IsA<AActor>()) { return PyErr_Format(PyExc_Exception, "uobject is not an AActor"); } AActor *actor = (AActor *)self->ue_object; if (actor->ActorHasTag(FName(UTF8_TO_TCHAR(tag)))) { Py_INCREF(Py_True); return Py_True; } Py_INCREF(Py_False); return Py_False;}
开发者ID:ckyun777,项目名称:UnrealEnginePython,代码行数:25,
示例3: ue_py_checkPyObject *py_ue_actor_set_level_sequence(ue_PyUObject * self, PyObject * args){ ue_py_check(self); PyObject *py_sequence; if (!PyArg_ParseTuple(args, "O:actor_set_level_sequence", &py_sequence)) { return NULL; } ALevelSequenceActor *actor = ue_py_check_type<ALevelSequenceActor>(self); if (!actor) { return PyErr_Format(PyExc_Exception, "uobject is not a LevelSequenceActor"); } ULevelSequence *sequence = ue_py_check_type<ULevelSequence>(py_sequence); if (!sequence) { return PyErr_Format(PyExc_Exception, "argument is not a LevelSequence"); } actor->SetSequence(sequence); Py_RETURN_NONE;}
开发者ID:rdsgautier,项目名称:UnrealEnginePython,代码行数:27,
示例4: ue_py_checkPyObject *py_ue_controller_posses(ue_PyUObject * self, PyObject * args) { ue_py_check(self); PyObject *obj; if (!PyArg_ParseTuple(args, "O:posses", &obj)) { return NULL; } if (!self->ue_object->IsA<AController>()) { return PyErr_Format(PyExc_Exception, "uobject is not an APawn"); } if (!ue_is_pyuobject(obj)) { return PyErr_Format(PyExc_Exception, "argument is not a UObject"); } ue_PyUObject *py_obj = (ue_PyUObject *)obj; if (!py_obj->ue_object->IsA<APawn>()) { return PyErr_Format(PyExc_Exception, "argument is not a APAwn"); } APawn *pawn = (APawn *)py_obj->ue_object; AController *controller = (AController *)self->ue_object; controller->Possess(pawn); Py_INCREF(Py_None); return Py_None;}
开发者ID:ckyun777,项目名称:UnrealEnginePython,代码行数:31,
示例5: ue_py_checkPyObject *py_ue_skeletal_mesh_register_morph_target(ue_PyUObject *self, PyObject * args){ ue_py_check(self); PyObject *py_morph; if (!PyArg_ParseTuple(args, "O:skeletal_mesh_register_morph_target", &py_morph)) { return nullptr; } USkeletalMesh *mesh = ue_py_check_type<USkeletalMesh>(self); if (!mesh) return PyErr_Format(PyExc_Exception, "uobject is not a SkeletalMesh"); UMorphTarget *morph = ue_py_check_type<UMorphTarget>(py_morph); if (!morph) return PyErr_Format(PyExc_Exception, "argument is not a MorphTarget");#if ENGINE_MINOR_VERSION > 16 if (!morph->HasValidData()) return PyErr_Format(PyExc_Exception, "the MorphTarget has no valid data");#endif mesh->PreEditChange(nullptr); mesh->RegisterMorphTarget(morph); mesh->PostEditChange(); mesh->MarkPackageDirty(); Py_RETURN_NONE;}
开发者ID:rdsgautier,项目名称:UnrealEnginePython,代码行数:34,
示例6: ue_py_checkPyObject *py_ue_is_input_key_down(ue_PyUObject *self, PyObject * args){ ue_py_check(self); char *key; int controller_id = 0; if (!PyArg_ParseTuple(args, "s|i:is_input_key_down", &key, &controller_id)) { return NULL; } UWorld *world = ue_get_uworld(self); if (!world) return PyErr_Format(PyExc_Exception, "unable to retrieve UWorld from uobject"); APlayerController *controller = UGameplayStatics::GetPlayerController(world, controller_id); if (!controller) return PyErr_Format(PyExc_Exception, "unable to retrieve controller %d", controller_id); if (controller->IsInputKeyDown(key)) { Py_INCREF(Py_True); return Py_True; } Py_INCREF(Py_False); return Py_False;}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:29,
示例7: ue_py_checkPyObject *py_ue_draw_debug_line(ue_PyUObject * self, PyObject * args){ ue_py_check(self); PyObject *py_obj_start; PyObject *py_obj_end; PyObject *py_color; float duration = 0; float thickness = 0; UWorld *world = ue_get_uworld(self); if (!world) return PyErr_Format(PyExc_Exception, "unable to retrieve UWorld from uobject"); if (!PyArg_ParseTuple(args, "OOO|ff:draw_debug_line", &py_obj_start, &py_obj_end, &py_color, &duration, &thickness)) { return NULL; } ue_PyFVector *start = py_ue_is_fvector(py_obj_start); ue_PyFVector *end = py_ue_is_fvector(py_obj_end); if (!start || !end) return PyErr_Format(PyExc_Exception, "start and end location must be vectors"); ue_PyFLinearColor *py_linear_color = py_ue_is_flinearcolor(py_color); if (!py_linear_color) return PyErr_Format(PyExc_Exception, "argument is not a FLinearColor"); UKismetSystemLibrary::DrawDebugLine(world, start->vec, end->vec, py_linear_color->color, duration, thickness); Py_RETURN_NONE;}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:35,
示例8: ue_py_checkPyObject *py_ue_set_blend_parameter(ue_PyUObject * self, PyObject * args){ ue_py_check(self); int index; PyObject *py_blend; if (!PyArg_ParseTuple(args, "iO:get_blend_parameter", &index, &py_blend)) return nullptr; UBlendSpaceBase *blend = ue_py_check_type<UBlendSpaceBase>(self); if (!blend) return PyErr_Format(PyExc_Exception, "UObject is not a UBlendSpaceBase."); if (index < 0 || index > 2) return PyErr_Format(PyExc_Exception, "invalid Blend Parameter index"); FBlendParameter *parameter = ue_py_check_struct<FBlendParameter>(py_blend); if (!parameter) return PyErr_Format(PyExc_Exception, "argument is not a FBlendParameter"); const FBlendParameter & orig_parameter = blend->GetBlendParameter(index); FMemory::Memcpy((uint8 *)&orig_parameter, parameter, FBlendParameter::StaticStruct()->GetStructureSize()); Py_RETURN_NONE;}
开发者ID:rdsgautier,项目名称:UnrealEnginePython,代码行数:26,
示例9: ue_py_checkPyObject *py_ue_get_world_location_at_distance_along_spline(ue_PyUObject * self, PyObject * args){ ue_py_check(self); float distance = 0; if (!PyArg_ParseTuple(args, "f:get_world_location_at_distance_along_spline", &distance)) { return NULL; } USplineComponent *spline = nullptr; if (self->ue_object->IsA<USplineComponent>()) { spline = (USplineComponent *)self->ue_object; } else { return PyErr_Format(PyExc_Exception, "uobject is not a USplineComponent"); } if (!spline) { return PyErr_Format(PyExc_Exception, "unable to get spline object"); } FVector location = spline->GetWorldLocationAtDistanceAlongSpline(distance); return py_ue_new_fvector(location);}
开发者ID:20tab,项目名称:UnrealEnginePython,代码行数:31,
注:本文中的ue_py_check函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uefi_call_wrapper函数代码示例 C++ uds_minor函数代码示例 |