Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Glitchy vertex color value on default CC primitives?

Guest
Guest
Quote
2022-06-22 18:10:22

Am I going crazy because I keep getting a negative value from the default CC vertex color. If I change it, everything else is fine, but it seems to be on the cube, cone, sphere, etc. Is that a known bug or anything? Not a big deal. I've been in binary, hex, rgb hell looking to see what was causing that but haven't come up with anything. Anyone know?

Also, one other thing, can you not write file content from the editor's scripting window? Tried it a few times with no error and no file write. Seemed to work but didn't. Can we use the system() command to dump stuff into text files from there? I tried some echos but didn't get any result. Anyone know the magic command? I can do it from the command window itself, but I've tried a few different ways and the documentation is kind of sparse there. Thanks.


just_in_case
Moderator
Quote
2022-06-23 14:39:20

The default CC vertex color is (65,65,65)RGB I don't know if you are using that value or not but it works just fine for me. This value is the default for every scenenode you add in CopperCube.

Regarding write file command then yeah there are many commands like this that don't work in the editor and yeah the documentation doesn't say anything about it. But yes you can use system commands to write or read a text file in the editor.
I myself had written many plugins in the past that uses the system command to read and write a text file. But unfortunately, all of my past work has been lost due to a ransomware attack.

That is the reason why I recommend people to use system commands more often, because literally it is the most powerfull command in the javascript API of CC.

in order to use it to write a text file. first you need to change your current working directory and then execute the write command.

a sample command would be like this.

 system(" cd C:\\Users\\vazahat\\Desktop & Echo this is a sample text  by Vazahat Khan aka Just_in_case> GlitchedVelocity.txt");


the above code will create a file named on my desktop, you need to change the address to your desktop according to your username. Use & to use multiple commands in same line.

hope that bit of info is helpful.



Guest
Guest
Quote
2022-06-24 19:22:52

I was using the function from CC's mesh editing section to get the vertex color. I assume that negative value had to do with the luminosity of the color, but I did manage to figure it out. Thanks for the help, Just_In_Case, especially that system() example. I must have typed in 10 different variants of it trying to get it work. Much appreciated.


just_in_case
Moderator
Quote
2022-06-25 06:47:44

Glad that it worked out for you, for the vertex color I think you can use the basic shader example, and can also do the vertex coloring in there, by simply multiplying or adding the output with the desired Color value.
Anyways I am glad you figured that out. :)


just_in_case
Moderator
Quote
2022-06-26 07:24:03

Also since CopperCube 6, the vertex color is modulated, it was previously using color values from "0-255"
now, vertex color is modulated by 4x, the vertex Color is now ranged from 0-64. That can also be the reason why you are having issues with vertex color.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact