ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperCube > Programming and Scripting
forum topic indicator Batch scale texture coords plugin?
person icon
hadoken
Guest
Quote
2023-01-29 15:25:00

(Editor-> Modify Selection -> Set planar texture coords for mesh ...)

Any ideas how to address that feature of texure coords scaling by scripting for making a batch plugin to change multiple objects uv scale at once?

Thanks in advance.

person icon
just_in_case
Moderator
Quote
2023-01-29 17:19:17

You can create a plugin that can set or change the texture coords of all the objects in a folder. You can put all the objects that you want to change texcoords in a folder node, and then can use the polygon(Mesh) editing API to scale or change the texcoords using a for loop for all the objects inside that folder node.

I wish there is an easy way to move (parent/unparent) multiple objects at once to a scene node in CC.

person icon
hadoken
Guest
Quote
2023-01-29 20:45:04

Thanks for your tips @just_in_case. Looping through a parent folder is no problem, but I'm not sure what the "polygon(Mesh) editing API" exactly would be. Are we talking about ccbSetMeshBufferVertexTextureCoord or am I missing anything else?

person icon
just_in_case
Moderator
Quote
2023-01-30 06:54:39

@hadoken, yes I am talking about same API as you mentioned, but might also need to use other commands as well along with the above ccbSetMeshBufferVertexTextureCoord command, depends on how you want to scale your texture coords.

to get you started here is the link to the behavior developed by @smnMhmdy that alters the texturecoords of a node in order to move them in a direction. You will understand it much better if you go through the source.

https://neophyte.cf/ccb_behavior...

person icon
hadoken
Guest
Quote
2023-01-30 16:12:32

thanks for the confirmation @just_in_case.

I've already learned how to alter texcoords positions from @smnMhmdy's script before (in fact I've already coded a nice working spritesheet behavior with it as opengl alternative). But so far I haven't dealt with scaling yet. I guess I'll have a look into it...

https://i.ibb.co/MZYvPhK/Hadoken...

person icon
just_in_case
Moderator
Quote
2023-01-31 04:55:06

I like the sprite sheet behavior, and that oldscreen effect, and that too on webGL. I believe when you created that behavior you are already doing the scaling of UV, otherwise how you would be able to showcase the one single sprite from a spritesheet, you did scaled and offset the texcoords already.

person icon
hadoken
Guest
Quote
2023-01-31 10:01:22

Man, you're right @just_in_case - of course I've already had to scale texture coords in my script for managing rows an columns appropriately - had even combined it with an extra pixelate fx option! Unfortunately my work was done some time ago, so I didn't remember correctly how I got this to work. But now I'll investigate back again and will sort some things out... maybe put it on itch.io soon.

Looks like the knowledge was already in my hands. Also I've created so many cool things in CopperCube lately, seems like it's a bit hard to keep track of it ;- )

emoji icon_happy

P.S. Script does only work with Win target at the moment (but with both Direct3D & OpenGL).


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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