• Hi Guest!

    This is a notice regarding recent upgrades to the Hub. Over the last month, we have added several new features to improve your experience.
    You can check out the details in our official announcement!

Question CUA - Animation controller and many animations in one prefab

rabbit1qaz

Active member
Messages
313
Reactions
36
Points
28
Hi i have some object in Unity, with about 10 animation which all are aded step by step to animation controler. As i make prefab in unity and import it to VAM all animation are played one by one. Is there a way to play animation i want ? now i have to create 10 prefab + one static to each animation and pack it into bundle to have em all in VAM but its so many work to do. I
 
Are there any guide how to create plugins for VAM ? im kinda work with Visual Studio and winforms in c# (not master but can do few things) but do not have unity knowledge other than how to make CUA. So how can i start ? what to learn ? my curent aim is to allow to play cua animation if there is animation controler with few of animation, and second one is to allow TimeLine to be able to operate on CUA joints (like in ZHFX supermode where you can do it but only manualy) but both ZHFX and Acid Bubbles do not have time for that so i want to do it myself( and maybe by that add something from myself for our little VAM society) :)
 
Upvote 0
In the end you need a *.cs file containing your source code. It needs a class that derives from MVRScript, which again is a Unity MonoBehaviour. If you want more than one file, you can create a *.cslist file, which is just a list of your *.cs files, plain and simple. For your first steps I recommend simply looking at existing plugins by other creators. Start simple, work your way up.

There is no proper VaM documentation worth mentioning. However, you can use ILSpy decompiler to open VaM_Data\Managed\Assembly-CSharp.dll, it contains VaM's source code. Source code is always the best documentation, because it does not lie. When using VisualStudio (or similar IDE) you would want to include some DLLs of that directory in the project references, so the IDE can help you properly with compiler errors, auto completion and so on. Personally I'm lazy and just use Notepad++, though, it's not like we have plugin projects with a 100k files here.

For your particular problem, if you place your plugin on the CUA, the following should give you the Prefab's GameObject. From there you should be able to get the Animator component (assuming that's what you are using) and control its animation.
C#:
private GameObject GetCustomUnityAsset(string prefabName)
{
    Transform t = myContainingAtom.reParentObject.Find("object/rescaleObject/"+prefabName+"(Clone)");
    if (t == null)
        return null;
    else
        return t.gameObject;
}

I would assume you want your plugin to be a bridge between the Animator component and VaM's trigger system. So you would want your plugin to expose a JSONStorableFloat, so you can control the parameter through Timeline via triggers:
C#:
// Use like this:
JSONStorableFloat storable = SetupSliderFloat("MyFancyParameter", 0.5f, 0.0f, 1.0f, false);
storable.setCallbackFunction += (float v) => {
   // do something with the changed value
};

float v = storable.val; // or read value directly


private JSONStorableFloat SetupSliderFloat(string label, float defaultValue, float minValue, float maxValue, bool rightSide)
{
    JSONStorableFloat storable = new JSONStorableFloat(label, defaultValue, minValue, maxValue, true, true);
    storable.storeType = JSONStorableParam.StoreType.Full;
    CreateSlider(storable, rightSide);
    RegisterFloat(storable);
    return storable;
}
 
Upvote 0
Thank you for claryfying that to me. I will try with that knowledge and see what can come :)

PS: is it possible to add some script to object in Unity when creating CUA so it can be onle visible in VAM when running in scene only made by certain VAM creator (or eg check some license file which i provide for my patreons), i bought some valuable assets and want to create some scene with that and do not want ppl to reuse it :) ?
 
Upvote 0
PS: is it possible to add some script to object in Unity when creating CUA so it can be onle visible in VAM when running in scene only made by certain VAM creator (or eg check some license file which i provide for my patreons), i bought some valuable assets and want to create some scene with that and do not want ppl to reuse it :) ?
An AssetBundle can not contain code. However, you can place a DLL in the same folder with the same name as the assetBundle, except with .dll. The CUA will load it automatically.

I would not waste time on DRM systems for your content, DLLs/Plugins can be easily decompiled or changed. You would just punish your legitimate users when something breaks. Also I find it rather unlikely that you found a place where you bought content you are allowed to resell in a data format that can be loaded in VaM. Basically any store out there explicitly rules that out, you always have to release a "complete game", not "assets". The only exception I know of is Sketchfab, where there is some content under CC licences.

(Not to mention its very much against VaM's core concept, if you were not able to modify a scene locally to your liking. Like changing a look, etc.)
 
Upvote 0
An AssetBundle can not contain code. However, you can place a DLL in the same folder with the same name as the assetBundle, except with .dll. The CUA will load it automatically.

I would not waste time on DRM systems for your content, DLLs/Plugins can be easily decompiled or changed. You would just punish your legitimate users when something breaks. Also I find it rather unlikely that you found a place where you bought content you are allowed to resell in a data format that can be loaded in VaM. Basically any store out there explicitly rules that out, you always have to release a "complete game", not "assets". The only exception I know of is Sketchfab, where there is some content under CC licences.

(Not to mention its very much against VaM's core concept, if you were not able to modify a scene locally to your liking. Like changing a look, etc.)

Thats intresting news for me , i have to look deeper in licence. But logicaly i do not want to give my patreons asset i bought, its is just part of my scene which is given as whole that is in, cua is just part of it and licene of scene not allow any use of it in any other scene. so i think that each of such a scene is just like small coplete game. but of course ill pass it to my legal guy so thanks of pointing potential point of problem :D

PS: why is it against core VAM concept? i have some idea to bring some good enjoyment to group of people that may like it. i pay for asset so taking risk that it wont pay off, someone thinks its good enough to be paid for (other thinks that it isnt and get it from f95 ;) )just like im paying now many creators. You think that all paid scenes are against VAM concept? What do you think is VAM concept then ? ;)
 
Last edited:
Upvote 0
so i think that each of such a scene is just like small coplete game
It isn't. However, ask the legal guy, if you have one.

why is it against core VAM concept?
The concept of VaM, as I see it, is taking stuff people made and remixing it into something else. If you use paid stuff, of course you can't share the result, but you can still make changes for your own pleasure. With your licence protection plugin, as I understand it, that would not be possible.

You think that all paid scenes are against VAM concept?
I run a Patreon myself. Paid content is fine, although I would like to encourage more creators to go for an EarlyAccess approach, and Hub-host everything later. A single creator, even working full-time, is not able to make ALL the quality content needed for a scene. Clothing, Hair, Skin, Morphs, Environment, Assets, Audio, Plugins, Mocap/Animation, Lighting, etc. Nobody has the time (and skill) to do everything him/herself. If anyone pretends they can, they did not understand what quality means and where it comes from. If my plugins were paid instead of EarlyAccess, you could not share any scenes made with them, making the plugins more or less useless? Sure, you technically can share a scene that references some paid VAR, but legally you can only reference the VAR, not actually included the paid content. It's super annoying to track down various dependencies needed for a scene. When its Hub-hosted you just press "Download All" and done instead.
 
Upvote 0
i bought some valuable assets and want to create some scene with that and do not want ppl to reuse it :) ?
Well, if you bought assets you could use them only for yourself.
Sadly you don't have the right to share it, even into your scene (it'll be available as assetbundle in your package anyway).

By making it paid, the original creator of the asset is the first one who does not "want ppl to reuse it".
 
Upvote 0
Well, if you bought assets you could use them only for yourself.
Sadly you don't have the right to share it, even into your scene (it'll be available as assetbundle in your package anyway).

By making it paid, the original creator of the asset is the first one who does not "want ppl to reuse it".
But i do not talk about VAM Paid assets but assets that are create and sells as game ready asset on the site like turbosquid or sketchfab and so on. So its primary function is to be use in games.
 
Upvote 0
But i do not talk about VAM Paid assets but assets that are create and sells as game ready asset on the site like turbosquid or sketchfab and so on.
You've got to check the licences, because not only you're using them but you're also redistributing them as assetbundles.

There is currently no way to avoid that.
 
Upvote 0
You've got to check the licences, because not only you're using them but you're also redistributing them as assetbundles.
But if someone create game in ie unity, there are also assets in game. Is it not the same situation. The game have license which say that you cannot legaly get its assets and use it freely, so if there is same license in scene and in install folder and here and there isnt it enough ?

eg fragment of UnityAssetStore license: " license to the Asset to integrate it only as incorporated and embedded components of electronic applications and digital media and distribute such electronic application and digital media; "

so if i gives my patreon var which incorporate all assets in it its whole game(or digital media). i do not sell asset solely nor it is intended to sell it as asset but as integrated part of whole scene with clearly inscene said license that it cannot be used outside my scene.
 
Last edited:
Upvote 0
Back
Top Bottom