Forgot your password?
Click here
•
No account yet?
Please Register
•
Or login using
EN
Login
Toggle Navigation
Products
What's New in H21
Overview
Animation
Rigging
CFX
VFX
Lookdev
Copernicus
Terrain & Modeling
Houdini
Overview
VFX
World Building
Lookdev
Characters
Modeling
Pipeline & AI
Houdini Engine
Overview
Engine Plug-Ins
Batch
Karma Renderer
Overview
Compare
Compare
SideFX Labs
Partners
Industries
Film & TV
Game Development
Motion Graphics
Virtual Reality
Synthetic Data for AI/ML
Community
Forum
News Feed
Overview
Project Profiles
Houdini HIVE Events
Contests & Jams
Gallery
Event Calendar
User Groups
Artist Directory
Houdini Merch Store
Learn
Tutorials
Overview
My Learning
Learning Paths
Tutorial Library
Content Library
Tech Demos
Talks & Webinars
Education Programs
Overview
Students
Instructors
Administrators
List of Schools
Resources
Support
Customer Support
Licensing
Overview
Commercial
Indie
Education
Help Desk | FAQ
H21 System Requirements
Documentation
Changelog / Journal
Report a Bug/RFE
Try | Buy
Try
Buy
Download
Contact Info
Advanced Search
Forums
Technical Discussion
Delete by id %
Delete by id %
12939
8
1
circusmonkey
Member
2624 posts
Joined: Aug. 2006
Offline
Feb. 25, 2016 4:02 a.m.
Hi Brains trust,
Is there a way to delete points by a ID % . I can already delete by a % with $PT as there's $NPT to give you the total. I can delete based on a id number ie
$ID <= 3000
I just thought there might be something more elegant
Any ideas
rob
Gone fishing
Skybar
Member
166 posts
Joined: March 2013
Offline
Feb. 25, 2016 5:14 a.m.
You could do something like rand(@id) > 0.5. Maybe not the most controllable, but should get you roughly a correct percentage.
circusmonkey
Member
2624 posts
Joined: Aug. 2006
Offline
Feb. 25, 2016 3:26 p.m.
Thanks ….
Gone fishing
samswiftglasman
Member
85 posts
Joined: Aug. 2010
Offline
Feb. 25, 2016 4:16 p.m.
in a attribute wrangle running on points you can use:
int modulus = 5;
if (@id %modulus==0 )
{
removepoint( geoself(), @ptnum );
}
the code above is tested
Edited by -
Feb. 25, 2016 16:22:00
Sam Swift-Glasman
Art Director
Five AI
circusmonkey
Member
2624 posts
Joined: Aug. 2006
Offline
Feb. 25, 2016 4:18 p.m.
I am going to test that as soon as I get to work !
Rob
Gone fishing
samswiftglasman
Member
85 posts
Joined: Aug. 2010
Offline
Feb. 25, 2016 4:49 p.m.
my example above would remove 20% of points
using a modulus is fine if you want to remove a simple amount ie half %2, a third %3 ect
I had another go and realised that to use a percentage instead you could use the following snippet:
int percentage = 75;
if ( @id % 100 < percentage )
{
removepoint( geoself(), @ptnum );
}
Sam Swift-Glasman
Art Director
Five AI
circusmonkey
Member
2624 posts
Joined: Aug. 2006
Offline
Feb. 25, 2016 6:38 p.m.
Very cool and going straight into my online notebook
Rob
Gone fishing
samswiftglasman
Member
85 posts
Joined: Aug. 2010
Offline
Feb. 28, 2016 6:30 p.m.
No problem
is your notebook public? I wouldn't mind having a look if so
do you have a link?
cheers
Sam Swift-Glasman
Art Director
Five AI
circusmonkey
Member
2624 posts
Joined: Aug. 2006
Offline
Feb. 28, 2016 7:23 p.m.
PM sent
Rob
Gone fishing
Quick Links
Search links
Show recent posts
Show unanswered posts
Jump to
News
Houdini Indie and Apprentice
Houdini Lounge
Technical Discussion
Work in Progress
Houdini Learning Materials
BYOC + Illume
Houdini for Realtime
Solaris and Karma
Rigging
Animation
PDG/TOPs
Copernicus
The Orbolt Smart 3D Asset Store
Houdini Jobs
日本語フォーラム
Licensing
Houdini Engine API
Houdini Engine for Unreal
Houdini Engine for Unity
Houdini Engine for Maya
Houdini Engine for 3ds Max
2025 Game Art Challenge
How to Houdini Tutorial Contest
Mardini 2025
Mardini 2023
H20 Tech Art Challenge
Mardini 2024
SideFX Labs Tech Art Challenge 2022
MARDINI Daily Art Challenge 2022
SideFX Labs Tech Art Challenge 2021
MARDINI Daily Challenge 2021
Nodevember 2020
HOULY Daily Challenge
3rd Party
SI Users
Choose language
English
日本語