#editable images
1 messages · Page 1 of 1 (latest)
Decals?
There are not editable meshes and there are some protips with images, but The BEST way to edit meshes, is doing a Mesh-Gif, like an image gif, but with meshes
** You are now Level 2! **
YES EXACTLY
thats something that i beeen stuck on
trying to project a editable image decal of a grass texture onto a editable mesh terrain
oh im not talking about 2D editable images im talking about like world space Eimage where you project it onto a editable mesh
let me show you guys my current broken script and could you tell me if its missing something or is somthing in it incorrect?
local AssetService = game:GetService("AssetService")
local function eImageTexturingSystem(eMesh: EditableMesh, meshPart: BasePart, raycastHitPos: Vector3)
local eImageTextureId = "rbxassetid://12989562922" -- ID of the texture you want to project
local textureSize = Vector2.new(2048, 2048)
-- Create editable image for the final projection
local editableImage = AssetService:CreateEditableImage({Size = textureSize})
-- Load decal as an editable image from asset ID
local decalImage
local success, result = pcall(function()
return AssetService:CreateEditableImageAsync(Content.fromUri(eImageTextureId), {Size = textureSize})
end)
if success then
decalImage = result
else
warn("Error loading the texture:", result)
return
end
-- Relative position of the hit point
local relativePos = meshPart.CFrame:PointToWorldSpace(raycastHitPos)
-- Direction toward the camera (optional if unused)
local direction = (workspace.CurrentCamera.CFrame.Position - relativePos).Unit
-- Configure projection parameters (adjusted to one chunk)
local projectionParams: ProjectionParams = {
Direction = Vector3.new(0, -1, 0), -- Projecting downward
Position = meshPart.Position + Vector3.new(0, 10, 0), -- Projecting from above
Size = Vector3.new(meshPart.Size.X, 20, meshPart.Size.Z), -- Coverage area: width and depth of the chunk
Up = Vector3.new(0, 1, 0)
}
-- Set up the brush for projection
local brushConfig: BrushConfig = {
Decal = decalImage,
ColorBlendType = Enum.ImageCombineType.BlendSourceOver,
AlphaBlendType = Enum.ImageAlphaType.Default,
BlendIntensity = 1,
FadeAngle = 90.0
}
-- Apply the projected texture to the EditableMesh
local paintSuccess, paintError = pcall(function()
editableImage:DrawImageProjected(eMesh, projectionParams, brushConfig)
end)
if not paintSuccess then
warn("Error projecting the image:", paintError)
end
end
-- Set up the brush for projection
local brushConfig: BrushConfig = {
Decal = decalImage,
ColorBlendType = Enum.ImageCombineType.BlendSourceOver,
AlphaBlendType = Enum.ImageAlphaType.Default,
BlendIntensity = 1,
FadeAngle = 90.0
}
-- Apply the projected texture to the EditableMesh
local paintSuccess, paintError = pcall(function()
editableImage:DrawImageProjected(eMesh, projectionParams, brushConfig)
end)
if not paintSuccess then
warn("Error projecting the image:", paintError)
end
end
@dreamy inlet I think this script can help u
THANK YOU SOOOO MUCH MAN!!!!!!!!!!!!!!!!!!!!!!!!
LIFE SAVER