Quantcast
Channel: Questions in topic: "skinned mesh renderer"
Viewing all 192 articles
Browse latest View live

why "Skinned Mesh Renderer" is in a different gameobject?

$
0
0
Why not just put the "Skinned Mesh Renderer" in the parent Zombunny? (shown in the left inspector) It seems to me that the child gameobject has only one component (the "skinned mesh renderer") isn't it resundant? is there any deep reason for me not to move this component to the parent? thank you ![alt text][1] [1]: /storage/temp/94988-zombunny.jpg

Get number of specific vertex on model

$
0
0
hi all, I have a model and want to find out - say, the number of the vertex on top of the right thumb. I noticed that vertex numbers in C4D and Unity are not the same, so checking in the 3D editor is not an option. I wrote a script with bake.mesh(), which allows me to manually loop through the vertice array of the model and transform a cube with those coordinates. But this is tedious, since it takes a long time to find the vertice I want. I need those vertice numbers to get their coordinates out of the bake.mesh() array. Is there a faster way to do this? Thanks :)

Is there a mobile alternative to Light Probe Proxy Volume?

$
0
0
In my game, I have a large object that has Skinned Mesh Renderer on it. At the moment the light (from Light Probe nodes) is spreading very badly over this object. It uses one value from light probe node for whole object, which leads to resonance with the light sources. This is noticeable on the boundaries of the object, since the central part (where the anchor for the object is selected) gets the correct values from the light sample. The solution to this problem is the light probe proxy volume, which perfectly deal with this task and evenly distributes light around the object. But the hardware requirements indicate that _The component requires at least Shader Model 4 graphics hardware and API support, including support for 3D Textures with 32-bit floating-point format and linear filtering._ So the question is, what can be the solution to this problem in a mobile development (Shader Model 2). Thanks.

skinned mesh renderer, i wanna attach different part material

$
0
0
![alt text][1] [1]: /storage/temp/99671-asdf.png Hi, I have a question...
I have a 3D model and skinned mesh renderer has 4 materials. In regular sequence body, left hand, right hand, arm part material. I wanna make combination character, legs.. arms.. head.. body.. etc... so How could I control skinned mesh renderer to attach other material to other parts?
I expect step
material size skinned mesh renderer has up to 5 -> attach other material to Element4 -> displayed head txture be changed to Element4

How to add new skinned mesh to my existed character?

$
0
0
Hi! I want to add skinned mesh to my existed character without importing new character as whole. I tried to import .fbx with new mesh and all old bones to my scene. Then, I had puted new mesh (foam base on screenshot) to my character hierarchy. I had changed root_bone field to my old bone. But it is not working. My new mesh just staying in one position without any deformation from animation. ![alt text][1] [1]: /storage/temp/102358-skinned-prob.jpg

Skinned Mesh Renderers Bounds rotated incorrectly when importing from Maya.

$
0
0
![alt text][1] My model comes into Unity fine, animations work great, everything's great. Why do the skinned mesh renderer bounds look like this? does anyone have any idea what I am doing wrong regarding skinned mesh renderer bounds? If you can't see the picture, what's happening is mesh renderer bounds are rotated incorrectly when I import the model from Maya. Soon we will be doing things like calculating player height and scaling the model accordingly in VR, I fear this will not work well if the skinned mesh renderer bounds are calculated like in the picture. [1]: /storage/temp/102388-capture.png

Error when trying to change SkinnedMeshRenderer material colors on a character

$
0
0
I have an enemy that has two SkinnedMeshRenderer on it (one for head other for body). I'm trying to change the color of the materials when the enemy attack then reset it to the old (previous) color. Using Unity 2017.2.0f3 Personal (64bit). Also made a GitLab snippet: https://gitlab.com/snippets/1679439 The error: NullReferenceException: Object reference not set to an instance of an object (wrapper stelemref) object:stelemref (object,intptr,object) EnemyTest.SetupEnemy (Color skinColor) (at Assets/EnemyTest.cs:29) EnemyTest.Awake () (at Assets/EnemyTest.cs:12) EnemyTest.cs: using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyTest : MonoBehaviour { public Color attackColor = Color.green; private Material[] skinMaterial; private Color[] originalColor; void Awake () { SetupEnemy(attackColor); } void Update () { if (Input.GetButtonDown("Jump")) { StartCoroutine(Attack()); } } void SetupEnemy (Color skinColor) { SkinnedMeshRenderer[] renderers = GetComponentsInChildren(); foreach (SkinnedMeshRenderer rend in renderers) { Debug.Log("rend: " + rend.material); } for (int i = 0; i < renderers.Length; i++) { skinMaterial[i] = renderers[i].material; skinMaterial[i].color = skinColor; originalColor[i] = skinMaterial[i].color; } } IEnumerator Attack () { for (int i = 0; i < skinMaterial.Length; i++) { skinMaterial[i].color = Color.red; } // enemy does its attack yield return null; for (int i = 0; i < skinMaterial.Length; i++) { skinMaterial[i].color = originalColor[i]; } } }

import blendshape from maya

$
0
0
Hi Everyone. I'm a newbie unity user. I'm tring to import rigged model from maya that also uses blendshapes. I've watched some tuts that show that in the Inspector menu is possible to manage shapes with a slider. I can't see that slider. I've exported from maya an FBX file that has export blend shapes option ON. Next imported in Unity with import blendshapes ON in model inspector. Dragged in the Hierarchy menu. Now in the Inspector I can't see Skinned Mesh Render. Clicked on Add Component -> Mesh -> Skinned Mesh Renderer. No slider appears. I can't find a solution. Anyone could help me please? Thank you in advance

Optimizing Character Textures/Atlases for Zombie crowds

$
0
0
I am trying to figure out if it is worth it to use Texture Atlases for skinned mesh characters for a mobile game. I have 1 Zombie model with 4-6 different textures. I would have a mob of Zombies that could include all 4-6 texture variations on the same model. Assuming I just have 4 textures, Is it worth it to build a single 1024x1024 texture atlas containing all 4 textures, then shift UVs to change appearance...Or should I just use 4 separate textures at a smaller size like 256x256? Right now I don't feel the atlas approach is going to buy me much, but just wanted to get some feedback.

Mesh.bindposes official sample not working

$
0
0
Hi, I just copy and paste Mesh.bindposes official sample into unity 5.30, adjust the camera position and run. The quad is static and no any animation. Do you know what's wrong? Document: http://docs.unity3d.com/ScriptReference/Mesh-bindposes.html My code: using UnityEngine; using System.Collections; //[ExecuteInEditMode] public class Test : MonoBehaviour { // Use this for initialization void Start () { gameObject.AddComponent(); gameObject.AddComponent(); SkinnedMeshRenderer rend = GetComponent(); Animation anim = GetComponent(); // Build basic mesh Mesh mesh = new Mesh(); mesh.vertices = new Vector3[] { new Vector3(-1, 0, 0), new Vector3(1, 0, 0), new Vector3(-1, 5, 0), new Vector3(1, 5, 0) }; mesh.uv = new Vector2[] { new Vector2(0, 0), new Vector2(1, 0), new Vector2(0, 1), new Vector2(1, 1) }; mesh.triangles = new int[] { 0, 1, 2, 1, 3, 2 }; mesh.RecalculateNormals(); rend.material = new Material(Shader.Find("Diffuse")); // assign bone weights to mesh BoneWeight[] weights = new BoneWeight[4]; weights[0].boneIndex0 = 0; weights[0].weight0 = 1; weights[1].boneIndex0 = 0; weights[1].weight0 = 1; weights[2].boneIndex0 = 1; weights[2].weight0 = 1; weights[3].boneIndex0 = 1; weights[3].weight0 = 1; mesh.boneWeights = weights; // Create Bone Transforms and Bind poses // One bone at the bottom and one at the top Transform[] bones = new Transform[2]; Matrix4x4[] bindPoses = new Matrix4x4[2]; bones[0] = new GameObject("Lower").transform; bones[0].parent = transform; // Set the position relative to the parent bones[0].localRotation = Quaternion.identity; bones[0].localPosition = Vector3.zero; // The bind pose is bone's inverse transformation matrix // In this case the matrix we also make this matrix relative to the root // So that we can move the root game object around freely bindPoses[0] = bones[0].worldToLocalMatrix * transform.localToWorldMatrix; bones[1] = new GameObject("Upper").transform; bones[1].parent = transform; // Set the position relative to the parent bones[1].localRotation = Quaternion.identity; bones[1].localPosition = new Vector3(0, 5, 0); // The bind pose is bone's inverse transformation matrix // In this case the matrix we also make this matrix relative to the root // So that we can move the root game object around freely bindPoses[1] = bones[1].worldToLocalMatrix * transform.localToWorldMatrix; mesh.bindposes = bindPoses; // Assign bones and bind poses rend.bones = bones; rend.sharedMesh = mesh; // Assign a simple waving animation to the bottom bone AnimationCurve curve = new AnimationCurve(); curve.keys = new Keyframe[] { new Keyframe(0, 0, 0, 0), new Keyframe(1, 10, 0, 0), new Keyframe(2, 0.0F, 0, 0) }; // Create the clip with the curve AnimationClip clip = new AnimationClip(); clip.SetCurve("Lower", typeof(Transform), "localPosition.z", curve); clip.legacy = true; // float animationLenghtInSeconds = 2; // var rot = Quaternion.Euler(0, 0, 30); // var localRotXCurve = AnimationCurve.EaseInOut(0, transform.localRotation.x, animationLenghtInSeconds, rot.x); // var localRotYCurve = AnimationCurve.EaseInOut(0, transform.localRotation.y, animationLenghtInSeconds, rot.y); // var localRotZCurve = AnimationCurve.EaseInOut(0, transform.localRotation.z, animationLenghtInSeconds, rot.z); // var localRotWCurve = AnimationCurve.EaseInOut(0, transform.localRotation.w, animationLenghtInSeconds, rot.w); // clip.SetCurve("Lower", typeof(Transform), "localRotation.x", localRotXCurve ); // clip.SetCurve("Lower", typeof(Transform), "localRotation.y", localRotYCurve ); // clip.SetCurve("Lower", typeof(Transform), "localRotation.z", localRotZCurve ); // clip.SetCurve("Lower", typeof(Transform), "localRotation.w", localRotWCurve ); // Add and play the clip clip.wrapMode = WrapMode.Loop; anim.AddClip(clip, "test"); anim.Play("test"); } // Update is called once per frame void Update () { } }

Best armature creation for 3rd person game

$
0
0
Hey guys! So, actually im using Riggify to get a pretty nice rig, but im running into some problems at Unity. The first one is that i cant make the IK turning to work nicely (when you turn your mouse, your character turn the head more than the shoulders and the spine, for example), and the Cloth properties are kinda messed up, because the Skinned Mesh root bone is on the pinky bone of the armature, and when i change to the root one, the bounds goes nuts, and when i add the cloth... well, then it goes double nuts, to the point where the leather jacket just fly away to infinity. So... this is a Riggify problem? I should create my bones one by one, so i'll finish with the only ones that i need (not the WGT and GZM form riggify), or is there a setup on unity that i should do?![alt text][1] [1]: /storage/temp/72343-teste1.jpg

Creating a rope using skinned mesh renderer

$
0
0
I'm trying to create a physics based rope. I've got joints in a parented hierarchy. Each joint has box collider, rigidbody and hingejoint components. They follow themselves as expected. However the skinned mesh refuses to follow them. It seems that it only follows the root joint and ignores the rest. http://i.imgur.com/6bxQabR.png Here's my skinned mesh renderer settings, there really isn't that many settings to play around with. http://i.imgur.com/CHJYCwv.png What am I missing? Why does my mesh not react to all the joints? The mesh has the same amount of segments as there are joints. The segments are located between the colliders, where the joints are.

How unity order Skinned mesh renderer bones?

$
0
0
Does anyone know it? It seems that skinned mesh renderer bones order is different from transfrom in hierarchy.

Mesh Collider

$
0
0
I have a skinned mesh renderer in my scene which have cloth component attach with it, I found there is only two option sphere collider and capsule collider, I have a mesh and I want to collide with that mesh, how i can do that?

Single skinned mesh renderer with Animation component?

$
0
0
https://docs.unity3d.com/550/Documentation/Manual/ModelingOptimizedCharacters.html "Use a single skinned Mesh Renderer You should use only a single skinned Mesh Renderer for each character. Unity optimizes animation using visibility culling and bounding volume updates and these optimizations are only activated if you use one **Animation component** and one skinned Mesh Renderer in conjunction. The rendering time for a model could roughly double as a result of using two skinned meshes in place of a single mesh and there is seldom any practical advantage in using multiple meshes." 1. This mentions "Animation component", which is legacy. **Does this statement still apply for the newer Animator component?** 2. I have a hair shader which requires another UV coordinate, it could be appealing to separate the hair mesh from the body to save some vertex data in the body. **Still combining the hair and the body will be more efficient?** Thanks!

How to add a new skinned mesh to seleton

$
0
0
I need to add cape to horse. But unfortunately I could not find the instructions for this in the documentation. Cape already skinned to horse skeleton. I place horse on scene, add cape to the root of horse object (not bone), so mantle and horse located on same places in hierarchy, on cape in skinned mesh renderer component I set as root bone the root bone of horse skeleton. But horse skeleton does not affect on cape. And cape skeleton (*it saved by default from 3ds max, i also tryed to import just mesh whis skin without skeleton, that i deleted from exported file*) continues to affect the cape. By the way. Does I need save skeleton on cape when i exporting it from 3d editor? Sorry for my english.

Find world position of a vertice on a skinned mesh renderer

$
0
0
How do I get the position of one of the vertices in a skinned mesh renderer, that factors in the meshes current shape and location? I want to have a human skinned mesh that when she is hit by a small object, it sticks to her at the exact closest vertices I have all the other coding figured out, but I need to know how to get a vertices location and how to interpret it's world space location from that. Thanks all!

BuildAvatar from new rigged mesh

$
0
0
Hi, I have two rigged objects on my scene but I only have avatar on one of them. Then, what I do to anymate the second object (the one without avatar) is to try to put the first object's avatar into it. The problem is, if I do so, the second object gets automatically scaled when animating because of the avatar. Then, I decided to create a new avatar from scratch with unity, for the second avatar but I can't understand how to do it. I did something like that: for (int i = 0; i < bones.Length; i++) { scanDescription.human[i] = new HumanBone(); scanDescription.human[i].boneName = bones[i].name; scanDescription.human[i].humanName = bones[i].name; scanDescription.skeleton[i] = new SkeletonBone(); scanDescription.skeleton[i].name = bones[i].name; scanDescription.skeleton[i].position = bones[i].position; scanDescription.skeleton[i].rotation = bones[i].rotation; scanDescription.skeleton[i].scale = bones[i].localScale; } where bones is the Transform[] with the positions of the bones of the rigged objects, but this is not working. The thing is, I only have those transforms but I don't know what to put on every skeleton and what to put on every human name, bone name and so on. The avatar must be humanoid (the existing avatar is set to humanoid) The second question is, on the imported model with existing avatar, I can use the "configure" tab to see the mapping of the bones but I cannot do the same with the new created avatar

Mesh.colors is out of bounds

$
0
0
When I click on "Edit Constraints" in the cloth properties nothing happens but when I select the Object it tells me: Mesh.colors is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array. UnityEditor.ClothInspector:OnEnable() IndexOutOfRangeException: Array index is out of range. UnityEditor.ClothInspector.SetupSelectedMeshColors () (at C:/buildslave/unity/build/Editor/Mono/Inspector/ClothInspector.cs:356) UnityEditor.ClothInspector.OnEnable () (at C:/buildslave/unity/build/Editor/Mono/Inspector/ClothInspector.cs:266) This happens even with the standard Quat as Mesh in the Skinned Mesh Renderer properties. Thank you!

Mesh filter and mesh renderer. Why 2 components?

$
0
0
Hi. I am quite experienced with Unity and this question didn't pop into my head until now. I notice that there are 2 components for rendering a mesh which need each other to render, mesh filter and mesh renderer. Why didn't unity just include the mesh data in the mesh renderer itself? (Like in the case of skinned mesh renderer). Does it have some special purpose that I am not aware of or was it a bad design decision taken in the early days?
Viewing all 192 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>