Monday, December 27, 2021

Blender select every other edge loop

 


If you are in blender keymap mode (CTRL ALT will not do this in industry keymap set) 

Blender keymap top edit menu>Preferences>Keymap>Blender in the top

Hold CTRL and ALT then double click an edge loop.


Then choose select Checker deselect


Then shoot select loops>edge loops


There you have it!





Friday, December 24, 2021

Easy Blender Object move pivot point (origin) without using curser!

So I just discovered this! Everywhere online tells you to try and use the curser to change the pivot center point of your game object but there is a MUCH easier way!

Simply click the little options menu in the top right corner of the view, and choose "affect only origins". BOOM you can now translate the origin point of your game object!




Sunday, December 5, 2021

BLENDER Export FBX for UNITY Settings - No Armature And Armature

 This is without an armature:

(All transforms have been applied to the object already)

Scale: 1

Apply Scalings: set to "FBX Units Scale"

Y up, -Z forward

Apply Units: UNCHECKED

Use Space Transform: CHECKED

Apply Transform: CHECKED


__________

For an FBX with Armature (This is what we used last and it worked for character to be facing the correct direction (01-25-22):

Scale .1 to be the right size in unity

Apply Scalings: set to "FBX Units Scale"

X up, -Z forward

Apply Units: UNCHECKED

Use Space Transform: CHECKED

Apply Transform: CHECKED (On 3-23-22 we successfully overwrote the old mesh and brought in one exported WITHOUT this checked since that was the saved preset - so maybe it should not be checked or it doesn't matter)

ARMATURE and MESH must both be selected before exporting or it won't orient properly once exported and brought into Unity. It doesn't matter which is selected first, you just need both selected.

_________

FBX With an Armature, but don't say Use Space Transform:

Scale .1

Apply Scalings: All Local

Forward: -Y

Up: Z up

Apply Unit: UNCHECKED

Use Space Transform: UNCHECKED

Apply Transform: UNCHECKED

Tuesday, November 30, 2021

Find the Playmaker FSM That is Turning Off a Game Object

 Issue: 

A Game Object is getting turned off by a Playmaker FSM somewhere, is there a way to find a reference to the FSM or Action doing it?


Answer:

There are a few ways to track down this kind of info.

If the deactivated gameobject has an FSM that's receiving an event to deactivate itself you can right click on the event in the Debug Log to see who sent the event.

If it's just an FSM deactivating an object it's a little more difficult. It's probably the result of an Activate Game Object action, so I would right click that action in the Action Browser to see everywhere that action is used. Then start using the log or breakpoints to narrow it down further.

You could also pause the game right after the object is deactivated and examine the FSM logs for likely candidates.


This was from: https://hutonggames.com/playmakerforum/index.php?topic=4425.0

Reposting here to be easier for myself to find and maybe could help others too as it took a while of searching to get the right keywords to answer this.



Monday, November 29, 2021

Send Event from Normcore Realtime component string to Playmaker FSM

This may look complicated but it's not as bad as it looks, let me break down the pieces it consists of.

1. The realtime Component model script (That contains a string we want to sync to all players)

2.The "sync" script that reads the model string value, updates the realtime model if you or the other player updates it and then communicates that change to the other players.

3.A FSM event script that contains the event we will send to playmaker. We will activate that FROM the sync script.

Let's get started!

We are going to create a way to send an event to a playmaker FSM to tell it when a realtime component string has changed. Normcore sends it's own events but currently I don't know how to get them to talk to playmaker FSM's.

First make the script that will be the model called SelectedResourceModel for the realtime component string. our string is called "selectedResource"

  using System.Collections;

using System.Collections.Generic;
using UnityEngine;

using Normal.Realtime.Serialization;
using Normal.Realtime;

[RealtimeModel]
public partial class SelectedResourceModel

{

    [RealtimeProperty(1, reliable: true, createDidChangeEvent: true)]
    private string _selectedResource;
}

Once that is created, you can compile that model script in the right of the inspector when you select that model script.


 

Now when that is compiled you can create the sync script that will talk to the model to sync the realtime component string. selectedResource. The script is called SelectedResourceScript

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Normal.Realtime;
using TMPro;


public class SelectedResourceScript : RealtimeComponent
{

    private SelectedResourceModel _model;
    //public RealtimeAvatarManager _avatarManager;
    private TextMeshProUGUI _selectedResourceText;
    public string selectedResourceCustom;

   

    //public ResourceStringUpdatedScript resourceStringUpdatedScript;
   

    private void Awake()
    {
            //get the reference to the selectedResource textygame object
        _selectedResourceText = GetComponent <TextMeshProUGUI>();
    }

    private SelectedResourceModel model
    {
        set
        {

            if (_model != null)
            {
                //unregister from events
                _model.selectedResourceDidChange -= SelectedResourceDidChange;
            }
        //store the model
            _model = value;

            if (_model != null)
            {
                //Update the selectedResource to match new value
               UpdateSelectedResourceText();
                // register for events so we'll nkow if the selectedResource chagnes later
                _model.selectedResourceDidChange += SelectedResourceDidChange;
            }
           
        }

    }

     private void SelectedResourceDidChange(SelectedResourceModel model, string value )
     {
            UpdateSelectedResourceText();
         

     }

     private void UpdateSelectedResourceText()
     {
         _selectedResourceText.text = "" + _model.selectedResource;
     }

     public string GetSelectedResource()
     {
         return _model.selectedResource;
     }

 

        public void SetSelectedResource(string selectedResourceCustom)
    {
        _model.selectedResource = _model.selectedResource = selectedResourceCustom;


    }    

   
}

So in this script you can see the method  private void SelectedResourceDidChange

Inside this method where we can run a method in another script to send the FSM event when it detects that the realtime component did change.

Now we need to create the textmeshproUI text for this script to go onto. The script above will sync the value of the realtime string model and update the text to the value of the model. This will let both players see the same string. 

So create a textmeshUI pro gameobect (if it's not UI then you will have to modify the script above for NOT UI textmeshpro)

Now drop the SelectedResourceScript.cs onto that textmeshproUI.

Now we need to create a little script that will actually send an FSM event WHEN the script we just made updates the text. Called ResourceStringUpdatedScript.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PlayMaker;

public class ResourceStringUpdatedScript : MonoBehaviour
{




     public PlayMakerFSM myFSM;

    // Start is called before the first frame update
    void Start()
    {
       
    }

    // Update is called once per frame
    public void ResourceUpdateString()
    {
          myFSM.SendEvent("ResourceStringUpdated");
    }
}

This will send an event to the FSM called ResourceStringUpdated. Now drop this script onto the text mesh pro game object as well. 

We created a method called ResourceUpdateString

We can now RUN this method in the SelectedResourceScript when the text is updated, and it will ALSO send our FSM event upon updating.

Add a playmaker FSM to the textmeshpro object also. What you have should look kind of like this.

MAKE SURE YOU ALSO HAVE A REALTIME VIEW on that textmeshproUI as well or the realtime component WILL NOT WORK PROPERLY.


Drag the FSM into the FSM field on your ResourceStringUpdatedScript slot for MyFSM

Now all that is left is to add the Method called ResourceUpdateString from our ResourceStringUpdatedScript. To get to the method in the other script we just add this line of code.

GetComponent<ResourceStringUpdatedScript>().ResourceUpdateString();

This shows how we add it to the DidChange Method

   private void SelectedResourceDidChange(SelectedResourceModel model, string value )
     {
            UpdateSelectedResourceText();
            GetComponent<ResourceStringUpdatedScript>().ResourceUpdateString();

     }

Now in the FSM that is on that TextmeshProUI game object. You can create and event that will fire.

Add an event with the same name as the event in the script ResourceStringUpdated


That's it! Now when your realtime changes it will automatically also fire the event in your playmaker FSM!


Friday, November 26, 2021

Setting up VRIF with Normcore in Unity

Basic idea to set up VRIF interaction framework to work with normcore goes like this.

You need the Realtime + VR player prefab which comes with the normcore install dropped into your scene and the XR rig Advanced which comes with the VRIF install.

1. Now that they are in your scene expand out the XR rig advanced so you can see the hand anchors.



2. Then the Normcore Realtime + VR player should be in the main scene with it as well.

3. Now click on the Realtime + VR player so you can get to it's Realtime Avatar Manager script in the inspector on the right.

4. Now drag the items from the XR rig advanced in the hiarchy to the Realtime Avatar Manager like so ( The script should be active, not Deactivated like in my screen grab)


The VR player is the normcore Prefab Avatar that will get instantiated automatically when you connect to a normcore room. Basically that local XR rig "puppets" the Normcore prefab Head and Hands using the transforms you linked in that Realtime Avatar Manager script.

Anything in the Normcore VR player prefab is what other players will see when you connect to a room, anything that is in the XR rig will just be visible to you locally.

Now we need to put a copy of the VRIF hands into the VR player prefab so that the other players can see them.

1. Open up the VR player prefab. 

2. From your project drag the XR rig prefab into your VR player so that you can get to some items that are inside of it. UNPACK that XR rig prefab that you have pulled in so you can reparent items. 

3.  Once you have UNPACKED that XR rig prefab and it's sitting there for you to work with. expand the hiarchy  
XR Rig Advanced>PlayerController>CameraRig>TrackingSpace

4. You should see the Right hand anchor, select that and drag it ( and of course all it's children are coming with it) and place it under the Right hand hiarchy of your VR player. 


5. Now do the same with the left handanchor.

6. You would place any head models you want the other players to see under the head game object in the VR player and a torso would go as a child of the head (with a script or playmaker to cause it to follow the head)



Note with this setup when you grab you will see the other player grab as well because VRIF doesn't know it isn't you grabbing. To fix this you need to disable the grabber game object in the VR player if the grabber isn't on your local computer. We will get into that more in a future tutorial.





Monday, November 15, 2021

50% OFF playmaker and VRIF right now!

 This sale only happens once or twice a year so it's worth grabbing these if you have been interested in them before!

Playmaker is a MUST if you want to learn game development, even if you know some programming it will make your life SOO much easier and can work hand in hand with your programming scripts. 


1. PlayerMaker ($60 for $30!)

Thursday, November 4, 2021

Sunday, October 24, 2021

Playmaker Load external files from StreamingAssets folder can't load file

I hit enough issues trying to load external files from the streaming assets folder I thought I would make a little tip about this.

Firstly, I discover that using the "Load From File" action pointing to the file path you are trying to use creates an interesting issue problem.
 


For example here is the path to a text file

"StreamingAssets/Folder1/Text.txt" 

IMPORTANT:

This path WORKS in the unity editor, but NOT in a standalone build. HERE IS THE KICKER though IT WILL work if you do a BUILD AND RUN. Which APPEARS to be your standalone build but it's NOT when it comes to that file path. This is highly confusing and took quite a bit to realize. 

Here is the solution:

Instead of creating your file path use the action in the eco system. "Get streaming assets data path" as of this writing you need to modify this action though. ( I might try to ping them and see if they will update it) It currently points to the persistent data path. You need to just tweak the one line in the action script to change it to get to the streaming assets folder instead.


Change this line 30

            streamingAssetsDataPath.Value = Application.persistentDataPath;


Change to:

            streamingAssetsDataPath.Value = Application.streamingAssetsPath;


Save and recompile, now do a build but NOT a build and run. Just Run your EXE to test. It should load the file now.

Now for the file to load when using the EDITOR you can use "Runtime Platform event" that will detect if it's a standalone or editorun and if it's the editor you need to just us a path prefix that is this. Then append your folder and file name to that.
 

Assets/StreamingAssets/

Now you should be able to load files from the streaming resources folder AND the streaming resources folder in the editor at the same time!


vray maya bake issues


Vray maya bake issues:

1. Sometimes if you are attempting to press bake in vray maya, it will do NOTHING, no messages in the script editor etc. zip nada. Closing your render window will fix this.

2. When creating the bake set for vray maya it may give a value is out of range when you select your bake options set. Closing the open hypershade fixed this.

3. When attempting to bake a large thin box in vray maya, it may bake black, this appears to be a bug. baking instead onto a plane should work. This is especially insidious because it may actually RENDER your bake from some angles, but appear black from others!

These issues have been observed in maya 2017 update 5 and vray next 4.3

Friday, October 22, 2021

Non-coders guide to making a VR game with Normcore, VRIF and Unity Part -1

So first off, if you are an amateur game designer you probably have no business trying to use normcore to make your game. However, if you are a glutton for punishment and you want the coolest possible tool for creating a game in unity with networking and multiplayer features it does some things VERY well.


The catch is it's designed as a coding framework for programmers to use so it's not SUPER easy to figure out if you don't have much programming knowledge. BUT noob game designers never let a stupid thing like coding stop them from trying to make games anyway so let's get started.


Things you will need

In order to actually make progress with little to no coding you are going to need to get a couple tools. They aren't too expensive particularly if you manage to grab them on a frequent sale. They are often half price.

UPDATE THESE ARE HALF OFF THIS WEEK FOR BLACK FRIDAY!

1. PlayerMaker ($60 for $30!)

2. VRIF (VR Interaction Framework) ($60 for $30!)

3. Normcore (free for development)

Getting started

Installing the items is pretty straight forward, it is WAY simpler than it was to set up VR related things in unity even a year ago.

Please comment if you are interested in this subject!

Part 2 we will discuss how to set up the XR Rig character from VRIF with normcore!

Changing Direction of Mayazest Blog

Hey everyone who might find yourself in this neck of the woods. This post is to just mention a bit of a change in direction for this blog. We will still be posting Maya tips most likely but  because the times they be a changing, there are going to start being a lot more Unity and even Blender info on this blog as well. I know BLENDER? Over the last 3 years blender has become ALOT more like Maya, so this isn't as absurd as it used to be.

So before you break out the tar and feathers let's talk for a moment about why! 

So for starters maya costs $200 a month to use now which didn't used to be the case before they switched to a subscription model. So we will also be posting tips about how to use Blender if you are from a maya users standpoint. We are also beginning to slant more into game development instead of Visual effects here at maya zest so that's another reason things will be changing a bit.

Hope you enjoy your day and keep on zesting!

Wednesday, September 29, 2021

Blender: Parent mesh to bones/armature and weight paint vertex groups

To parent your mesh to bones/armature: in Object Mode, select your Mesh FIRST then shift select the armature/bone you want to connect, right click over the mesh, choose "parent" and either "empty groups" or "auto groups".

After this, to go to weight paint: in Object Mode select armature/bone FIRST then your mesh then go to weight paint mode. Go to the "object data properties" tab (little green triangle) and you will see vertex groups. Select one and paint on it, this is applying weight to that vertex group.









To remove a section from a vertex group: Got to "Edit Mode" select the vertex group you want to remove something from, select the area on the mesh you want to remove from the vertex group by drag selecting. Over in the vertex group green triangle tab, click "remove" button below the vertex group list.