Skip to content

Commit

Permalink
4.25 jsonv3 (#20)
Browse files Browse the repository at this point in the history
* adding updatet image of smart suit receiver

* Delete smartSuitReciverSetup.PNG

* adding Smart Suit Receiver v002

* changing live link 2.0 to Studio Live

* renamed SmartsuitReceiver to RokokoReceiver
added new variable to receiver for port number, called RokokoPortNumber
renamed "Rokoko body pose" to "Rokoko Body Pose"

* changed title

I changed the title to match all other plugins naming
Rokoko studio to Rokoko studio live

* fixed compile errors

* added new picture for the documentation

* added picture to the documentation

* Added actor name clarification

* Editing spelling mistake

* fixed json parsing code

* Updating readme to new format

* Updating "getting started"

* updating title on documentation

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Changing version number

* Add files via upload

* Add files via upload

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

* Renamed SmartsuitUIController to RokokoUIController

* removed UPROPERTY() parameters from BoneMap

* added Category parameter to UFUNCTION() and UPROPERTY() macros

* added 2 new functions for getting prop location and rotation, cleaned up some bps

* any missing/incorrect bone names in the bone map override now give the correct error in the anim bp and no longer prevent the mesh from animating

* reenabled command api

* fixed some errors preventing compilation for 4.26

Co-authored-by: rasmusRokoko <[email protected]>
Co-authored-by: karavias <[email protected]>
  • Loading branch information
3 people authored Nov 26, 2020
1 parent b849d9e commit 71d0c68
Show file tree
Hide file tree
Showing 21 changed files with 386 additions and 443 deletions.
Binary file modified Content/Maps/SmartsuitAndPropsExampleMap.umap
Binary file not shown.
Binary file modified Plugins/Smartsuit/Content/Blueprints/RokokoLiveCamera.uasset
Binary file not shown.
Binary file modified Plugins/Smartsuit/Content/Blueprints/RokokoLiveProp_BP.uasset
Binary file not shown.
Binary file modified Plugins/Smartsuit/Content/Blueprints/RokokoLiveTracker_BP.uasset
Binary file not shown.
Binary file not shown.
Binary file modified Plugins/Smartsuit/Content/Maps/GettingStarted.umap
Binary file not shown.
Binary file modified Plugins/Smartsuit/Content/Mesh/Newton/NewtonAnimation_BP.uasset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ void URokokoStudioCommandAPI::Restart(const FRokokoCommandAPI_IPInfo& IPInfo, co
FString TrimmedUrl = URLPath;
TrimmedUrl.TrimStartAndEndInline();

#if BUILT_MINOR_VERSION >= 26
FHttpRequestRef HttpRequest = FHttpModule::Get().CreateRequest();
#else
TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();
#endif
HttpRequest->SetURL(TrimmedUrl);
HttpRequest->SetVerb(TEXT("POST"));
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
Expand All @@ -51,7 +55,11 @@ void URokokoStudioCommandAPI::Calibrate(const FRokokoCommandAPI_IPInfo& IPInfo,
FString TrimmedUrl = URLPath;
TrimmedUrl.TrimStartAndEndInline();

#if BUILT_MINOR_VERSION >= 26
FHttpRequestRef HttpRequest = FHttpModule::Get().CreateRequest();
#else
TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();
#endif
HttpRequest->SetURL(TrimmedUrl);
HttpRequest->SetVerb(TEXT("POST"));
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
Expand All @@ -73,7 +81,11 @@ void URokokoStudioCommandAPI::StartRecording(const FRokokoCommandAPI_IPInfo& IPI
FString TrimmedUrl = URLPath;
TrimmedUrl.TrimStartAndEndInline();

#if BUILT_MINOR_VERSION >= 26
FHttpRequestRef HttpRequest = FHttpModule::Get().CreateRequest();
#else
TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();
#endif
HttpRequest->SetURL(TrimmedUrl);
HttpRequest->SetVerb(TEXT("POST"));
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
Expand All @@ -89,7 +101,11 @@ void URokokoStudioCommandAPI::StopRecording(const FRokokoCommandAPI_IPInfo& IPIn
FString TrimmedUrl = URLPath;
TrimmedUrl.TrimStartAndEndInline();

#if BUILT_MINOR_VERSION >= 26
FHttpRequestRef HttpRequest = FHttpModule::Get().CreateRequest();
#else
TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();
#endif
HttpRequest->SetURL(TrimmedUrl);
HttpRequest->SetVerb(TEXT("POST"));
HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,14 @@ FTransform USmartsuitBlueprintLibrary::GetBoneTransform(USkeletalMeshComponent*
}

return BoneTransform;
}

FVector USmartsuitBlueprintLibrary::GetPropLocation(FProp InProp)
{
return InProp.UPosition();
}

FRotator USmartsuitBlueprintLibrary::GetPropRotation(FProp InProp)
{
return InProp.FQuatToRotator();
}
593 changes: 200 additions & 393 deletions Plugins/Smartsuit/Source/Smartsuit/Private/SmartsuitPoseNode.cpp

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions Plugins/Smartsuit/Source/Smartsuit/Private/SmartsuitReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,18 @@ TArray<FProp> ARokokoReceiver::GetAllProps()
return result;
}
PRAGMA_ENABLE_OPTIMIZATION
bool ARokokoReceiver::GetProp(FString name, bool isLive, FProp& OutProp)
bool ARokokoReceiver::GetProp(FString name, /*bool isLive, */FProp& OutProp)
{
//for (TObjectIterator<ARokokoReceiver> It; It; ++It)
//{
// if (It->realLife)
// {
// OutProp = *It->GetPropByNameFromVP(name, true);
// return true;
// }
//}
//return false;

//FProp result;
//for (TObjectIterator<ARokokoReceiver> It; It; ++It)
//{
Expand All @@ -170,7 +180,7 @@ bool ARokokoReceiver::GetProp(FString name, bool isLive, FProp& OutProp)
//}
//return result;

if (FProp* prop = GetPropByNameFromVP(name, isLive))
if (FProp* prop = GetPropByNameFromVP(name, true))
{
OutProp = *prop;
return true;
Expand Down
6 changes: 3 additions & 3 deletions Plugins/Smartsuit/Source/Smartsuit/Public/RokokoRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class SMARTSUIT_API ARokokoRemote : public AActor

virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;

UPROPERTY(EditAnywhere, BlueprintReadOnly)
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Default)
FString IPAddress;

UPROPERTY()
Expand All @@ -73,10 +73,10 @@ class SMARTSUIT_API ARokokoRemote : public AActor
UPROPERTY(BlueprintAssignable)
FOnDisconnected OnDisconnected;

UFUNCTION(BlueprintPure)
UFUNCTION(BlueprintPure, Category = Default)
FString GetCommandAPIKey();

UFUNCTION(BlueprintPure)
UFUNCTION(BlueprintPure, Category = Default)
int32 GetCommandAPIPort();

TSharedPtr<FInternetAddr> RemoteAddr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,10 @@ class USmartsuitBlueprintLibrary : public UBlueprintFunctionLibrary
static FTransform GetRefPoseBoneTransform(USkeletalMeshComponent* SkelMesh, FName BoneName);

static FTransform GetBoneTransform(USkeletalMeshComponent* SkelMesh, FName BoneName);

UFUNCTION(BlueprintPure)
static FVector GetPropLocation(FProp InProp);

UFUNCTION(BlueprintPure)
static FRotator GetPropRotation(FProp InProp);
};
18 changes: 9 additions & 9 deletions Plugins/Smartsuit/Source/Smartsuit/Public/SmartsuitDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,34 +377,34 @@ struct FSuitData
void ParseBone(TSharedPtr<FJsonObject> jsonObject, const FString& BoneName);

/** The name of the Smartsuit. */
UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category=Default)
FString suitname;

uint32_t timestamp;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category=Default)
FString id;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category=Default)
bool isLive;

/** The name of the profile. */
UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = Default)
FString profileName;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = Default)
bool hasGloves;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = Default)
bool hasBody;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = Default)
bool hasFace;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = Default)
FString faceId;

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = Default)
FLinearColor color;

TMap<FName, FSmartsuitBone> SmartsuitBones;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ struct SMARTSUIT_API FSmartsuitPoseNode : public FAnimNode_SkeletalControlBase
GENERATED_USTRUCT_BODY()

/** Bone mapping between Smartsuit sensors and character's humanoid bones. */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = SmartsuitAnimationSetup, meta = (ToolTip = "A mapping between the Smartsuit expected bone names and the bones that will animate from the Smartsuit component. Every bone is required for the animation to work properly."))
UPROPERTY(/*EditAnywhere, BlueprintReadWrite, Category = SmartsuitAnimationSetup, meta = (NeverAsPin, ToolTip = "A mapping between the Smartsuit expected bone names and the bones that will animate from the Smartsuit component. Every bone is required for the animation to work properly.")*/)
FSmartsuitBodyMap BoneMap;

UPROPERTY(EditAnywhere, Category = SmartsuitAnimationSetup)
Expand Down
16 changes: 8 additions & 8 deletions Plugins/Smartsuit/Source/Smartsuit/Public/SmartsuitReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ class SMARTSUIT_API ARokokoReceiver : public AActor
UFUNCTION(BlueprintCallable, Category = "Rokoko")
void StopListener();

UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = Default)
FFace GetFaceByFaceID(FString faceName);

UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = Default)
FFace GetFaceByProfileName(const FString& faceName, bool& found);

UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = Default)
TArray<FFace> GetAllFaces();

UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = Default)
TArray<FFace> GetFacesNotAssociatedWithActor();

/**
Expand All @@ -67,7 +67,7 @@ class SMARTSUIT_API ARokokoReceiver : public AActor
*/
FSuitData* GetSmartsuit(FString suitName);

UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = Default)
bool GetSmartsuitByName(const FString& suitName, FSuitData& SuitData);

/**
Expand All @@ -76,10 +76,10 @@ class SMARTSUIT_API ARokokoReceiver : public AActor
*
* @return Returns an array with all the available in the network Smartsuit names.
*/
UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = Default)
TArray<FString> GetAvailableSmartsuitNames();

UFUNCTION(BlueprintCallable)
UFUNCTION(BlueprintCallable, Category = Default)
TArray<FSuitData> GetAllSmartsuits();

/**
Expand Down Expand Up @@ -135,7 +135,7 @@ class SMARTSUIT_API ARokokoReceiver : public AActor
//}

UFUNCTION(BlueprintPure, Category = "VirtualProduction", meta = (ToolTip = "Calls a function in VPStreamingNetwork to retrieve a prop by name."))
bool GetProp(FString name, bool isLive, FProp& OutProp);
bool GetProp(FString name, /*bool isLive, */FProp& OutProp);
//{
// FProp result;
// for (TObjectIterator<ARokokoReceiver> It; It; ++It)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ struct FFace
FFace() {}
FFace(TSharedPtr<FJsonObject> jsonObject, const FString& InActorName);

UPROPERTY(BlueprintReadOnly)
UPROPERTY(BlueprintReadOnly, Category = "Virtual Production")
FString profileName;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Virtual Production", meta = (ToolTip = "Face's version."))
int version;
Expand Down
Loading

0 comments on commit 71d0c68

Please sign in to comment.