Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem


Yeah, it's because the RenderModel script loads the model, from your local SteamVR installation folder, then splits it up into parts and stuff. It does the same with the texture, that's why it's hard to figure out where to inject the texture - It's not a Texture2D, until after a lot of of stuff has been done to it.
"SteamVR_Utils.Event.Listen("render_model_loaded",<Function>);" )
after which you can go in and change the materials or parts at will.
This isn't making the script load from obj like the controller worksop modding, but it's unity, so you can just set the meshfilter to a different mesh if you want, or link stuff on instead.
I have a clunky little bit of code that goes in and matches parts by name, which hasn't been bad so far, so fingers crossed.
Names are:
new string[]{"base","body","button","trackpad","trackhat","lgrip","rgrip","trigger","trackpad_touch"};
But RenderModel has changed the texture by that point (Reordered the pixels or something? The code looks pretty confusing to me). When I tried adding the new texture (A recolor of the one found in the SteamVR installation folder) after RenderModel is done, it didn't fit at all! So I need to inject it before the changes...
EDIT: Okay I get what you mean. I think I can make this work.
Here's the script I ended up using: http://pastebin.com/ihcxi39x Don't forget to rotate and flip your texture!
I moved it to Start() and it works fine and there's no more CPU overhead. Here's a link to the updated script: http://pastebin.com/ShJFcfnn
Good call guys! Must've slipped my mind back then. I updated my script.
Cool, good job! Hope oyu don't mind I shared this on my reddit thread: https://www.reddit.com/r/Vive/comments/4lpfdc/replacing_the_vive_controlelr_texture_in_unity/
It's very strange that no matter what the rotation of the mesh I put in from my 3d modelling software, I always get the same orientation out (the flipped 180 one).
I'm not a 3d modeller so it's possible I'm doing something wrong in the Maya and Blender, however I am aware of the differences in coord systems and how to compensate so I don't think that's it.
Did anyone else have a problem like this?
That's odd! I'm really busy at work as of late, but if I don't forget, I'll look at the model I've used and try to give you some pointers.
Currently the example scene is VRTK/Examples/032_Controller_CustomControllerModel
If you're still looking for an answer, you might need to Reset XForms in Maya :)